| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Change-Id: I1039960a59354939b362019150ea67892d69aa81
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Quite often we get both a kernel call chain in sample.callchain() and a
user stack and user registers. We should analyze both then, each with
the right symbol table.
Also, when resolving a call chain we need to make sure that every time
we resolve a frame the dwfl is attached. This is important as context
switches force us to change the symbol table.
Change-Id: I9e5849eefef6780f822166e8c6a798749d18fce2
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
|
|
|
|
|
|
|
|
|
| |
Without this we cannot properly report any kernel stack traces and get
interesting error messages because the symbols aren't found in
userspace.
Change-Id: I981dbdac27beefa57c74bc9e8f41d5438e75668c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
|
|\
| |
| |
| | |
Change-Id: I70d06f875b0b91255ce13c1544b849ed9a75af17
|
| |\
| |/
|/|
| | |
Change-Id: If05d55478f158be246d32ab78c01b9c5bcdca72a
|
| |
| |
| |
| |
| | |
Change-Id: I0b31a221161cc96fc85eaea58cf93b43414a988b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
|
|/
|
|
|
|
|
|
| |
Use unsigned types where we mean unsigned and signed types where we mean
signed. Check the integer range before casting to a smaller type.
Change-Id: Ia2150282e9763855c495bd5547e2bc176d8d93be
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
|
|
|
|
|
| |
Change-Id: I27ac48161d1db55efe808dbefb37ad28d0981ed2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
|
|
|
|
|
| |
Change-Id: Ieede3075f4beab9bbd234c0a9251c400b246abcc
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
|
|
|
|
|
| |
Change-Id: I367506911e9a6827b775bbb99606e3a6dac75f1c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
|
|
|
|
|
| |
Change-Id: I30c3f0b9870144e850f43a3a5634940e2542ecb2
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
|
|\
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
app/perfattributes.cpp
app/perfattributes.h
app/perfregisterinfo.h
Change-Id: I05d1aa1550d8449085d5242a119d77daabb5f75b
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Apparently "i686" can show up in perf.data files. Let's just accept all
kinds of things that look remotely like a valid architecture, just to be
safe.
Change-Id: Ieb2af7c2809ba7799002f94f3aff0949b141194c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
|
| |
| |
| |
| |
| |
| |
| | |
The data structure used to be shorter and we should not fail on that.
Change-Id: Id2c46a3399d680462a28fc3609622042d1f526bf
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: I8b4f746093d2f531c3967802542417c10dc6ce3d
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We want to examine the output of perfparser in the tests, so we need to
parse it.
Change-Id: If74a25aadd3a4c6d8221d7f0930f1d3c042959a3
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
|
| |
| |
| |
| |
| |
| |
| | |
This allows us to use incomplete perf.data files in tests.
Change-Id: Icddfc0b62cb96ac9d5f9dcee2e1c44b4f3e28dff
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
|
| |
| |
| |
| |
| |
| |
| | |
Otherwise we get random data if the trace does not contain weights.
Change-Id: I78dc634d5b7c1432981884cf574f84bb6cff4b45
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
|
| |
| |
| |
| |
| |
| |
| | |
Otherwise we crash on any samples in kernel space.
Change-Id: Id194302c7ba2e0fcc2f7d79d56eed6e1d1796308
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
|
| |
| |
| |
| |
| |
| |
| | |
... and improve the formatting for error messages.
Change-Id: I6b0553bae2d70f0300fbf21499198b688bdf3554
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
We never look them up by value, but we want to be able to look them up
by our internal ID.
Change-Id: Id116ef6eed5dc0d66bb5d1c9676e02530e99a344
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: I8abc665666fcd01ca33d990a49635d00432b8c4b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
|
|\|
| |
| |
| | |
Change-Id: I6c8053e66b7fc28f6167148c194ac6911fa07be3
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This way we don't need a complicated synchronization setup when the data
is tunneled through an SSH connection, which might take a while to
start.
Change-Id: Ib42aede7e751258e928224326ee46fe9252be8b3
Reviewed-by: hjk <hjk@qt.io>
|
| |\
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
app/main.cpp
Change-Id: Ic3cd7ca4b5434b01187a2daa060818de0b31f3d5
|
| | |
| | |
| | |
| | |
| | | |
Change-Id: Iceb0fe3e2321778038570fb3ab9310d566d3527e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
|
| | |
| | |
| | |
| | |
| | | |
Change-Id: Ieef754ad2eec933ba416ded81de3bdcdeaae5588
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
|
| | |
| | |
| | |
| | |
| | | |
Change-Id: I34d45161c60cbe7f028a3e194fd4ac8b1a79e051
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
There is no reason to carry around junk data and possibly analyze it.
Change-Id: I0ea56270efe6382f0c16de703b32405c4388f00a
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
- pids and tids are generally signed on linux. Reflect that in the code.
- The counters in PerfUnwind::Stats need to be unsigned.
- All QIODevice offsets and read/write sizes need to be qint64.
- Register offsets are now signed int, to avoid excessive casting when
using them to index QVector and QList.
- All the fixed struct lengths can be expressed in quin16.
- Replace C-style casts with static_cast.
- Add override to some method declarations.
As a consequence, a few cases where we did handle excessively long data
sections reveal themselves as unreachable, while in other places we have
to indeed take care of that. Instead of leaving the stream in an invalid
state, though, we generally skip those sections now. Traces of >2GB are
not unthinkable and who knows where that data shows up.
Change-Id: Ied5e5263fbe44b0635c2a6d0fc24fc511a4d0f54
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The content size is incorrect in this case, and naively skipping it
will prevent us from reading the following events.
Change-Id: Iedde4937576236b953d3d52c6faf388b9ca6f7dc
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| | |
Expose the Stats struct, so that we can verify what it did, reduce the
constructor and add default values for most arguments, and allow the
event buffer to be manually flushed.
Change-Id: I3a9d9028e1316a962885c20e5e624057afac5697
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
|
| |
| |
| |
| |
| | |
Change-Id: I2b9b4b02381d500ba853528a25b37dbecd8fd902
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: Ib4fcaaf3408d89abeb9230aafbdb041f3891c7e2
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This prettifies the debug output of warnings like this one:
Before:
warning: perfparser/unknown: feature not properly read 13 244 212
After:
warning: perfparser/unknown: feature not properly read PerfHeader::Feature(CPU_TOPOLOGY) 244 212
Change-Id: I8cf0921eabd0fb8971246de58fd4f2e2c0f6b472
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Whenever we query for dwfl_addrmodule, we have to ensure the returned
module matches the mapping we expect. To do so, a new method is
introduced that wraps dwfl_addrmodule. If no module is found, or the
mapping mismatches, we report the expected elf map.
This does not fix any obvious issue but seems like the correct thing
to do. Additionally, it allows a follow-up fix.
Change-Id: I03208aaf6a64477ff7a8bdd5eb893ca34fd3038b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This allows us to parse perf.data files from other machines that
we distributed via `perf archive`. Additionally, we can now parse
older perf.data files from the same machine when the kernel got
updated in the meantime.
The kallsyms build-id cache is ignored when kallsyms is set
explicitly on the command line. Sometimes the kallsyms file in
the build-id cache is broken. Or maybe we just want to enforce
reading a different kallsyms file. This also mimicks the
behavior of `perf report --kallsyms` in such a case.
Change-Id: Iddec9ceb4e2e706305297c957ab85d29c247c9bb
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
By remembering the path under which a file was originally referenced
in the mmap call, we can use this information to find debug link
files. I.e. we will now try to find the debug link file in the
original binary target folder, which is where this debug link file
often resides.
This is useful for lazy people like me who don't want to set the
application path every time they use perfparser.
Change-Id: I8e33f137b186ed857b9b4da1d0618d0ae903d0cd
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The call to dwfl_frame_pc potentially advances the internal
unwinder state when we query for the isactivation flag. This can
then lead to breakage when the about-to-be-returned PC lies in
a not-yet-reported module.
To fix this, we now ask first for the PC, which is cheap as it
just forwards a data member of the Dwfl_Frame state. Then we
ensure the module that contains this PC is properly reported to
dwfl. Only then do we ask for the isactivation flag by calling
dwfl_frame_pc a second time.
This fixes many broken backtraces. In perf upstream I have
submitted a similar fix. There, we can more easily compare the
libdw unwinder with libunwind. Here is the corresponding
output of the two:
Working libunwind and libdw with this patch applied:
~~~~~
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)
~~~~~
Broken libdw, i.e. status quo without this patch. Note how the first sample
is randomly missing two frames close to the end. The second stack breaks
completely.
~~~~~
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])
~~~~~
Both issues are fixed with this patch applied.
Change-Id: Ib2a9394ab2a01a5e65860540a675c277ff15dc8c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
These warnings occur quite often and seem to be expected. Spamming
the console with harmless warning output is not good practice, so
demote the harmless issues to debug output.
Change-Id: Iccb402f9e2cb0b1718325d7efa44994223a73d8f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Because the byte order was not set on the ID data stream, its values
where parsed in the wrong order, i.e. byte-swapped. This leads to
all kinds of errors later, when we try to lookup the attribute for
a given sample ID - where we parse the value in the correct byte
order.
Change-Id: I06dee77bfe2901daaf1d05c7a5079ae0194adf07
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
This is mostly done to enable a future patch that will load the
kallsyms file via it's build-id from the debug path.
Change-Id: Ic5c6ecd09dfdf7f8c42b13497f77bc6c43147cf8
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: Id90234fbdda5f9a3a3a7e65436b8418228f09f2c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: Iacb08b726c8c43adb2e888de0ef01cf6086f4ad0
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|/
|
|
|
|
|
|
|
| |
These sections have an odd name and cannot be found.
We used to show confusing error messages. Instead, we now
ignore these sections and don't try to find a file for them.
Change-Id: Icf5397ad8de84406ad23373b747b4292c8510f8b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
| |
Change-Id: Ib60487c3c1bc4fdb956a324ce217916dde3d0ccb
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
|
|\
| |
| |
| | |
Change-Id: Ia317fd54d0ecb9dc6111dd506b925542f04cb1c9
|
| |
| |
| |
| |
| |
| |
| | |
The result is undefined as dwfl_addrsegment doesn't set mod then.
Change-Id: I3c08519726b8c136e7c24cfc89c34ffc78689619
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When elfutils fails to find a debug link file, try to find it
in all of our search paths like we do for the DSO itself. This
fixes situations where we report the DSO in the ~/.debug path
as identified by its build-id.
Change-Id: If5931b5705e318806bf7d8cc8a63e252ba344a36
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| |
| |
| |
| |
| |
| |
| | |
On windows none of the architecture defines is set.
Change-Id: Iad202a9d1346ee073ca0e2c91da216d25ec6df0a
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
|