Commit Graph
194 Commits
Author SHA1 Message Date
Clément Grégoire 10c6e3dee1 Fix delay loading by not exporting variables
[`/DELAYLOAD`](https://learn.microsoft.com/en-us/cpp/build/reference/delayload-delay-load-import?view=msvc-170) only works with exported functions, not variables (as it patches thunks after the first load).
So instead of using exporting a pointer for `___tracy_RtlWalkFrameChain`, make it a function that will call said pointer. This only adds a `mov`+`jmp` instructions in optimized builds to the call, which is negligible compared to the actual cost of RtlWalkFrameChain. This also does not affect the reported callstack since it will use a `jmp` without touching the stack, so `___tracy_RtlWalkFrameChain` won't appear in the capture stacktrace.
2025-05-12 11:56:38 +02:00
Clément Grégoire 83869c6f76 Replace sched_wakeup by sched_waking
`sched_wakeup` notifies about the kernel saying it will be waking up the thread, not the reason for the actual wakeup. This only allows to measure the scheduling latency, not the full wake up latency.
Instead, use `sched_waking` which is triggered on the ring of the CPU and thread responsible for the wakeup. `target_cpu` contains the cpu on which the thread will be woken up.
2025-04-13 19:59:03 +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
Igor S. Gerasimov 7093eb0b08 Update int for ___tracy_after_try_lock_lockable_ctx 2025-01-02 14:33:09 +01:00
Igor S. Gerasimov 7e128f3bce Update int for ___tracy_emit_plot_config 2025-01-02 14:32:04 +01:00
Igor S. Gerasimov 6e220fee91 Update int for ___tracy_emit_frame_image 2025-01-02 14:25:06 +01:00
Igor S. Gerasimov 94403bde4b Update int for ___tracy_before_lock_lockable_ctx 2025-01-02 14:23:06 +01:00
Igor S. Gerasimov cd8e2a5d8a Update int for ___tracy_connected 2025-01-02 14:20:37 +01:00
Igor S. Gerasimov a8f844b970 Use int32_t type for depth in client 2025-01-02 14:19:12 +01:00
Igor S. Gerasimov 78bca3f0e1 Use int32_t for callstack (depth) 2025-01-02 14:04:06 +01:00
Igor S. Gerasimov 4929ac6487 Use int32_t for secure flag 2025-01-02 13:45:47 +01:00
Igor S. Gerasimov 39d382b033 Use int32_t for active flag 2025-01-02 13:42:22 +01:00
Igor S. Gerasimov 8baa50b2f5 Update int for ___tracy_profiler_started 2025-01-02 13:28:39 +01:00
Bartosz Taudul 8b0b2343e1 Merge pull request #957 from foxtran/feature/merge-calls-callstack
Simplify API by decreasing a number of entry points
2025-01-02 12:08:39 +01:00
Igor S. Gerasimov b9c7cd1738 Fix code formatting 2025-01-02 11:49:51 +01:00
Igor S. Gerasimov 31eeb843c7 Small reformat 2025-01-02 11:26:56 +01:00
Igor S. Gerasimov d30a2d6854 Simplify ZoneBegin functions 2025-01-02 11:26:56 +01:00
Igor S. Gerasimov a2fce55aee Rename has_stacktrace -> has_callstack 2024-12-27 11:43:00 +01:00
Igor S. Gerasimov 96ba28e761 Use constexpr instead of macro in memory manager in C API 2024-12-27 11:29:41 +01:00
Igor S. Gerasimov 39137d809e Accept zero-depth callstack 2024-12-27 11:29:41 +01:00
Igor S. Gerasimov e9eecbb2c6 Replace #ifdef TRACT_HAS_CALLSTACK with constexpr call 2024-12-27 11:29:41 +01:00
Igor S. Gerasimov cf912bbb19 Merge ScopedZone initializers 2024-12-27 11:29:41 +01:00
Igor S. Gerasimov e9664a1c87 Introduce has_stacktrace function 2024-12-27 11:29:41 +01:00
Igor S. Gerasimov 5051db201e Show error message if TRACY_MANUAL_LIFETIME is enabled without enabled TRACY_DELAYED_INIT 2024-12-27 08:51:50 +01:00
JCash c5797e4e36 Added missing tracy:: 2024-12-01 16:19:27 +01:00
Sergio Acereda b9ee0d3b4c Leak, returned value from GetThreadDescription not freed 2024-11-19 14:24:50 +01:00
Trout Zhang 339a92a7b2 Fix crash on Android due to wrong TLS model 2024-11-15 18:22:35 +02:00
Fabian Knorr 7ef690bd5a Silence GCC fscanf warning in TracySysPower.cpp
fscanf is [[warn_unused_result]], which triggers -Wunused-result. In
this instance it is correct for maxRange to remain unchanged if reading
from sysfs should fail for some reason.
2024-11-13 10:15:05 +01:00
Bartosz Taudul a916050724 Add memory discard to C API. 2024-10-21 18:31:49 +02:00
Bartosz Taudul f4df9013bb Add memory discard message.
This can be used to erase all allocations made within the named memory
pool. The usual use case would be for arena allocators, which allocate
by advancing a pointer and never have to free the memory. There is no
tracking of individual allocations and everything is freed frequently,
by reseting the pointer, for example once per frame.

Since this is used in special-purpose allocators, there is no support
for discarding the memory of the default memory pool.
2024-10-21 18:22:22 +02:00
Joshua Kriegshauser 66edfaec42 More PR feedback 2024-10-02 12:50:12 -07:00
Joshua Kriegshauser e1554a13e0 PR feedback 2024-10-02 11:21:34 -07:00
Joshua Kriegshauser 9dfb1e98b9 Line and braces tweaks 2024-10-02 11:21:34 -07:00
Joshua Kriegshauser 97a6a3dde7 always override unhandled exception filter 2024-10-02 11:21:34 -07:00
Joshua Kriegshauser cc860fe56a Reduce template code 2024-10-02 11:21:34 -07:00
Joshua Kriegshauser 201dcb6a8a Tweaks 2024-10-02 11:21:34 -07:00
Joshua Kriegshauser 5213c53bb0 Use SetUnhandledExceptionFilter instead of vectored exceptions 2024-10-02 11:21:34 -07:00
Joshua Kriegshauser 9378718231 Safe copy 2024-10-02 11:21:34 -07:00
Bartosz Taudul 11777e8136 Check if core_id and die_id exist. 2024-09-07 23:53:57 +02:00
Bartosz Taudul ea4de3be36 Detect and report if running under Wine. 2024-09-07 22:09:00 +02:00
Bartosz Taudul 8e3d250654 Check for errors from GetLogicalProcessorInformationEx(). 2024-08-31 11:36:59 +02:00
Bartosz Taudul 8f3b312b7c Get CPU die information on windows. 2024-08-24 17:47:00 +02:00
Bartosz Taudul e947aeb72d Read CPU die information on Linux. 2024-08-22 20:26:09 +02:00
Bartosz Taudul 353545a1e9 Add die to topology data. 2024-08-22 00:58:01 +02:00
Bartosz Taudul fb617fe998 Zero-initialize CPU topology data structure. 2024-08-22 00:54:12 +02:00
Patrick Moffett b2ee226fd7 remove constexpr from GetSamplingInterval 2024-08-08 22:22:52 -07:00
Bartosz Taudul ee65a45bef Vararg functions can't be inlined. 2024-08-08 19:55:32 +02:00
Bartosz Taudul 37bfde5106 Add fiber enter API with group hint. 2024-08-04 00:08:18 +02:00
Bartosz Taudul 8cea63cbca Send thread group hint message. 2024-08-03 19:40:49 +02:00