summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* On windows, use new libeu_compat.hv4.8.0-rc1v4.8.0-beta2v4.8.0-beta1v4.8.0Ulf Hermann2018-07-261-16/+1
| | | | | | | | | This way we avoid having to define the functions ourselves. We cannot use the header on linux because we want to be compatible with mainline elfutils there. Change-Id: I5e5fd69a401be060b6eec07460dde9e9ad265f3f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Reduce noise from PerfParserTestClientUlf Hermann2018-07-261-1/+0
| | | | | Change-Id: I5180044645b08266889f053d3e5986b9c1f69d07 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Fix kallsyms testUlf Hermann2018-07-261-1/+1
| | | | | | | The types didn't match. Change-Id: I89e32a8e897830a066b0e4795f22b4b4d8b793da Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* When manually finalizing PerfUnwind, also send aux dataUlf Hermann2018-07-262-4/+4
| | | | | | | The point is that we don't want to write to output afterwards. Change-Id: Ie6d89a44ebc698a7473fae5dd2e3f9ce66f1ae6b Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Remove unused functionUlf Hermann2018-07-172-7/+0
| | | | | Change-Id: I4dc85ccfd30f5bc3fc37edd8d63331f0895a48f8 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Remove empty PerfBranchStack structUlf Hermann2018-07-173-24/+1
| | | | | | | | If they ever define it, we can still add it, but so far it doesn't do anything useful. Change-Id: Ib58962dc453144ad0176821d548c9aea4ef9b697 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Remove unnecessary redirection of lists on operator<<Ulf Hermann2018-07-173-31/+11
| | | | | Change-Id: Icc10b00710fd906ec829b6a54b7929e03d959967 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Drop unnecessary checkUlf Hermann2018-07-171-6/+5
| | | | | | | | std::upper_bound will always return an item which is greater than the one we compare to. Change-Id: Iec6c4b68e0bca9d0e48d5daa0e6f47b2abdb9d7e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* All paths that start with "/SYSV" are specialUlf Hermann2018-07-121-2/+2
| | | | | | | | This is also some anonymous memory mapping. The all-0 variant is just a special case. Change-Id: Ife5f1672a04796a5872e1200acb63a6091a7c1a1 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Don't look up file names of special regionsUlf Hermann2018-07-111-1/+1
| | | | | | | | | This is mostly a fruitless exercise and may occasionally give bogus results. Change-Id: I154232a6106c046727ed22188cbf30e5f1da100e Task-number: QTCREATORBUG-20762 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* memfd-allocated files are "special"Ulf Hermann2018-07-111-0/+1
| | | | | | | | | There is no point in looking for debuginfo or reporting errors for these. Change-Id: Iafe6963113689b1ba4132f648d37f2be476d796c Task-number: QTCREATORBUG-20762 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Merge remote-tracking branch 'origin/4.7'Eike Ziller2018-06-251-0/+26
|\ | | | | | | Change-Id: I349c7de4576e2fdd0d3379c30a517dc7804e4205
| * If dwfl_module_getsrc fails, iterate CUs to find source file/linev4.7.2v4.7.1v4.7.0-rc1v4.7.04.7Ulf Hermann2018-06-201-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some ELF objects have .debug_info and .debug_line sections, but no .debug_aranges. dwfl_module_getsrc doesn't like this and gives up. We can, however, do better. The information is all there, we just need to get hold of the right CU. The iteration is expensive, but as we cache the resulting locations, it's tolerable. In case there is no .debug_info at all, this won't iterate, as the Dwarf object won't be found in the first place. Task-number: QTCREATORBUG-20441 Change-Id: I9846397d1e930ba5f25ccfa9748542a198f0f2a4 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Merge remote-tracking branch 'origin/4.7'Eike Ziller2018-06-112-16/+42
|\| | | | | | | Change-Id: I0e885934ac0711d45cec5b8f4dad1e8cfb1ccea0
| * Switch to dynamic buffering when encountering trace pointsv4.7.0-beta2Ulf Hermann2018-06-072-16/+42
| | | | | | | | | | | | | | | | | | Trace point samples don't respect the FINISHED_ROUND mechanism. We should ignore any FINISHED_ROUND when recording trace points. Change-Id: I5d1c573e26171ccdfa78c094424b9bc6a1c41653 Task-number: QTCREATORBUG-20469 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* | Merge remote-tracking branch 'origin/4.7'Eike Ziller2018-06-041-1/+1
|\| | | | | | | Change-Id: Ifc373d7ae37e5622fb0c6b0f4ad03fd53245a04e
| * Fix build with namespaced Qtv4.7.0-beta1Christian Stenger2018-05-291-1/+1
| | | | | | | | | | Change-Id: I396cbebf0a5a99ec0928e54ed34990c1e674946b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Merge remote-tracking branch 'origin/4.7'Eike Ziller2018-05-284-43/+152
|\| | | | | | | Change-Id: I9ea25fac86790465aca192e63ba2e2607ed38a69
| * Don't look for ELF files in /devUlf Hermann2018-05-221-1/+2
| | | | | | | | | | | | | | | | It would be very strange to find any there, but device files are indeed sometimes mmap'd. Change-Id: I78799b435512c4dae085c7e0afdf889d17758e0d Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
| * Send auxiliary timestamped messages in order with samplesUlf Hermann2018-05-222-5/+14
| | | | | | | | | | | | | | | | | | Having a common chronological ordering between all timestamped events, at least most of the time, makes it so much less painful to process the stream on the client side. Change-Id: I8531a9b66c599c1c35688ad907ab403a41c11ba6 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
| * Adapt event buffering to time order violationsUlf Hermann2018-05-223-37/+136
| | | | | | | | | | | | | | | | | | | | | | | | When a time order violation occurs, we double the event buffer size. This makes further time order violations less likely. Furthermore, if we were running in automatic buffer mode (by FINISHED_ROUND) and catch a violation, then we switch back to dynamic buffer mode. A new command line option is introduced to limit the maximum buffer size. Change-Id: I1f1c4d3f630ecec420babe09e737e2dbd8bb25ca Task-number: QTCREATORBUG-20455 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* | Merge remote-tracking branch 'origin/4.7'Eike Ziller2018-05-223-3/+23
|\| | | | | | | Change-Id: I7fb19fedff36ce10c0be4d6c5adc2b8caf508030
| * Don't repeatedly report unsuitable modules for an addressUlf Hermann2018-05-173-3/+23
| | | | | | | | | | | | | | | | | | | | | | | | dwfl may disagree with our mmap events about the length of a module. If dwfl considers the module to be shorter, the address we are looking for may fall in an area that's not covered by the reported module. In that case we should not try to report the same module again the next time we catch this address. We already know that it doesn't fit, after all. Task-number: QTCREATORBUG-20427 Change-Id: I852dd39f0a53fe7bc1bde149efa3541d0fc7b8ba Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* | Merge remote-tracking branch 'origin/4.7'Eike Ziller2018-05-161-1/+1
|\| | | | | | | Change-Id: I325722ff75adac4f13ab95a1c10c695385de789b
| * Bump version numberUlf Hermann2018-05-151-1/+1
|/ | | | | Change-Id: I9c9c042274bbb90fbf5b424260c186ba10bf8dd0 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Don't duplicate the first user frame when resolving callchainsUlf Hermann2018-04-231-10/+11
| | | | | | | | The first callchain entry frequently is meta info with IP > PERF_CONTEXT_MAX. The current sample's IP is always different from that. Change-Id: I0b407331767ea482cd4e66ba0c8efade29089eb9 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Exit gracefully when the remote end closes the connectionUlf Hermann2018-04-201-4/+7
| | | | | | | | | This is generally not an error. Unfortunately QTcpSocket doesn't issue a close() when it's disconnected, so PerfData doesn't notice. We can manually trigger this, though. Change-Id: I37bf2a54fc102c8f7c0a26a760de1c8a6cf6d526 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Don't read past the end of the device when parsing tracing dataUlf Hermann2018-04-203-9/+17
| | | | | | | | As the tracing data has its own length field, we need to check that against the device's bytesAvailable() separately. Change-Id: I9e6ed96967b0864f69dc8b1a01e7171589d2701f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* Report an error if the device closes before we can read the headerUlf Hermann2018-04-161-0/+2
| | | | | Change-Id: I7792b12649c5e119fd88722b46b19aecd79b3bb7 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* Merge remote-tracking branch 'origin/4.6'Eike Ziller2018-02-012-15/+26
|\ | | | | | | Change-Id: Ide7a92f4f331c8df3214dc15a9c8268a74e1420f
| * Don't try to unwind a stack if we fail to attach the dwflv4.6.2v4.6.1v4.6.0-rc1v4.6.0-beta1v4.6.04.6Ulf Hermann2018-01-261-0/+3
| | | | | | | | | | Change-Id: I1039960a59354939b362019150ea67892d69aa81 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
| * Try to unwind the user stack even if IP is in kernel spaceUlf Hermann2018-01-252-16/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * When analyzing samples in kernel space, use kernel symbolsUlf Hermann2018-01-251-10/+8
| | | | | | | | | | | | | | | | | | 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>
* | Deduce the perf header sizes from the actual dataUlf Hermann2018-01-292-10/+41
| | | | | | | | | | | | | | The magic constants will only work as long as the header doesn't grow. Change-Id: Ib931363b440da83646bbb57e8b3ea574b303a52f Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* | Buffer non-pipe perf.data in a temporary file when streamedUlf Hermann2018-01-265-29/+110
| | | | | | | | | | | | | | | | This is mainly for testing. I don't want to special case things for this all the time. Change-Id: Ifc0621065fe0d5dd86fbebc70f89cfdc8a0ee43c Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* | Generalize the "input closed" mechanismUlf Hermann2018-01-261-16/+6
| | | | | | | | | | | | | | | | | | When we are done reading perf data, we know that we don't have to process any further signals from the input device anymore. This is not specific to TCP sockets as input devices. Change-Id: I898ea53dde53d13a887b2e702d251f8d9f511754 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* | Make PerfStdin behave more like other QIODevicesUlf Hermann2018-01-268-14/+230
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Buffer the data and emit readyRead when new data is available. Avoid the "oops" momemnt when bytesAvailable() returned >0 but trying to read the bytes would instead close the device. In fact, that was the "normal" way to finish the reading from stdin: We would create a garbage event header by trying to read past the end of the input and then signal an error because of that. Now we can actually listen for aboutToClose() on PerfStdin and we will eventually receive that signal. Change-Id: Ib159d186f4ce6c69a1fc7fe37bd5673981307b68 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* | Make some error messages more verboseUlf Hermann2018-01-261-2/+2
| | | | | | | | | | Change-Id: I32bf8ef40e8bf566e23657df1d2ef5bd8186d8bb Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* | Report failed memory requests in hexUlf Hermann2018-01-261-1/+1
| | | | | | | | | | Change-Id: I433d7fefcda33608d889ff542644978fa675dab4 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* | Check for valid ELF file already on registerElfUlf Hermann2018-01-252-26/+78
| | | | | | | | | | | | | | | | If the mmap'd region is not an ELF file we don't need to report it later. This also saves us many useless debug messages. Change-Id: I31e0595911e28a0f3f463acc8e3705476dbab328 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* | Use dwfl_report_begin/_end correctlyUlf Hermann2018-01-251-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The documentation states that you cannot use dwfl until dwfl_report_end returns 0. In fact you can, but then you run into strange corner cases where dwfl doesn't find certain modules that have been reported before. So far it was assumed that we cannot report additional modules while unwinding a stack, but in fact I don't see a reason why. So, whenever we want to report an additional module we call dwfl_report_begin_add before and dwfl_report_end afterwards. In addition, to make our dwfl initially usable we do one round of dwfl_report_begin and dwfl_report_end when creating it, and we have to change the order of begin and end on clear because the usual state of the dwfl is now "closed for reporting". Change-Id: I7468204c8f48a8a0c8f68f78e81f5c4aeb8fb8d4 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* | Use newRow() rather than addRow() in testsUlf Hermann2018-01-251-4/+4
| | | | | | | | | | | | | | addRow() does not exist in Qt 5.7. Change-Id: I76aefbcc3bbb8acdf9040ec9525a40058f3d7c04 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Return default architecture as const char *Ulf Hermann2018-01-252-2/+2
| | | | | | | | | | | | | | Implicit construction of QByteArray does not work here. Change-Id: I0d891680b84b635bdc918fd13440510849dee1f7 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Improve error messages for failures to register ELFsUlf Hermann2018-01-232-4/+3
| | | | | | | | | | | | | | | | We only need the address once, it should be in hex, and we don't need the trailing comma. Change-Id: Icdb8fcd546a0d643ff3875e8e7ca68382fc03a49 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* | Make it cheaper to flush the symbol table cacheUlf Hermann2018-01-231-2/+2
| | | | | | | | | | | | | | | | | | We only want to remove the reported modules, not reinitialize the dwfl and restart the heuristic that guesses the target architecture and dlopen()'s the backend. Change-Id: Icd459777e16172c89186b197a0cdaf758bd7d6e6 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* | Merge remote-tracking branch 'origin/4.6'Eike Ziller2018-01-190-0/+0
|\| | | | | | | Change-Id: I7d2cf6204d092e6485cba4b672485cfd362d6b69
| * Merge remote-tracking branch 'origin/master' into 4.6Eike Ziller2018-01-175-23/+27
| |\ | |/ |/| | | Change-Id: I70d06f875b0b91255ce13c1544b849ed9a75af17
* | Merge remote-tracking branch 'origin/4.6'Eike Ziller2018-01-171-1/+1
|\| | | | | | | Change-Id: If05d55478f158be246d32ab78c01b9c5bcdca72a
| * Increment version numberUlf Hermann2018-01-151-1/+1
| | | | | | | | | | Change-Id: I0b31a221161cc96fc85eaea58cf93b43414a988b Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* | Avoid number conversion issuesUlf Hermann2018-01-165-23/+27
|/ | | | | | | | 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>