Commit Graph

41 Commits

Author SHA1 Message Date
Clément Grégoire
b890719fdd Remove stray newline in TracySysTrace.cpp 2026-02-09 11:44:16 +01:00
Clément Grégoire
b778b67676 Fix trailing whitespace 2026-02-09 11:37:07 +01:00
Clément Grégoire
2b2fafbcfc Start cleaning TRACY_HW_TIMER checks.
Ideally I think we might want to have TRACY_HW_TIMER mean only TSC/CNTVCT, and define TRACY_TIMER_FALLBACK for platforms that don't have them or have a special case such as iOS.
But for now, keep the same behaviour.
2026-02-09 11:30:24 +01:00
Clément Grégoire
b27561c21e Add TRACY_DISALLOW_HW_TIMER for VMs / WSL2 2026-02-08 17:10:24 +01:00
Clément Grégoire
79cb60025d Monotonic clock fallback for systrace 2026-02-08 17:07:00 +01:00
Marcos Slomp
839b38d2ec removing implicit/default argument value 2026-01-15 11:29:49 -08:00
Marcos Slomp
44696c47c6 formatting 2026-01-15 11:27:49 -08:00
Marcos Slomp
dacb3dbae6 support for toggling EnableFlags after the singleton kernel session has started 2026-01-15 11:20:06 -08:00
Clément Grégoire
f17bd3f444 TracyDebug now uses TracyInternalMessage by default unless TRACY_VERBOSE or TRACY_NO_INTERNAL_MESSAGE is defined 2025-12-28 15:00:59 +01:00
Marcos Slomp
db745611c4 more explicit error check 2025-12-16 13:38:42 -08:00
Marcos Slomp
2403438bd9 error flow control for VSync tracing 2025-12-16 09:11:11 -08:00
Marcos Slomp
a0092a793a abandoning the private kernel session for now 2025-12-15 16:21:42 -08:00
Marcos Slomp
86a6b9b671 add admin check (and don't log it if it fails). 2025-12-08 08:40:26 -08:00
Marcos Slomp
04c32562a0 adressing review comments 2025-12-07 15:51:07 -08:00
Marcos Slomp
d363ddde2a missing events 2025-12-05 12:46:27 -08:00
Marcos Slomp
7b5de9e2b9 relocating ETW events (structs), and adding checks and comments 2025-12-05 12:03:57 -08:00
Marcos Slomp
f0b8658346 splitting event consumer 2025-12-03 14:55:08 -08:00
Marcos Slomp
bca011966d code formatting 2025-12-03 14:55:08 -08:00
Marcos Slomp
e5ca27966e ASCII 2025-12-03 14:55:08 -08:00
Marcos Slomp
f6965c62a9 reminder 2025-12-03 14:55:07 -08:00
Marcos Slomp
0adb0dbc57 refactoring ETW kernel session 2025-12-03 14:55:07 -08:00
Bartosz Taudul
be23d9354a Handle Lost_Event in Vsync callback on Windows. 2025-11-22 15:39:52 +01:00
Bartosz Taudul
5f4cccaa00 Use proper API to read /proc/mounts. 2025-11-13 19:40:28 +01:00
Bartosz Taudul
b762dc2a82 Retrieve tracefs mount path. 2025-10-25 21:06:37 +02:00
Marcos Slomp
b4b5f46d7b speeding up ExternalName queries 2025-08-01 12:53:56 -07: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
Sergio Acereda
b9ee0d3b4c Leak, returned value from GetThreadDescription not freed 2024-11-19 14:24:50 +01:00
Patrick Moffett
b2ee226fd7 remove constexpr from GetSamplingInterval 2024-08-08 22:22:52 -07:00
Bartosz Taudul
fb18a81d79 Add support for reading TRACY_SAMPLING_HZ from an env variable. 2024-07-30 18:42:05 +02:00
Cody Tapscott
6249999153 linux: respect TRACY_NO_SAMPLING for sys-tracing
This compile-time flag was being ignored on Linux. This change adds
gating for software-sampled stack trace sampling following the same
pattern as other `TRACY_NO_SAMPLE_*` options.

If `TRACY_NO_SAMPLING=1` is provided as an environment variable,
software stack sampling is also disabled.
2023-04-04 17:22:31 -04:00
mwl4
789f572332 Fix compilation on linux: use abort() instead of assert( false ).
assert() in release configuration resolves to empty code, while abort() is marked as [[noreturn]] and always is available.

gcc error:
error: ‘type’ may be used uninitialized in this function [-Werror=maybe-uninitialized]:
public/tracy/../client/../common/TracyAlign.hpp: In function ‘void tracy::SysTraceWorker(void*)’:
public/tracy/../client/../common/TracyAlign.hpp:22:11: error: ‘type’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
     memcpy( ptr, &val, sizeof( T ) );
     ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from public/TracyClient.cpp:26,
                 from X.cpp:
public/client/TracySysTrace.cpp:1258:35: note: ‘type’ was declared here
                         QueueType type;
                                   ^~~~
2023-01-25 15:08:51 +01:00
Bartosz Taudul
ecb4a0527a Do not retrieve call stacks if sampling is not requested. 2023-01-05 21:45:44 +01:00
Robert Adam
ece8779362 Fix cpuid symbol redefinition on older GCC versions
Since commit 940f32c1a8 building the Tracy
library on Linux using a GCC version < 11 would result in compile errors
due to symbol redefinitions of __get_cpuid_max, __get_cpuid and
__get_cpuid_count.

This is because prior to GCC 11 the cpuid.h header file did not have any
include guards and thus including this header more than once would
produce the abovementioned errors.

To work around this issue, including cpuid.h has been wrapped into a
custom header file that itself uses include guards and thus shields
cpuid.h from being included multiple times.

Fixes #452
2022-08-31 17:59:46 +02:00
Bartosz Taudul
197007ab47 Keep a list of buffers left to handle.
Previously a bitmap of buffers was repeatedly scanned to see which buffers
still contain data. This process was needlessly wasting cycles (seen as a
hotspot when profiled) and worse yet, the workload increased with the number
of CPU cores (=> buffers used) to handle.

The new implementation instead maintains a list of buffer indices that have to
be handled. This list does not contain empty buffers, so each loop iteration
performs some work, instead of just spinning in search for buffers to handle.
2022-08-18 13:59:56 +02:00
Bartosz Taudul
940f32c1a8 Add include for cpuid. 2022-08-18 13:40:37 +02:00
Bartosz Taudul
07a56f1148 Load globals to local variables. 2022-08-18 01:08:22 +02:00
Bartosz Taudul
e0f813d9e9 Add support for Vsync capture on Linux. 2022-07-30 21:29:44 +02:00
Bartosz Taudul
91b002267e Emit dedicated Vsync frame messages. 2022-07-30 19:53:40 +02:00
Bartosz Taudul
06c7984a16 Move all client headers and sources to public/ directory. 2022-07-17 15:47:38 +02:00