Commit Graph

10903 Commits

Author SHA1 Message Date
Bartosz Taudul
2ec2c2c8ac Mention that statistics range limit also affects source view. 2026-08-22 12:41:29 +02:00
Bartosz Taudul
dce2c710e5 Merge pull request #1459 from alandtse/feat/mcp-sdk-v2
feat(mcp): migrate to MCP Python SDK v2
2026-08-22 11:04:22 +02:00
Alan Tse
e670bd18f7 feat(mcp): migrate to MCP Python SDK v2
`pip install mcp` now installs 2.x by default (v1 is
maintenance-only going forward), and nothing in this repo pinned a
version, so a fresh install already broke: v2 removed
mcp.server.fastmcp entirely, no compat shim.

- Import/class: mcp.server.fastmcp.FastMCP ->
  mcp.server.mcpserver.MCPServer.
- Transport options (host, port, sse_path, streamable_http_path)
  moved off the constructor and the settings object onto run();
  mutating mcp_server.settings.port now raises ValueError.
- _http_ping and the startup message read _SSE_PATH/
  _STREAMABLE_HTTP_PATH constants instead of settings.sse_path/
  settings.streamable_http_path -- v2 no longer exposes them to
  read back. Values match the SDK's own defaults in both versions
  ("/sse", "/mcp"), so served paths are unchanged.
- Adds extra/mcp/requirements.txt (mcp>=2.0.0,<3) -- there was no
  dependency manifest at all before this.

Decorator API is unchanged; every tool/resource here was already
async def, so the "sync handlers now run on worker threads" change
doesn't apply.

Verified in an isolated venv (mcp 2.0.0): module imports cleanly
with all 10 tools and 2 resources registered, the server starts
and serves streamable-http on the expected path, and _http_ping
correctly reports a running instance as alive.
2026-08-21 20:42:28 -07:00
Bartosz Taudul
1dfe828cdf Do not assert on zero content length in HttpRequest. 2026-08-22 02:26:54 +02:00
Bartosz Taudul
23ffe89d24 Abort pending update check on profiler exit. 2026-08-22 02:20:24 +02:00
Bartosz Taudul
f5938e0336 Remove unused Socket::ConnectBlocking. 2026-08-22 02:20:24 +02:00
Bartosz Taudul
86ea59bbe3 Make HttpRequest interruptible. 2026-08-22 02:20:24 +02:00
Bartosz Taudul
56f5d1239d Add IsConnecting and interruptible ReadUpTo to Socket. 2026-08-22 02:20:21 +02:00
Bartosz Taudul
cc04578f68 Derive meson and python package versions from TracyVersion.hpp. 2026-08-21 23:05:58 +02:00
Bartosz Taudul
39722e1e3f Skip timeline drawing when no width is available. 2026-08-21 22:10:07 +02:00
Bartosz Taudul
78a7553c6f Guarantee forward progress in the plot preprocess loop. 2026-08-21 22:10:05 +02:00
Bartosz Taudul
cdd5940b44 Define TRACY_NO_FILESELECTOR when the NO_FILESELECTOR option is set.
The CMake option only controlled whether NFD is built and linked, but
the file selector code is guarded by the TRACY_NO_FILESELECTOR macro,
which the build never defined - configuring with -DNO_FILESELECTOR=ON
failed to compile (nfd.h not found in TracyFileselector.cpp,
BackendWayland.cpp and BackendGlfw.cpp). Define the macro for the
profiler target when the option is set.
2026-08-21 20:20:45 +02:00
Bartosz Taudul
246139fb04 Show the NFD error message in the file selector failure popup.
When the native dialog failed, the popup said "File selector cannot
be displayed. Check nfd library implementation for details." but never
showed any details: NFD_GetError() was never read, so the actual
failure reason (e.g. the xdg-desktop-portal lacking a FileChooser
implementation on the session) was invisible and the user was stuck
without a way to open or save traces.

Capture NFD_GetError() into a static string when
NFD_OpenDialogU8_With()/NFD_SaveDialogU8_With() return NFD_ERROR and
display it in the popup. The copy is required: the returned pointer
references NFD-internal storage (the D-Bus error message or a static
buffer) that is overwritten by the next NFD call or cleared on
shutdown. In TRACY_NO_FILESELECTOR builds no NFD exists, so the
previous fallback line is kept there.

The error is shown as a single line (TextUnformatted) rather than
wrapped: in an AlwaysAutoResize window the wrap width is derived from
the previous frame's window size, which feeds back into the auto-size
and oscillates, converging to a narrow multi-line column for a ~110
character D-Bus message.
2026-08-21 20:20:45 +02:00
Bartosz Taudul
5257132d97 Indent grouped child zone rows in the zone info window.
When a child group was expanded, the member rows were not visibly
indented under the group name: each row starts at the tree indent
(column 0 is IndentEnable by default, and TableBeginRow() latches the
open group's TreePush indent), so a single Indent() put the label two
IndentSpacing from the cell origin. The group header, however, leads
with the source location color box plus item spacing before its tree
arrow, so its name starts four IndentSpacing further right than the
member labels - the child list read as a continuation of the header
row instead of a subtree.

Add a second Indent() (and the balancing Unindent()) so the member
labels land clearly to the right of the group name. The full-row
Selectable behavior is unchanged. GPU zones are unaffected: their
rows carry no color box, so the member labels were already one level
right of the group name.
2026-08-21 20:20:44 +02:00
Bartosz Taudul
db851737e0 Prevent ini settings from reversing sortable table column order.
The imgui 1.92.9b ini writer omits 'Column N' lines for columns without
saved data (e.g. the unsized, unsorted 'Zone' column of the child zones
table, which only persists the default Time sort). On restore, the
missing entry keeps Index == -1, the sequential fallback in
TableLoadSettingsForColumns() assigns it to the remaining column, and
TableFixDisplayOrder() sorts DisplayOrder -1 to the end - flipping the
column order (Time | Zone in the zone info child list) for the session.
Guard the non-reorderable load path against phantom entries.

Upstream: https://github.com/ocornut/imgui/issues/9519
2026-08-21 20:20:42 +02:00
Bartosz Taudul
73917aaef5 Sort single-member child groups by zone name in the zone info window.
The group name-sort key was always the source location name, but
single-member groups display the zone-level name, which prefers the
runtime ZoneName() string. Such groups sorted by a name the user could
not see. The key now mirrors the display: zone name for single-member
groups, source location name for the rest. GPU zones are unaffected
(their names always resolve from the source location).
2026-08-21 02:03:50 +02:00
Bartosz Taudul
f0fce23bb6 Allow sorting child zones by name in the zone info window.
The child zone list was always sorted by time. It is now a sortable
table with Zone and Time columns, like the statistics view and the
time distribution table in the same window: Time is the default sort
(descending, as before), Zone sorts by name with time as the
tiebreak, and groups plus their members follow the same selection.
The sort choice persists across zones and the group toggle. Group
and child names are looked up once per draw only when name-sorting.
2026-08-21 02:03:50 +02:00
Bartosz Taudul
ad7a1744fa Add web gui test skill. 2026-08-21 02:03:47 +02:00
Bartosz Taudul
62bffd085c Merge pull request #1458 from TravisGesslein/master
D3D12: pass an empty written range when unmapping the readback buffer
2026-08-20 20:46:16 +02:00
Travis Gesslein
f8a75703f9 D3D12: pass an empty written range when unmapping the readback buffer
Otherwise on unmap you can get the validation layer error:

"ID3D12Resource3::ID3D12Resource::Unmap: pWrittenRange does not point to an empty D3D12_RANGE and
the heap type is D3D12_HEAP_TYPE_READBACK. Readback resources can be written by the CPU but there's
not much utility. The rationale is that readback heaps are stuck in COPY_DEST state such that the
GPU can never use what the CPU is writing. The range [0, 524288) should be empty (Begin >= End)."

Check also https://learn.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12resource-unmap

"This indicates the region the CPU might have modified" -> tracy essentially declares the entire range as written, but it's not even a cpu->gpu write buffer -> bug.
2026-08-20 17:36:39 +02:00
Bartosz Taudul
e3cde055cd Export Tracy version in the installed CMake package.
TracyConfig.cmake now sets TRACY_VERSION_STRING and a
TracyConfigVersion.cmake is generated and installed, so
find_package(Tracy X.Y CONFIG) works against installed trees.
Compatibility mode is SameMinorVersion: for a 0.x project the minor
version is the compatibility unit, and consumers who need to pin the
exact version can use find_package(... EXACT). SamePatchVersion is
not an option - it requires CMake 4.4 while the project minimum is
3.13.
2026-08-20 01:03:49 +02:00
Bartosz Taudul
0e37b94e6c Add TracyAssert.hpp to CMake / Meson. 2026-08-20 01:03:47 +02:00
Bartosz Taudul
6b58f7d8d0 Report system tracing setup failures.
SysTraceStart previously reported success even when no perf events
could be opened, leaving a worker thread running over no buffers
and an empty CPU section without explanation; it now fails in that
case. Also log when /proc/kallsyms cannot be read, which otherwise
silently results in ??? kernel stack frames.
2026-08-19 22:18:59 +02:00
Bartosz Taudul
05f0508684 Fix system tracing on kernels older than 4.1.
perf_event_attr.use_clockid only exists since Linux 4.1 and
sample_max_stack since Linux 4.8; older kernels (e.g. the 3.18
kernels of 32-bit Android devices) reject the attributes with
EINVAL/E2BIG, which silently disabled all of system tracing.
Classify the running kernel from uname(2) and only send the fields
its perf_event_open ABI supports.
2026-08-19 22:18:57 +02:00
Bartosz Taudul
e2c05210e7 Add a note about zones crossing multiple on-demand connections. 2026-08-19 20:30:42 +02:00
Bartosz Taudul
275fef576a Bring Lua on-demand connection matching logic up-to-date with C++ side. 2026-08-19 20:30:40 +02:00
Bartosz Taudul
2a3792aaa3 Handle source code queries in no-callstack builds.
The symbol worker thread, which answers source code queries, only exists
when call stack support is compiled in. Handle the query directly in the
main thread so it is always answered and the server can terminate.
2026-08-19 17:54:44 +02:00
Bartosz Taudul
ad99139f8e Include TracyWebGPU.hpp in CMakeLists.txt and meson.build. 2026-08-18 23:20:01 +02:00
Bartosz Taudul
fee9285d68 Use the compiler builtin for the ARM thread id.
The mrc to c13/c0/3 (thread id register) is undefined on ARMv5 (e.g.
ARM926EJ-S) and SIGILL'd during init. __builtin_thread_pointer lowers
to the same mrc on targets with a thread pointer register and to
__aeabi_read_tp on soft-TLS targets.
2026-08-18 22:35:44 +02:00
Bartosz Taudul
a4b51631ed Regenerate markdown manual. 2026-08-18 18:41:32 +02:00
Bartosz Taudul
433ac3629f Document that manual lifetime requires profiler shutdown.
https://github.com/wolfpld/tracy/issues/483
2026-08-18 18:39:45 +02:00
Bartosz Taudul
16d9c15663 Include TracyMangle.hpp in TracyDebug.hpp for consistent delayed init state. 2026-08-18 00:30:28 +02:00
Bartosz Taudul
4e9121eb2f Typos. 2026-08-18 00:28:32 +02:00
Bartosz Taudul
7f7bd69195 Remove TRACY_DELAYED_INIT option.
Delayed init was introduced 2019-02-19 in ef5e30056 and was lazy init at
that time, matching the name.

This changed 2020-05-19 in 4eb78f5c8, when auto-init was added, making
delayed init not delayed anymore.

While the option is still needed to make manual lifetime work, and it has
to be enabled on apple, there's no reason anymore to expose it to users.
2026-08-18 00:26:24 +02:00
Bartosz Taudul
2a7542ccd8 Mangle the GetToken accessor based on config.
The macro fast paths only reference GetProfiler from -O0 code, direct
calls, and ON_DEMAND builds: the single GetProfiler() call on the macro
path sits behind the constexpr-dead callstack guard and is folded away
at -O1+, so Release builds carried no config fingerprint and mismatched
clients linked silently.

GetToken is the hot-path binding of every queueing macro and is
referenced at all optimization levels; mangle it the same way so
mismatches fail at link time in Release builds too.
2026-08-17 22:21:57 +02:00
Bartosz Taudul
328f50211f Link TracyImGui library with libdl.
ImGui OpenGL loader uses dlopen / dlsym / dlclose to load the OpenGL
implementation.

Linking with libdl is not needed with glibc >= 2.34 (released in 2021):

NEWS for version 2.34
=====================

Major new features:

* In order to support smoother in-place-upgrades and to simplify
  the implementation of the runtime all functionality formerly
  implemented in the libraries libpthread, libdl, libutil, libanl has
  been integrated into libc.  New applications do not need to link with
  -lpthread, -ldl, -lutil, -lanl anymore.

(...)

Older glibc versions and also possibly other libc implementations still
need the libdl link.
2026-08-17 22:13:59 +02:00
Bartosz Taudul
f5c53af367 Fix plot color R/B channel swap. 2026-08-17 00:17:19 +02:00
Bartosz Taudul
b751c1c8d0 Fix csvexport --sep and --filter options. 2026-08-16 23:41:09 +02:00
Bartosz Taudul
b6cfdd2d2e Update embed.tracy to 0.14.
Previous was 0.10, which was too old after bumping minver to 0.11.
2026-08-16 15:26:10 +02:00
Bartosz Taudul
453d649c1a Add TRACY_ASSERT for custom assert implementations. 2026-08-16 13:32:44 +02:00
Bartosz Taudul
254f0ad210 Drop support for pre 0.11 traces. 2026-08-16 00:27:30 +02:00
Bartosz Taudul
3f9714059a Add protocol history for 0.14. 2026-08-16 00:04:13 +02:00
Bartosz Taudul
8fdfd08af0 Refactor GPU context id handling.
The gpu backends each used a bare 255 as the sentinel for a
not-yet-initialized context id. Define InvalidGpuContextId (-1) in
TracyQueue.hpp and replace the scattered 255s and their asserts
with it.

Id exhaustion is handled by an error message and an assert in the
new NextGpuContextId() getter. Non-assert builds continue execution,
at which point they are no longer valid. Handling this code path
is out of scope here. Various attempts at handling the exhaustion
problem have been otherwise purged from the API implementations.
2026-08-15 21:46:29 +02:00
Bartosz Taudul
54ecee1f74 Fix memory events not being attributed to fibers.
Alloc and free events stored the OS thread, so the memory view's
Zone alloc/Zone free columns resolved the zone on the OS thread's
timeline instead of the currently-running fiber. Attribute them to
the active fiber the same way zone and message events are
(follow ThreadData::fiber).
2026-08-15 15:15:54 +02:00
Bartosz Taudul
b10d466a38 Regenerate markdown manual. 2026-08-15 13:41:23 +02:00
Bartosz Taudul
86fc7f02cb Document the need to reflect order of allocations in reported events. 2026-08-15 13:21:11 +02:00
Bartosz Taudul
16805b47ef Update TRACY_IGNORE_MEMORY_FAULTS description in CMake/Meson options. 2026-08-15 13:08:44 +02:00
Bartosz Taudul
756411d802 Allow disabling wait stacks capture. 2026-08-14 01:28:22 +02:00
Bartosz Taudul
d579ed3cce Fix VSync on 32-bit win32 targets.
The struct sizes are kernel sizes. A 64-bit kernel is required for
tracing anyway.
2026-08-13 18:34:58 +02:00
Bartosz Taudul
edc09a4e97 Fix 16-bit string length desync on offset recovery
The decoder recovered offset-encoded 16-bit string lengths into a
uint16_t, so sz += ProtocolOffset8Bit truncated lengths in [65536,
65791] back into [0, 255] in release builds, desynchronizing the
stream. Read the wire value into uint16_t sz16 and recover into a
uint32_t sz, relying on automatic promotion for the addition.

Align the client asserts with the encoder's actual capacity
(ProtocolOffset8Bit + uint16 max).
2026-08-13 18:18:58 +02:00