Commit Graph

988 Commits

Author SHA1 Message Date
Bartosz Taudul
2f17e33851 Prevent duplicate callstack frame queries.
Callstack frames will now have nullptr as the value in the callstackFrameMap
map, as a way to signal that a query for given key is already pending.
Duplicate queries should no longer happen.

@slomp provided alternative implementation, which produced the following
results:

Queries made: 195,778
Duplicate queries skipped: 9,518,910

Co-authored-by: Marcos Slomp <slomp@adobe.com>
2025-07-18 01:16:46 +02:00
Bartosz Taudul
c704f909be Move duplication check into QueryCallstackFrame() to make things clear. 2025-07-18 01:15:16 +02:00
Bartosz Taudul
c4a6cf3456 Use contains() to check if map contains element. 2025-07-18 00:45:26 +02:00
Bartosz Taudul
f578d14553 Extract callstack frame query to a separate function. 2025-07-18 00:33:09 +02:00
Bartosz Taudul
38ff7a6697 Make sure count is right. 2025-07-18 00:24:23 +02:00
Bartosz Taudul
320eb67581 Assume callstackFrameMap can store null ptrs. 2025-07-18 00:23:43 +02:00
Bartosz Taudul
880c600506 Remove queue delay calibration.
This value is not used for anything, it was just a number displayed in
the UI without much meaning to anyone.

Operations on the queue during early init may not work correctly, stopping
some programs from running past the calibration loop.
2025-07-11 23:23:31 +02:00
jcl1234
791904a37f Fix FiberEnter start time always being processed as 0 2025-07-01 22:38:10 -05:00
Clément Grégoire
c100b32b48 Fix crash when reaching the source location limit
Instead of crashing when reaching the maximum number of source locations, display an empty source location ( with "???" everywhere).
Keeping the assert for discoverability of the limit in debug, but ensure profiler won't crash later on (or in release).
2025-05-12 13:49:31 +02:00
Bartosz Taudul
5140a5a411 Merge pull request #1021 from siliceum/wakeup
Thread wakeup visualization
2025-05-10 13:55:51 +02:00
Tomaž Vöröš
a088ebe337 fix some buffer sizes 2025-05-10 00:27:32 +02:00
Clément Grégoire
2c2d126967 Remove added spaces 2025-05-05 15:52:54 +02:00
Clément Grégoire
58401a93ab Fix file read when skipping context switches data 2025-05-05 15:29:30 +02:00
Clément Grégoire
31859042bd Remove ContextSwitchData SetStartCpu and SetEndReasonState 2025-04-09 17:02:51 +02:00
Clément Grégoire
b6ec625ab4 Remove assert that would trigger on dropped CSwitch events 2025-04-09 14:45:03 +02:00
Clément Grégoire
4e282371bf Version 0.11.3 instead of 0.12.0 2025-04-08 13:51:32 +02:00
Clément Grégoire
6486d8147d Fix formating issues 2025-04-08 13:48:50 +02:00
Clément Grégoire
df76b376a7 Thread wakeup visualization
This PR does the following things:
- Allow to lock the highlighted thread using left mouse click or lane popup menu
- Add more descriptions for wait reasons in View::DecodeContextSwitchReason
- Stores the Wakeup CPU so that we may display it in the CPU data view
- `QueueThreadWakeup` now contains cpu and adjust info (currently unused). Fits in the padding, no struct size change.
- `QueueContextSwitch` now also contains thread priorities information (windows+linux) and CState (windows), but currently unused by the profiler. Fits in the padding, no struct size change.
- Fixes Linux `EventWakeup` which tries to remove PERF_SAMPLE_CALLCHAIN on the wrong member. Set the whole `perf_event_attr` explicitely instead.
- Fixes Windows ReadyThread event being dropped if triggered before the thread switches out (this is confirmed to be normal behaviour, probably due to thread being switched out but context switch actually happening later)
- Bumps tracy file version and protocol versions
2025-04-08 11:02:27 +02:00
Bartosz Taudul
c5dc5f4455 Bump zstd to 1.5.7, use CPM to download. 2025-02-19 23:47:37 +01:00
Dirk Eibach
8f25eaf54e Display zone values also in hex 2024-12-10 11:07:48 +01:00
Bartosz Taudul
872367f068 Process memory pool discard events. 2024-10-21 18:22:22 +02:00
Bartosz Taudul
5454b3202d Bump capstone to 6.0.0-Alpha1. 2024-10-04 17:19:18 +02:00
Bartosz Taudul
1c1faeff2d Replace parallel STL with PPQSort.
PPQSort is supposedly quite fast: https://github.com/GabTux/PPQSort

More importantly, it does not depend on TBB fuckery, so there's no longer
a need to link with an external library that people may or may not have.

The NO_PARALLEL_STL option is out, as it was provided solely to deal with
TBB being not available. Sequential sorting is still used on emscripten.
2024-09-26 14:41:59 +02:00
Bartosz Taudul
0d17d5eaaa Remove dead code. 2024-09-14 01:04:03 +02:00
Bartosz Taudul
f387929653 No capture is needed. 2024-09-14 01:03:22 +02:00
Bartosz Taudul
2716311f51 Store die number in CpuThreadTopology. 2024-08-24 16:36:04 +02:00
Bartosz Taudul
357b557684 Add die to CPU topology data structures.
Drawing dies on the topology chart is a minimal effort for the time being.
An improved version will be added later on.
2024-08-22 20:26:11 +02:00
Bartosz Taudul
835ba9fddf Pass fiber group hint to NewThread(). 2024-08-04 00:10:45 +02:00
Bartosz Taudul
0b74b14f88 Save thread group hint. 2024-08-03 20:23:26 +02:00
Bartosz Taudul
bdacfe7c37 Add a list of pending thread hints. 2024-08-03 20:10:36 +02:00
Bartosz Taudul
28a9750f8a Process thread group hints. 2024-08-03 20:10:36 +02:00
Bartosz Taudul
1458a6ab23 Don't assert on a workarounded bad case. 2024-07-11 20:45:14 +02:00
Matias Kangasjärvelä
4bbe973e3a Fix source location payload source file string length calculation 2024-06-19 19:47:56 +03:00
Bartosz Taudul
be40c1e38e Use strlen instead of pointer walking in the rest of places. 2024-06-16 18:20:16 +02:00
Andrew Woloszyn
0c7cbd1d03 Fix for assert in GetGpuSourceLocationZonesCntReal
When TRACY_NO_STATISTICS is defined, the assert in
GetGpuSourceLocationZonesCntReal will always get hit
as nothing is ever inserted in gpuSourceLocationZonesCnt
unless reading from a file.

Match the behavior with GetGpuSourceLocationZonesReal
to add the source location if it is missing.
2024-05-30 14:26:20 -04:00
Bartosz Taudul
d3da7dcecd Fix out-of-bounds access on non-continuous frames. 2024-05-24 22:52:46 +02:00
Bartosz Taudul
afe5c8dfbe Don't try to create FrameData in ProcessFrameMarkEnd(). 2024-05-23 19:48:33 +02:00
Bartosz Taudul
89f1fb4825 Terminate connection when memory limit is exceeded. 2024-05-05 21:04:26 +02:00
Bartosz Taudul
5f0cac546b Pass memory limit to worker. 2024-05-05 20:50:03 +02:00
Bartosz Taudul
fee5982abd Make InlineStackData non-static. 2024-05-04 14:42:40 +02:00
Bartosz Taudul
e77224975d Update last time when callstack or hw samples arrive. 2024-03-26 20:48:52 +01:00
Bartosz Taudul
fc8fc80900 Drop support for pre-0.9.0 traces. 2024-01-02 20:08:41 +01:00
Bartosz Taudul
762582357b Check if source location counts are in order when loading traces. 2023-12-31 14:16:50 +01:00
Bartosz Taudul
586c6bf166 Hook up source location overflow failures.
Note: not tested. Expect some off-by-one bugs. Control flow may fail. Oh no.
2023-12-31 13:06:51 +01:00
Bartosz Taudul
54ee77026f Add source location overflow failures. 2023-12-31 12:58:56 +01:00
Bartosz Taudul
d01113150d Calculate per-thread source location counts. 2023-12-20 16:42:37 +01:00
Bartosz Taudul
af73dba73e Merge pull request #665 from tiago-rodrigues/trodrigues/offline_symbol_resolve
Add support for offline callstack symbol resolving
2023-11-27 16:53:22 +01:00
Ivan Molodetskikh
ad39a01de1 Don't error on frame end without start (#666)
With on-demand profiling we're very likely to connect in the middle of a
discontinuous frame and thus receive a frame end without any preceding
frame start. So don't error out in this case.
2023-11-19 19:09:58 +01:00
Tiago Rodrigues
687d681764 Instead of adding new method, make StoreString public 2023-11-19 06:32:17 -08:00
Tiago Rodrigues
f4f75eac64 Add support for offline symbol resolving by setting the "TRACY_SYMBOL_OFFLINE_RESOLVE=1" env var
- Add a tool "tracy-edit" that allows loading a tracy capture, patching symbols and recompress the result
- Add offline symbol resolvers for linux (using addr2line) and windows (using dbghelper)
2023-11-19 06:32:16 -08:00