summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Make findDebugInfoFile() accessible from the test9.0Ulf Hermann2022-12-053-5/+8
| | | | | | | | If it's static in perfsymboltable.cpp's file scope, we cannot use it from anywhere else. Change-Id: I60ac203120b7c88feff2acb26b224a8761469bf8 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* Fix compile with QStringBuilderMilian Wolff2022-12-053-5/+6
| | | | | | Change-Id: I66c034497e23d9a92d779c9ade85e51d49b71fa9 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* Optionally report debuginfod download progressMilian Wolff2022-07-255-0/+37
| | | | | | | | | | | | When available, report progress for ongoing debuginfod downloads. This is useful as otherwise users might think the application has stopped working and is frozen. This only works with elfutils that contains the new dwfl_get_debuginfod_client API, which is not yet released. Change-Id: Iffce1b31f4245977c8aa624b6c852fdfa1840d4e Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Cache whether the perf-$pid.map file existsMilian Wolff2022-06-292-1/+3
| | | | | | | | | | | When we parse perf data files with many processes, we would continuously query whether the perf map file exists. QFile::exists does not cache the result internally. In our scenario, it's enough to just check the existence once and then be done with it. This removes many stat syscalls for complex perf data files. Change-Id: I452ea476cdcd7ac8ba3307c44f5fb70d17e73f10 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Add missing '::' when hitting cached scope namesMilian Wolff2022-06-103-0/+14
| | | | | | | | | | | | | | | | Fixes C++ symbol names in some situations as shown by the changes to the expected test data. Because the code to build the scope names is complex, I added a longer comment in the hope that this better explains the behavior and logic of this code. The test e.g. now has this changed behavior: ``` - 201650 201700 /usr/include/c++/12.1.0/bits/shared_ptr_base.h:611:7 201650 dc std_Sp_counted_ptr_inplace<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<main(int, char**)::<lambda()> > >, double>, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>_M_dispose parallel_static_gcc /home/milian/projects/kdab/rnd/hotspot/3rdparty/perfparser/tests/manual/clients/parallel_static_gcc + 201650 201700 /usr/include/c++/12.1.0/bits/shared_ptr_base.h:611:7 201650 dc std::_Sp_counted_ptr_inplace<std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<main(int, char**)::<lambda()> > >, double>, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>::_M_dispose parallel_static_gcc /home/milian/projects/kdab/rnd/hotspot/3rdparty/perfparser/tests/manual/clients/parallel_static_gcc ``` Change-Id: Iaa82add2c878796890decb4365b3ca783b46f355 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Add parallel_static_gcc and basic test coverageMilian Wolff2022-06-107-7/+57
| | | | | | | | | | | | | | | | This is a somewhat more elaborate example which uses multiple threads, lambdas and std::async which has the tendency to stress our dwarf debug symbol resolution code. More on that in a follow-up patch. For now, this test only uncovered an issue in PerfParserTestClient::convertToText, where we iterated over a QHash to generate text output, which is not going to produce stable results. Instead, we now convert to a stable QMap first and output that. Furthermore, the test harness is updated to also allow us to test never version than 0.5 that we got in the past, i.e. 0.6 is now expected for the new data files I'm adding here. Change-Id: I2de65503b2c853528b301166a5b58a406d34a059 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Use qCompress/qUncompress to reduce the size of the test input filesMilian Wolff2022-06-1028-5078/+69
| | | | | | | | | | | | | | | | | | All files are now run through qCompress (manually) and then those are tracked in git. When we run the test, the files are uncompressed on the fly to let the rest of the code remain working as before. The resulting folder is now only ~1.3MiB instead of ~5.2MiB before. But obviously developers won't notice as the old data is still included in our git history. But at least for new tests we can prevent such pollutions and keep the gerrit bots happy. Sadly we cannot resort to external tooling for the compression step, so adding new files is a bit tedious but doable. And relying on qCompress means we dont need any other new dependencies. Change-Id: I902a6906f140eed2565df9637cb80cf464143b80 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Demote unhandled perf feature/type warnings to debug outputMilian Wolff2022-06-082-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes warning spam for perf features we simply don't support yet. All of these are not really needed for us right now, so it's pretty useless to spam the end user with these warnings, when we devs know that they are harmless. Examples on my machine: ``` feature not properly read PerfHeader::BPF_PROG_INFO 4 0 feature not properly read PerfHeader::BPF_BTF 4 0 feature not properly read PerfHeader::SAMPLE_TIME 16 0 feature not properly read PerfHeader::CACHE 8808 0 feature not properly read PerfHeader::MEM_TOPOLOGY 88 0 feature not properly read PerfHeader::CPU_TOPOLOGY 1252 892 feature not properly read PerfHeader::CPU_PMU_CAPS 140 0 unhandled event type 79 PERF_RECORD_TIME_CONV unhandled event type 73 PERF_RECORD_THREAD_MAP unhandled event type 74 PERF_RECORD_CPU_MAP ``` We keep the warning for those features that we do support. If we don't read the full size of them, then something changed which we want to be made aware of. Change-Id: I0c6f564518788e6129be671551e84910c3cbf1d0 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Unbreak tst_perfdata when run on more modern systemsMilian Wolff2022-06-082-68/+82
| | | | | | | | | | | Some of the old demangling errors apparently got fixed. Replace the raw mangled names with the expected demangled names and replace them in the actual text to let the tests pass on both, modern and old systems. Change-Id: Ibe4ce4237da859d915319c0e5ca1cdf0b0fc7b93 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Move code to extract symbol cache into perfaddresscacheMilian Wolff2022-06-083-32/+38
| | | | | | | | This makes the code more easily reusable and moves code that belongs together logically into the same file. Change-Id: Icce3a1ce4dc05f3a7cd9333fa7c88bd3a1b118ec Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Cleanup: Make PerfSymbolTable::attachDwfl more type safeMilian Wolff2022-06-082-4/+3
| | | | | | | | Replace `void* arg` by explicit `PerfUnwind::UnwindInfo *unwindInfo` instead of casting the void to that type internally. Change-Id: I64a716f7f89ae75e1b21470a927441f07beb70c6 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Cleanup: move unwinding code to perfunwindMilian Wolff2022-06-083-145/+142
| | | | | | | | | | Instead, pass the thread callbacks to PerfSymbolTable::attachDwfl. This way all the code relevant for unwinding is centralized in the perfunwind file and not split across the symbol table and unwind files. Change-Id: I6f2dcecef0949aa6370b1e6a279132cfd5012830 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Introduce findSourceLocation utilityMilian Wolff2022-06-083-9/+36
| | | | | | | | | Move the code from perfsymboltable into perfdwarfdiecache. This simplifies the perfsymboltable code and allows reuse of this generic code. Change-Id: Ibeebe2312d49095adad60f2924e1be8d74d82dfe Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* add unit test for finding debug symbolsLieven Hey2022-06-087-2/+138
| | | | | Change-Id: I285127ea9abd41f0aa50333e49ad4174d973f437 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* improve debug symbol discoveryLieven Hey2022-06-081-14/+42
| | | | | | | | | | | | | | | | | | | | | | If elfutils fails to find the debug symbols, the perfparser tries to find it by checking first in /usr/lib/ then in .debug and then in /usr/lib/debug. This causes some problems if the debug file has the same name as the library itself. In this case the algorithm stops at /usr/lib/ and returns the wrong file. To prevent this I reorder the algorithm to first check in .debug then in /usr/lib/debug and then in /usr/lib/ I also changed how the algorithm searches inside /usr/lib/debug. Some distros (e.g. Ubuntu) uses shorted path names so the debug file for /usr/lib/x86_64-linux-gnu/libc-2.31.so is located in /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.31.so. To find the file the /usr/lib/debug/usr/lib and /usr/lib/debug/lib are searched. fixes KDAB/hotspot#265 fixes KDAB/hotspot#128 Change-Id: Iab2283819f947e89e9a933e66dfb7f45ff9156e1 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* add support for d symbol demanglingLieven Hey2022-06-088-30/+163
| | | | | | | | I added a system that simplifies adding new demanglers and provides a fast path when demangling symbols Change-Id: Ie5ca43632b53e41c0a4214772193af09ca4593cc Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* skip PERF_RECORD_THROTTLE/PERF_RECORD_UNTHROTTLESimon Sobisch2022-05-301-0/+7
| | | | | | | fixes https://github.com/KDAB/hotspot/issues/177 Change-Id: Ifd31af2344214a02550bab9cf8513f88608c60e8 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* fix: word order in debug messageRaphael von der GrĂ¼n2022-05-301-1/+1
| | | | | Change-Id: Id291a3753c5b890a34a83e89d3df3dda5847268e Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Merge remote-tracking branch 'origin/7.0'8.0Ulf Hermann2022-01-286-10/+15
|\ | | | | | | Change-Id: I8ea621b1f308692591c256e22eeebe070740a3c9
| * Bump version to 7.07.0Ulf Hermann2022-01-281-1/+1
| | | | | | | | | | Change-Id: I1d6ba0705275abb851c1dbf0f25d1f94f018e105 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
| * Merge remote-tracking branch 'origin/5.0' into 7.0Ulf Hermann2022-01-280-0/+0
| |\ | | | | | | | | | Change-Id: I104132dfc29cc7fa74fd2dca7554e65ef770f95c
| | * Fix warnings about signedness5.0Christian Kandeler2021-06-241-2/+2
| | | | | | | | | | | | | | | Change-Id: I00ae8d6ac2094a2b5655693d678445296856fb00 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| * | Merge remote-tracking branch 'origin/4.15' into 7.0Ulf Hermann2022-01-283-7/+10
| |\ \ | | | | | | | | | | | | Change-Id: I4855a81ce48a117c6a34e0a4770b0bf5ee49473a
| | * | cmake: fix ODR violation4.15Tim Blechmann2021-06-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `perfdata.h` is included from downstream code, but HAVE_ZSTD is not propagated downstream. this leads to gcc complaining about ODR violations Change-Id: Ib6995d9be4102f4e3262d84b25d0c8129e165ec1 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
| | * | Fix build with Qt 6Eike Ziller2021-03-251-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Explicitly cast some qsizetype to int. Explicitly include time.h for time_t, which possibly was included by Qt headers before, and is needed for libelf.h (ar_date) Change-Id: I03807cbd2bb7e25e736a7842fd45b919db274488 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| | * | Add missing QLocale include for building with Qt 6Eike Ziller2021-03-051-0/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: I65a47203cbf935c71feda007f09e49c8ea8a87b6 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| * | | Merge remote-tracking branch 'origin/4.11' into 7.0Ulf Hermann2022-01-281-0/+2
| |\ \ \ | | | | | | | | | | | | | | | Change-Id: I2eb05cdb49e2798b477d1122a135461d91d1e67e
| | * | | Add missing checks to PerfEventAttributes::operator==4.11Christian Kandeler2020-02-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I3ecb3b2354968f75b416f2561132432dd66726ee Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| * | | | Revert "Fix clang warnings about unused class members"Ulf Hermann2022-01-281-2/+2
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit f0ad7794a4d03827262ca0a3a952e7e0ccd47cf0. We actually use those members in a change we forgot to merge from 4.11. Change-Id: Ibee5fd43f1d5685f5c510338db878a9fbcbea50f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | | / Fix compiler warnings about signedness6.0Christian Kandeler2021-08-181-2/+2
| |_|/ |/| | | | | | | | | | | Change-Id: I7578e582ac7fd3dd2012f783f273080ec2c2b18b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | | Add LBR unwinding method proper processing for DisassemblyDarya Knysh2021-03-304-4/+752
| |/ |/| | | | | | | | | | | | | | | | | | | There are some required frames not looked up for LBR unwinding method. Added traversal the deepest frames for LBR by callchain to compute then Disassembly events costs within function/method properly. Added test into perfdata/vector_static_gcc for perf.lbr.data recorded with LBR. Change-Id: Ie6413415c573e659505a4715978c65fce135d979 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Use QLibrary to find librustc_demangle at runtimeMilian Wolff2021-01-114-15/+55
| | | | | | | | | | | | | | | | | | | | Don't link to librustc_demangle at compile time, just try to find it at runtime via QLibrary and then use it. This makes it much easier to enable/disable support for rust demangling for packagers. Fixes: https://github.com/KDAB/hotspot/issues/269 Change-Id: Ib33e2699780ed6d827bddeea75f82137daeacc9d Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Port away from deprecated non-namespaced stream modifiersMilian Wolff2021-01-064-8/+8
| | | | | | | | | | | | | | Use the namespaced Qt:: equivalent instead. Change-Id: I3b82febee77a8cce55a1a17ac65018999e51fd43 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Make sure we demangle on direct cache hits tooMilian Wolff2021-01-041-8/+12
| | | | | | | | | | | | | | | | | | Previously we only did that when the relAddr fell somewhere into the symbol. If it matched the symbol start directly, we didn't do this yet. Change-Id: I853e6735c83c9deeeec3be47fbdea0a032598ed8 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Fix #if/#ifdef confusion, detected by -Werror=undefDavid Faure2021-01-041-1/+1
| | | | | | | | | | | | Change-Id: If34e761dc6a3b38ca60433adc674332fb5c7721b Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Add actual file path computation for symbolsDarya Knysh2020-12-156-17/+21
| | | | | | | | | | | | | | | | Actual file path can differ from perf recorded. Compute and pass it to hotspot through Symbol struct field actualPath. Change-Id: I556035234cbcffa42497bf02e225d63565e4a0bf Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Add alignment for ARM addressesDarya Knysh2020-12-151-8/+21
| | | | | | | | | | | | | | It is required to compute proper addresses on ARM. Change-Id: Ifc93375707507fff0fcc62e164133771e43bd4b5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Add location's relative address computationDarya Knysh2020-12-1510-3257/+3395
| | | | | | | | | | | | | | | | | | It is equal to symbol start added by offset inside function. Disassembler can then use them to compute and show events costs locations within function by instructions. Added stream output. Change-Id: Iba32e1764633d7ffc3f0f36088525ed7a3d1c9d0 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Add Disassembler functionalityDarya Knysh2020-12-1512-3257/+3272
| | | | | | | | | | | | | | | | | | Added start address and size into Symbol and their stream output. A disassembler can then use the relative address and size of a symbol to find the instructions that belong to a function. Change-Id: I96709ca380d0e58cd5cf5a8cc87116147b2754d6 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Allow zero sized symbols in the address cachedknysh2020-10-075-5/+8
| | | | | | | | | | | | | | | | | | | | | | Apparently there are situations where the compiler generates entries in the symbol table with zero size which are still referenced by some callstacks. After commit d8d56b7e we ended up losing the symbol names in such cases. This patch fixes it again and restores the symbol names for such zero-size symbols. Change-Id: If98f68626ab4251ccfed89d791ebd333f6a6a60a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Transmit the number of lost events in the LostDefinition4.14Milian Wolff2020-09-294-10/+16
| | | | | | | | | | | | | | | | | | | | This allows a more detailed report on the GUI side then. Because the count has a quint64 type, we now use a QVariant to store the task event payload. To reduce the padding overhead, the struct is slightly reordered. Change-Id: I01d16da2ba4d3df9f32d6ae53bcff120355eb2c9 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Fix compiling tests with QMakeMilian Wolff2020-09-292-4/+10
| | | | | | | | | | Change-Id: Iddaf07e55eb777d53b9ed992b496939ef93af07a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Parse PERF_RECORD_SWITCH_CPU_WIDEMilian Wolff2020-09-252-0/+35
| | | | | | | | | | | | | | | | | | | | | | For now this just allows off-CPU cost analysis for data recorded with `perf record -a --switch-events`. In the future, we could even send the nextPrev{P,T}id too, which would allow us to draw arrows beetween the context switch targets. Change-Id: Ie9b88bb9c54a3238ba8d6addd013b8419c03c42f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | tst_addresscache: Fix qbs buildChristian Kandeler2020-09-253-4/+17
| | | | | | | | | | | | | | | | While we're at it, also consider the ELFUTILS_INSTALL_DIR environment variable. Change-Id: Ifeb5cc7df6e29426633d27a840185ba67ed838b6 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Bump versionChristian Kandeler2020-09-231-1/+1
| | | | | | | | | | Change-Id: Ic70d22575b9dd38f0df9f04e61c82a0dbc83a01a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Merge "Merge remote-tracking branch 'origin/4.13' into master"The Qt Project2020-09-231-1/+1
|\ \
| * \ Merge remote-tracking branch 'origin/4.13' into masterUlf Hermann2020-09-231-1/+1
| |\ \ | | | | | | | | | | | | Change-Id: I60ee993a753729853b91353a7083347e90cb721c
| | * | Bump version to 4.134.13Ulf Hermann2020-07-061-1/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: If91e36a370d8fed183680ea156f39fde5175b899 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | | | Fix autotest build for qbsChristian Kandeler2020-09-231-0/+2
|/ / / | | | | | | | | | | | | Change-Id: I9dc6ab44596244fb342495c5d4a5e719e9b6c26b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | | Only call dwfl_attach_state with user-level CPU registers and stackMilian Wolff2020-09-112-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For samples with frame pointer or LBR call chains, we may not have the CPU registers or stack information available. Under such circumstances we would spam the command line with repeated warnings of the form: ``` <pid> failed to attach state Couldn't find architecture of any ELF ``` Prevent that by checking whether the sample has register and stack information available and only attach dwfl state then. Note that symbol resolution and inline-frame resolution is independent of the dwfl_attach_state call - that really is only required for stack unwinding. Based on a patch by vtoropov, thanks! Fixes: https://github.com/kdab/hotspot/issues/178 Change-Id: I8b88ee5b97d3e9d3ded82a17c4487d01add6d5ca Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>