Milian Wolff
9126cbbace
perf unwind: Report module before querying isactivation in dwfl unwind
...
The PC returned by dwfl_frame_pc() may map into a not-yet-reported
module. We have to report it before we continue unwinding. But when we
query for the isactivation flag in dwfl_frame_pc, libdw will actually do
one more unwinding step internally which can then break and lead to
missed frames or broken stacks.
With libunwind we get e.g.:
~~~~~
heaptrack_gui 2228 135073.400474: 613969 cycles:
108c8e [unknown] (/usr/lib/libQt5Core.so.5.8.0)
1093bc [unknown] (/usr/lib/libQt5Core.so.5.8.0)
109e7b QLocale::QLocale (/usr/lib/libQt5Core.so.5.8.0)
1470ff [unknown] (/usr/lib/libQt5Core.so.5.8.0)
147f67 QSystemLocale::query (/usr/lib/libQt5Core.so.5.8.0)
109fbf QLocalePrivate::updateSystemPrivate (/usr/lib/libQt5Core.so.5.8.0)
10aa27 QLocale::QLocale (/usr/lib/libQt5Core.so.5.8.0)
1e02c3 [unknown] (/usr/lib/libQt5Core.so.5.8.0)
2113bb [unknown] (/usr/lib/libQt5Core.so.5.8.0)
211505 [unknown] (/usr/lib/libQt5Core.so.5.8.0)
1b5df0 QFileInfo::exists (/usr/lib/libQt5Core.so.5.8.0)
92eb2 [unknown] (/usr/lib/libQt5Core.so.5.8.0)
93423 [unknown] (/usr/lib/libQt5Core.so.5.8.0)
93d2a QLibraryInfo::location (/usr/lib/libQt5Core.so.5.8.0)
2170af [unknown] (/usr/lib/libQt5Core.so.5.8.0)
297c53 QCoreApplicationPrivate::init (/usr/lib/libQt5Core.so.5.8.0)
f7cde QGuiApplicationPrivate::init (/usr/lib/libQt5Gui.so.5.8.0)
1589e8 QApplicationPrivate::init (/usr/lib/libQt5Widgets.so.5.8.0)
78622 main (/home/milian/projects/compiled/other/bin/heaptrack_gui)
20439 __libc_start_main (/usr/lib/libc-2.25.so)
78299 _start (/home/milian/projects/compiled/other/bin/heaptrack_gui)
heaptrack_gui 2228 135073.401156: 569521 cycles:
131633 QString::endsWith (/usr/lib/libQt5Core.so.5.8.0)
1a0701 QDir::cleanPath (/usr/lib/libQt5Core.so.5.8.0)
21b82d [unknown] (/usr/lib/libQt5Core.so.5.8.0)
1b3727 QFileInfo::canonicalFilePath (/usr/lib/libQt5Core.so.5.8.0)
2780c7 QFactoryLoader::update (/usr/lib/libQt5Core.so.5.8.0)
279525 QFactoryLoader::QFactoryLoader (/usr/lib/libQt5Core.so.5.8.0)
e5bd0 QPlatformIntegrationFactory::create (/usr/lib/libQt5Gui.so.5.8.0)
f5a1c QGuiApplicationPrivate::createPlatformIntegration (/usr/lib/libQt5Gui.so.5.8.0)
f650c QGuiApplicationPrivate::createEventDispatcher (/usr/lib/libQt5Gui.so.5.8.0)
298524 QCoreApplicationPrivate::init (/usr/lib/libQt5Core.so.5.8.0)
f7cde QGuiApplicationPrivate::init (/usr/lib/libQt5Gui.so.5.8.0)
1589e8 QApplicationPrivate::init (/usr/lib/libQt5Widgets.so.5.8.0)
78622 main (/home/milian/projects/compiled/other/bin/heaptrack_gui)
20439 __libc_start_main (/usr/lib/libc-2.25.so)
78299 _start (/home/milian/projects/compiled/other/bin/heaptrack_gui)
~~~~~
Note the two frames 1589e8 and 78622 in the first sample. These are
missing when unwinding with libdw. The second sample's breakage is
more obvious:
~~~~~
heaptrack_gui 2228 135073.400474: 613969 cycles:
108c8e [unknown] (/usr/lib/libQt5Core.so.5.8.0)
1093bc [unknown] (/usr/lib/libQt5Core.so.5.8.0)
109e7b QLocale::QLocale (/usr/lib/libQt5Core.so.5.8.0)
1470ff [unknown] (/usr/lib/libQt5Core.so.5.8.0)
147f67 QSystemLocale::query (/usr/lib/libQt5Core.so.5.8.0)
109fbf QLocalePrivate::updateSystemPrivate (/usr/lib/libQt5Core.so.5.8.0)
10aa27 QLocale::QLocale (/usr/lib/libQt5Core.so.5.8.0)
1e02c3 [unknown] (/usr/lib/libQt5Core.so.5.8.0)
2113bb [unknown] (/usr/lib/libQt5Core.so.5.8.0)
211505 [unknown] (/usr/lib/libQt5Core.so.5.8.0)
1b5df0 QFileInfo::exists (/usr/lib/libQt5Core.so.5.8.0)
92eb2 [unknown] (/usr/lib/libQt5Core.so.5.8.0)
93423 [unknown] (/usr/lib/libQt5Core.so.5.8.0)
93d2a QLibraryInfo::location (/usr/lib/libQt5Core.so.5.8.0)
2170af [unknown] (/usr/lib/libQt5Core.so.5.8.0)
297c53 QCoreApplicationPrivate::init (/usr/lib/libQt5Core.so.5.8.0)
f7cde QGuiApplicationPrivate::init (/usr/lib/libQt5Gui.so.5.8.0)
20439 __libc_start_main (/usr/lib/libc-2.25.so)
78299 _start (/home/milian/projects/compiled/other/bin/heaptrack_gui)
heaptrack_gui 2228 135073.401156: 569521 cycles:
131633 QString::endsWith (/usr/lib/libQt5Core.so.5.8.0)
1a0701 QDir::cleanPath (/usr/lib/libQt5Core.so.5.8.0)
21b82d [unknown] (/usr/lib/libQt5Core.so.5.8.0)
1b3727 QFileInfo::canonicalFilePath (/usr/lib/libQt5Core.so.5.8.0)
2780c7 QFactoryLoader::update (/usr/lib/libQt5Core.so.5.8.0)
279525 QFactoryLoader::QFactoryLoader (/usr/lib/libQt5Core.so.5.8.0)
e5bd0 QPlatformIntegrationFactory::create (/usr/lib/libQt5Gui.so.5.8.0)
723dbf [unknown] ([unknown])
~~~~~
This patch fixes this issue and the libdw unwinder mimicks the libunwind
behavior more closely.
Signed-off-by: Milian Wolff <milian.wolff@kdab.com>
Acked-by: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/20170602143753.16907-2-milian.wolff@kdab.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2017-06-16 14:37:30 -03:00
..
2017-04-19 13:01:51 -03:00
2016-09-01 12:41:09 -03:00
2017-03-16 17:29:23 +01:00
2016-06-23 10:30:31 -03:00
2017-06-07 20:23:22 -03:00
2017-06-08 15:39:02 -03:00
2017-04-04 21:08:00 -03:00
2017-04-19 13:01:48 -03:00
2017-04-19 13:01:51 -03:00
2016-09-08 13:44:03 -03:00
2016-09-08 13:44:03 -03:00
2017-04-19 13:01:52 -03:00
2017-04-19 13:01:51 -03:00
2017-04-19 13:01:51 -03:00
2017-04-19 13:01:51 -03:00
2017-04-25 15:45:35 -03:00
2017-06-08 15:39:34 -03:00
2017-06-08 15:39:34 -03:00
2017-03-28 11:19:59 -03:00
2016-05-06 13:00:43 -03:00
2016-05-06 13:00:43 -03:00
2017-05-24 08:41:47 +02:00
2017-03-27 12:13:28 -03:00
2017-04-19 13:01:47 -03:00
2017-03-03 19:07:14 -03:00
2017-04-19 13:01:51 -03:00
2017-03-03 19:07:19 -03:00
2016-07-12 15:20:24 -03:00
2017-04-24 13:43:33 -03:00
2017-04-24 13:43:32 -03:00
2017-04-24 12:33:33 -03:00
2017-04-24 13:43:33 -03:00
2016-11-14 13:10:37 -03:00
2017-04-19 13:01:53 -03:00
2017-04-19 13:01:55 -03:00
2017-03-03 19:07:17 -03:00
2016-09-22 12:19:40 -03:00
2017-04-19 13:01:48 -03:00
2017-04-19 13:01:51 -03:00
2016-06-28 10:54:55 -03:00
2016-06-28 10:54:56 -03:00
2017-04-19 13:01:51 -03:00
2016-04-14 08:57:54 -03:00
2016-05-30 12:41:43 -03:00
2016-05-06 13:00:53 -03:00
2017-04-24 13:43:34 -03:00
2017-04-24 12:33:31 -03:00
2017-04-19 13:01:48 -03:00
2016-02-05 09:46:45 -03:00
2016-07-12 16:12:38 -03:00
2016-07-12 16:12:38 -03:00
2017-04-19 13:01:51 -03:00
2016-09-22 12:19:41 -03:00
2017-06-08 15:39:13 -03:00
2017-06-08 15:38:55 -03:00
2017-03-16 09:24:35 -03:00
2017-03-16 09:24:35 -03:00
2017-04-19 13:01:51 -03:00
2016-09-29 11:17:08 -03:00
2017-04-19 13:01:44 -03:00
2017-04-19 13:01:51 -03:00
2016-07-04 19:39:01 -03:00
2017-05-02 18:23:04 -03:00
2017-05-04 09:59:53 -03:00
2017-04-24 13:43:32 -03:00
2017-04-20 13:22:43 -03:00
2017-05-24 08:41:48 +02:00
2017-06-14 15:44:29 -03:00
2017-03-23 11:42:31 -03:00
2017-03-23 11:39:27 -03:00
2017-03-23 11:39:27 -03:00
2016-02-05 12:33:09 -03:00
2016-10-24 11:07:40 -03:00
2016-10-24 11:07:40 -03:00
2016-01-08 12:46:17 -03:00
2016-06-06 17:04:15 -03:00
2017-06-14 15:44:29 -03:00
2016-10-03 19:58:00 -03:00
2017-04-24 13:43:34 -03:00
2015-12-14 12:30:37 -03:00
2017-04-24 13:43:35 -03:00
2017-03-14 15:17:37 -03:00
2017-04-19 13:01:51 -03:00
2017-04-25 15:45:35 -03:00
2016-09-29 11:17:05 -03:00
2016-06-23 11:39:19 -03:00
2016-03-23 15:06:35 -03:00
2017-04-19 13:01:52 -03:00
2016-10-24 11:07:39 -03:00
2016-01-29 17:49:54 -03:00
2016-07-12 15:19:58 -03:00
2017-04-24 13:43:34 -03:00
2016-12-05 15:51:42 -03:00
2017-04-24 12:33:33 -03:00
2017-06-05 14:17:58 -03:00
2017-03-14 11:38:23 -03:00
2017-05-02 18:23:11 -03:00
2017-05-02 18:23:11 -03:00
2017-04-24 12:33:32 -03:00
2016-11-23 10:44:05 -03:00
2017-04-25 15:45:35 -03:00
2017-04-25 15:45:35 -03:00
2017-04-24 13:43:32 -03:00
2017-03-14 11:38:23 -03:00
2017-04-19 13:01:51 -03:00
2016-04-14 08:57:54 -03:00
2016-10-28 11:29:45 -02:00
2016-10-24 11:07:35 -03:00
2017-04-24 13:43:32 -03:00
2017-03-23 11:42:31 -03:00
2016-10-17 11:24:18 -03:00
2017-03-21 16:10:59 -03:00
2015-12-17 14:27:14 -03:00
2017-04-19 13:01:53 -03:00
2017-04-19 13:01:53 -03:00
2017-03-28 12:25:30 -03:00
2017-03-28 12:25:30 -03:00
2016-11-29 12:13:27 -03:00
2017-04-19 13:01:44 -03:00
2016-12-05 15:51:42 -03:00
2017-04-24 13:43:33 -03:00
2017-03-23 11:42:31 -03:00
2017-04-19 13:01:50 -03:00
2017-04-19 13:01:50 -03:00
2017-04-19 13:01:52 -03:00
2017-04-19 13:01:52 -03:00
2017-04-24 13:43:33 -03:00
2017-04-19 13:01:52 -03:00
2017-04-19 13:01:52 -03:00
2017-04-19 13:01:48 -03:00
2017-04-20 13:22:44 -03:00
2017-04-24 13:43:26 -03:00
2017-04-19 13:01:51 -03:00
2016-07-12 15:19:55 -03:00
2016-06-23 11:35:07 -03:00
2017-04-19 13:01:51 -03:00
2017-04-19 13:01:48 -03:00
2017-04-25 15:45:35 -03:00
2017-04-24 13:43:35 -03:00
2017-02-17 10:31:13 -03:00
2017-04-24 13:43:35 -03:00
2017-04-24 13:43:35 -03:00
2017-05-24 08:41:48 +02:00
2017-04-19 13:01:50 -03:00
2017-03-23 11:42:31 -03:00
2017-04-19 13:01:51 -03:00
2017-03-23 11:42:30 -03:00
2017-04-26 15:49:21 -03:00
2016-10-03 11:24:13 -03:00
2017-04-19 13:01:51 -03:00
2017-04-19 13:01:51 -03:00
2017-04-19 13:01:51 -03:00
2017-04-24 13:43:33 -03:00
2016-06-23 11:35:01 -03:00
2016-08-23 15:37:33 -03:00
2016-03-23 15:06:35 -03:00
2017-02-13 17:22:34 -03:00
2017-06-08 15:39:26 -03:00
2017-04-19 13:01:51 -03:00
2017-06-08 15:39:34 -03:00
2017-05-02 18:23:11 -03:00
2016-04-08 09:58:14 -03:00
2016-04-08 09:58:14 -03:00
2016-07-29 11:54:35 -03:00
2017-04-19 13:01:53 -03:00
2015-12-09 13:42:02 -03:00
2017-04-19 13:01:51 -03:00
2017-03-03 19:07:16 -03:00
2017-04-19 13:01:51 -03:00
2016-06-23 17:04:26 -03:00
2017-04-19 13:01:51 -03:00
2017-03-14 11:38:23 -03:00
2017-04-20 13:22:44 -03:00
2017-04-20 13:22:44 -03:00
2017-03-14 11:38:23 -03:00
2017-04-24 13:43:32 -03:00
2017-01-31 16:20:08 -03:00
2017-04-19 13:01:48 -03:00
2017-03-27 15:37:35 -03:00
2016-10-28 11:29:44 -02:00
2016-07-12 16:14:52 -03:00
2017-01-26 11:42:59 -03:00
2016-04-28 09:58:58 -03:00
2016-03-08 10:11:18 +01:00
2016-04-01 18:42:55 -03:00
2017-04-26 15:40:31 -03:00
2017-04-26 15:40:31 -03:00
2017-06-16 14:37:30 -03:00
2017-04-24 13:43:35 -03:00
2017-05-24 08:41:48 +02:00
2016-07-04 20:27:12 -03:00
2017-04-20 13:22:43 -03:00
2016-03-23 12:32:31 -03:00
2016-12-05 15:51:44 -03:00
2017-04-26 15:40:31 -03:00
2017-04-26 15:49:21 -03:00
2017-04-04 12:11:07 -03:00
2016-10-24 11:07:44 -03:00
2017-04-19 13:01:51 -03:00
2017-04-24 13:43:32 -03:00
2017-04-24 12:33:33 -03:00