Commit Graph

231 Commits

Author SHA1 Message Date
Bartosz Taudul
f998e3e2a9 Merge pull request #1151 from dpelle/make-ZoneNameF-less-error-prone
Make ZoneNameF() less error-prone by checking format against args
2025-09-11 12:30:03 +02:00
Bartosz Taudul
5cf408fc10 Cosmetics. 2025-09-11 00:57:22 +02:00
Dominique Pelle
5f36f3d2ec Make ZoneNameF() less error-prone by checking format against args
`ZoneNameF(fmt, ...)` was error-prone: if the format is inconsistent
with arguments, the code compiled fine without errors or warnings.
Use gcc/clang `__attribute__((format(printf, fmt_idx, arg_idx)))`
function attribute, so that `ZoneNameF(fmt, ...)` can now check
at compilation time the consistency between the format and the
arguments.

See https://gcc.gnu.org/onlinedocs/gcc-3.1/gcc/Function-Attributes.html
2025-09-10 20:26:57 +02:00
Anders Wang Kristensen
355a11f47f Missing initialization of dequeueStatus 2025-09-10 14:43:28 +02:00
Anders Wang Kristensen
f21f8d6ad2 Fix crash due to freeing elements of m_serialDequeue twice.
In Profiler::DequeueSerial if AppendData fails part way through m_serialDequeue then the elements could be freed again in Profiler::ClearSerial, which leads to memory corruption in rpmalloc.
2025-09-10 12:56:47 +02:00
Minjie
c545b34f68 Add connection check when TRACY_ON_DEMAND for EnterFiber and LeaveFiber 2025-08-15 22:36:45 +08:00
Marcos Slomp
5864350912 removed duplicated extern "C" 2025-08-02 06:48:00 -07:00
Marcos Slomp
9b84b527a6 adding manual control over sampling profiling 2025-08-01 15:24:30 -07:00
Marcos Slomp
b4b5f46d7b speeding up ExternalName queries 2025-08-01 12:53:56 -07:00
Bartosz Taudul
3bff910a27 Merge pull request #1121 from siliceum/feature/faster-module-caching-windows
Add faster module caching fallback by using GetModuleHandleExA
2025-08-01 20:44:19 +02:00
Gabriel Bon
1f6531f46d Add faster module caching fallback by using GetModuleHandleExA 2025-07-31 15:06:15 +02:00
Clément Grégoire
8c06fec09e Refactor libbacktrace usage with TRACY_USE_LIBBACKTRACE 2025-07-31 10:41:37 +02:00
Bartosz Taudul
c03fdaec1e Merge pull request #1097 from erieaton-amd/rocprofv3-2
Collect dispatches and counter values with Rocprofv3
2025-07-22 13:33:15 +02:00
Eric Eaton
1639598d62 Update documentation
This provides some instructions and tips for the manual. Also:
* Made the calibration feature a CMake option
* Cleaned up some minor code issues
* Fixed an issue with the calibration
* Incremented patch number
2025-07-21 15:30:42 -07:00
nyorain
02295cbfeb Allow to access wrapped Lockable object 2025-07-20 18:26:22 +02:00
Patrik Kraif
a642b84add Add missing TracyWinFamily header include 2025-07-18 10:10:02 +02:00
Patrik Kraif
4a3713cca8 Add support for GDK 2025-07-16 12:51:16 +02:00
Bartosz Taudul
8fa40e87d1 Merge pull request #1016 from 6yry6e/systrace-hang-fix
Fix: Hang on shutdown with enabled system tracing
2025-07-12 11:49:05 +02:00
Eric Eaton
0c77bfcbed Use tracy data structures 2025-07-11 17:18:17 -07:00
Eric Eaton
114f6ef096 Supply the correct thread ID for annotations 2025-07-11 17:18:17 -07:00
Eric Eaton
d4a35c5ab1 Change rocprof context name 2025-07-11 17:18:07 -07:00
Eric Eaton
3fce5c1280 Use a map to record counter values
This removes the limitation of 10 counters.
2025-07-11 17:17:05 -07:00
Eric Eaton
6a5e4d8a60 Use assert intead of a condition 2025-07-11 17:17:05 -07:00
Eric Eaton
1494fe5671 Apply code style 2025-07-11 17:17:05 -07:00
Eric Eaton
d1f9df8058 Get counter names from environment variable
Allows user to customize the collected information with environment
variable TRACY_ROCPROF_COUNTERS.
2025-07-11 17:16:00 -07:00
Eric Eaton
e9e0404930 Add support for multiple counters 2025-07-11 17:16:00 -07:00
Eric Eaton
a754db16f8 Show counter name in GUI 2025-07-11 17:16:00 -07:00
Eric Eaton
2e49bdf4cb Add counter value collection 2025-07-11 17:16:00 -07:00
Eric Eaton
86de39704f Add calibration thread
Synchronizes the GPU timeline periodically. This is needed to counter
network time updates that cause drift in the GPU and CPU timeline.

Signed-off-by: Eric Eaton <erieaton@amd.com>
2025-07-11 17:16:00 -07:00
Eric Eaton
495321fc10 Record dispatch enqueue times 2025-07-11 17:16:00 -07:00
Eric Eaton
98047ffbe2 Delay initialization
Delay initialization until tracy is started. Removed some debug prints.
2025-07-11 17:16:00 -07:00
Eric Eaton
1517756d54 Add buffer copy tracing 2025-07-11 17:16:00 -07:00
Eric Eaton
00648836a2 Add rocprof dispatch tracing 2025-07-11 17:16:00 -07: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
Martijn Courteaux
8b1576170d Disable Windows __try1 __except1 mechanic to be cross compilable from Linux. 2025-06-19 17:11:28 +02:00
mncat77
1d6fda26ea Fix MinGW build 2025-06-19 17:11:28 +02:00
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
Timur Popov
46a5cc4fa5 Stop filling queues with systrace data on exit 2025-03-29 01:12:28 +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