Commit Graph
11188 Commits
Author SHA1 Message Date
Bartosz Taudul 76bdf0cdb7 Achievements text tweaks. 2026-10-31 18:13:29 +01:00
Bartosz Taudul 16ca4f5913 Merge pull request #1475 from xdBronch/fuchsia
import/fuchsia: stop manually null terminating names
2026-10-30 20:33:01 +01:00
Bartosz Taudul 20a293b357 Merge pull request #1505 from Lectem/history-json
Store profiler history in a single history.json
2026-10-29 21:10:11 +01:00
Lectem 056faddb24 Store profiler history in a single history.json
Replace the binary connection.history file and the ConnectionHistory class
with History, which keeps the history in a JSON file and writes it back when
the profiler exits. Existing history is not migrated.
2026-10-29 20:36:22 +01:00
Bartosz Taudul af6b4fa729 Merge pull request #1504 from Lectem/windows-dll-unload-hang
Don't deadlock when joining threads from a DLL being unloaded.
2026-10-29 19:20:29 +01:00
Bartosz TaudulandTim Jammer 63c0a2f723 Leak statics that profiler threads use during exit.
Function-local statics are destroyed in reverse order of initialization,
on the same atexit stack that carries the shutdown handler installed at
profiler startup. Statics initialized lazily while profiling are
therefore destroyed before that handler runs, while worker and network
threads may still be using them; with TRACY_NO_EXIT the handler blocks
in the exit sequence until the server disconnects, keeping the threads
live across the entire destruction. On Android this let a symbol query
execute `s_mappings = ParseMappings()` on a destroyed vector, causing a
use-after-free and a double free. The legacy-GCC thread data key carried
the same hazard: pthread_key_delete at static destruction while threads
could still call pthread_getspecific on the key.

Construct the objects on the heap and never free them. The allocations
are one-time and stay referenced, so leak sanitizers classify them as
still reachable.

Co-authored-by: Tim Jammer <tim.jammer@web.de>
2026-10-29 18:17:07 +01:00
Bartosz Taudul aaccc47036 Merge pull request #1490 from Lectem/shared-sampling-rings
Shared sampling rings for monitor
2026-10-29 17:51:31 +01:00
Clément Grégoire a181b62a6a Don't deadlock when joining threads from a DLL being unloaded.
When Tracy is built into a DLL, the static `Profiler` is destroyed inside `DllMain(DLL_PROCESS_DETACH)` while the loader lock is held. `Thread::~Thread()` waited for the thread to exit, but a thread can only exit by taking the loader lock for `DLL_THREAD_DETACH`, so `FreeLibrary` hung forever (typically in `s_symbolThread->~Thread()`).

The thread function now signals an event when it is done and parks in an alertable sleep instead of returning. The destructor waits for that event rather than for the thread itself. Inside a loader callout (detected with `RtlIsThreadWithinLoaderCallout`) the parked thread is terminated, which is safe as it holds no locks at that point. Everywhere else it is woken with an APC and exits normally, so `thread_local` destructors still run. If the ntdll export is unavailable, the previous behaviour is kept.

Same approach as `asio::detail::win_thread`.

Reproduced with a test DLL embedding Tracy (`TRACY_ON_DEMAND`) loaded and freed in a loop: `FreeLibrary` hung on the first unload before the change, and 100 cycles pass after it when the DLL stays loaded for at least a few ms. Unloading immediately after loading still hangs if the Tracy threads are blocked on the loader lock during their startup (e.g. in `gethostname` or `SymInitialize`), as they never reach the parking point. Startup and shutdown timings are unchanged.
2026-10-29 14:14:20 +01:00
Clément Grégoire 4ff170540e Address review comments on the shared sampling rings
Move the shared ring comment onto `OpenSampleEvent`, where the sharing happens. Name the number of sampling event kinds with `NumSampleEventKinds` instead of using `EventVsync` directly, and assert in `OpenSampleEvent` that the event id is below it.
2026-10-29 13:15:46 +01:00
Bartosz Taudul 9f1c8e652c Merge pull request #1502 from alandtse/pr/mcp-plot-thread-stats
feat(mcp): add plot window and thread zone stats
2026-10-27 20:53:12 +01:00
Bartosz Taudul b5acd07901 Merge pull request #1500 from alandtse/fix/d3d11-reconnect-disjoint
fix(d3d11): resume GPU timing after reconnect
2026-10-27 20:51:52 +01:00
Alan TseandClaude Sonnet 5.5 bbb4eebc61 feat(mcp): get zone stats for a single thread
get_all_zone_stats mixes every thread, so the main-thread cost of a
zone could not be separated from worker threads. get_thread_zone_stats
returns the same per-name stats for the zones recorded on one thread,
and its per-thread sums match get_all_zone_stats exactly.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L3DnWkXakGRgz9C8BaLM47
2026-10-27 10:04:47 -07:00
Alan TseandClaude Sonnet 5.5 0ea62d9551 feat(mcp): read plot samples by time window
get_plots only summarises a whole trace, so a plot could not be
compared across windows. get_plot_samples returns the (time, value)
pairs in a range, thinned to a maximum count, and
get_plot_window_stats returns count, min, max and average over just
that range.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L3DnWkXakGRgz9C8BaLM47
2026-10-27 10:04:47 -07:00
Alan TseandClaude Sonnet 5.5 a03c657cb5 fix(d3d11): resume GPU timing after reconnect
When the client disconnects while a disjoint query result is pending,
the not-connected branch of Collect resets the checkpoints without
re-issuing Begin. The next connected Collect then calls End twice, so
no GpuTime items are produced and every later connection shows GPU
zones with no timings.

Drain the pending result and Begin the query before resetting.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L3DnWkXakGRgz9C8BaLM47
2026-10-27 02:32:29 -07:00
Bartosz Taudul 1f4c53574b Merge pull request #1498 from tuket/master
Remove assert that was failing in Android 9
2026-10-26 12:29:51 +01:00
tuket 270691f485 remove assert that was failing in Android 9 2026-10-26 09:02:42 +01:00
Bartosz Taudul 78f0da621e Merge pull request #1494 from jjcasmar/cuda-serialized-kernel-activity
Add an option to force serial CUDA kernel execution in CUPTI activity tracing
2026-10-23 12:04:11 +02:00
Juan Jose Casafranca d0ddff87da Rename TRACY_CUDA_SERIALIZED_KERNEL_ACTIVITY to TRACY_CUDA_FORCE_KERNEL_SERIAL_EXECUTION. 2026-10-22 21:30:24 +00:00
Juan Jose Casafranca 52ebe6c258 Add an option to collect CUDA kernel activity as CUPTI_ACTIVITY_KIND_KERNEL.
With CONCURRENT_KERNEL, MEMCPY or MEMSET activity enabled, CUPTI 13.0
faults the device with an illegal memory access once the nodes inside CUDA
graph conditional (IF/WHILE) bodies have executed about 699,050 times in a
context. TRACY_CUDA_SERIALIZED_KERNEL_ACTIVITY enables KERNEL activity
instead, which avoids the fault at the cost of serializing kernels. In that
mode CUPTI reports conditional-body kernels once per graph launch without
timestamps, so those records are skipped.
2026-10-22 19:45:43 +00:00
Bartosz Taudul e15c78fdac Wait for background reconstruction before exporting plots. 2026-10-22 17:44:47 +02:00
Lectem 71d2513d0e Share one ring per event kind and CPU in the sampling client
Sampling events of one kind on one CPU now share a ring: the first
thread's event owns it, and the others are redirected into it with
PERF_EVENT_IOC_SET_OUTPUT. Redirected fds are kept open and enabled by
the worker.
2026-10-20 19:54:22 +02:00
Lectem b8935a8a56 Group sampling globals into SysTraceState
Move the sampling client's file-level globals into a single SysTraceState
struct, so that the state of a trace session is in one place.
2026-10-20 19:54:22 +02:00
Bartosz Taudul 29aa268641 Add an assembly reading achievement. 2026-10-18 22:04:20 +02:00
Bartosz Taudul b8c32a326a Add a trace comparison achievement. 2026-10-18 21:57:52 +02:00
Bartosz Taudul 5c0dc013d1 Add a flame graph achievement. 2026-10-18 21:57:52 +02:00
Bartosz Taudul 7b3ace0d2b Add a source view achievement. 2026-10-18 21:57:51 +02:00
Bartosz Taudul 7cb1921808 Report file selector failure instead of crashing when NFD_Init failed. 2026-10-17 20:21:06 +02:00
Bartosz Taudul ee27a99188 Use the dispatch timeout as the unfocused throttle on Wayland.
Pass the 50 ms budget as the timeout of wl_display_dispatch_timeout
instead of sleeping after a nonblocking dispatch. The dispatch flushes
before polling and wakes on any event, e.g. re-granted focus.
2026-10-17 20:21:06 +02:00
Bartosz Taudul f5290242f3 Don't throttle the first Wayland frame on unknown focus state. 2026-10-17 20:21:04 +02:00
Bartosz Taudul 9e2127e60a Glue admonition header to the icon unconditionally. 2026-10-17 15:37:48 +02:00
Bartosz Taudul 778d6d712c Bump pandoc to 3.12.1. 2026-10-16 01:23:07 +02:00
Bartosz Taudul c2fc1bad70 Bump examples/dyna CPM to 0.43.2. 2026-10-16 01:23:07 +02:00
Bartosz Taudul 577441fae8 Bump CPM to 0.43.2. 2026-10-16 01:23:06 +02:00
Bartosz Taudul 7dc0a73966 Bump xxhash to 0.8.4. 2026-10-16 01:23:04 +02:00
Bartosz Taudul f8d55466fe Bump curl to 8.23.0. 2026-10-16 00:37:57 +02:00
Bartosz Taudul ef5269113d Bump usearch to 2.26.4. 2026-10-16 00:37:14 +02:00
Bartosz Taudul 6d5ad729f6 Bump nfd-extended to 1.4.1. 2026-10-16 00:35:21 +02:00
Bartosz Taudul a5a591d161 Bump freetype to 2.15.0. 2026-10-16 00:34:29 +02:00
Bartosz Taudul 254c49c01d Bump md4c to current HEAD. 2026-10-16 00:32:36 +02:00
Bartosz Taudul 37d58eca7f Add a zone inspection achievement.
Find zone moves from the instrumentation intro under it: searching
builds on having inspected a zone, not the other way around.
2026-10-16 00:24:13 +02:00
Bartosz Taudul 248f8ececf Add a GPU profiling achievement. 2026-10-16 00:24:13 +02:00
Bartosz Taudul 0265046f30 Add labels to the GPU profiling API sections. 2026-10-16 00:24:12 +02:00
Bartosz Taudul bf74c4cb8d Add a leak hunting achievement. 2026-10-16 00:24:12 +02:00
Bartosz Taudul 745bed8477 Emit label ids suppressed by pandoc in the generated manual.
Pandoc omits a heading's {#id} when it equals the auto-generated
identifier; the manual window resolves links only from explicit
suffixes, leaving six section anchors unnavigable.
2026-10-16 00:24:10 +02:00
Bartosz Taudul fd23005a67 Document achievements. 2026-10-15 02:05:34 +02:00
Bartosz Taudul c874d82aa4 Document hierarchical plots. 2026-10-15 02:05:31 +02:00
Bartosz Taudul 0c37d9c41e Adapt to new ImGui color scheme. 2026-10-15 00:31:16 +02:00
Bartosz Taudul a5995ba3fc Fix unbalanced ImGui begin/end state. 2026-10-15 00:25:36 +02:00
Bartosz Taudul ff78f7f002 Merge pull request #1484 from CamilleRelic/master
Add filtering and hierarchical view to plots selection
2026-10-14 23:14:29 +02:00
Bartosz Taudul 84be3825d5 Pass ImGuiChildFlags instead of the legacy border bool to BeginChild(). 2026-10-14 23:08:34 +02:00