Commit Graph
122 Commits
Author SHA1 Message Date
Bartosz Taudul b68fe43335 Keep context switch sample vectors sorted.
Context switch samples were appended in arrival order. Samples which
were postponed due to missing context switch data are replayed after
newer samples were already classified, so the vector could become
unordered. Everything that reads it assumes time order: the wait stacks
range filter, the sampling statistics percentage denominator, and the
context switch sample filters in the trace load jobs. In the load jobs
an unordered vector could silently disable the filtering for the rest
of a thread, reintroducing the context switch samples into the symbol
and child sample maps.

Use a SortedVector and restore the ordering at the points where it can
break: after the postponed sample replay and when saving a trace. The
save file version is bumped, so that the sort order check on load is
only performed for traces saved by previous versions.
2026-07-25 23:02:13 +02:00
Bartosz Taudul a8d5f12f16 Properly process section categories.
Section selection UI disabled for now.
2026-07-14 19:12:59 +02:00
Bartosz Taudul 3e1de56e15 Add section category to section enter message. 2026-07-14 19:12:59 +02:00
Bartosz Taudul 859709a98a Add client-side section category setup. 2026-07-14 19:12:58 +02:00
Bartosz Taudul 3a6a23ca98 Save and load sections data. 2026-06-21 00:56:32 +02:00
Bartosz Taudul 801a34ea66 Add trigger parameter. 2026-06-17 22:37:31 +02:00
Bartosz Taudul 0cdb6d365e Initial section enter / leave instrumentation. 2026-06-17 22:37:31 +02:00
Bartosz Taudul e3f4c72c85 Move TRACY_ATTRIBUTE_FORMAT_PRINTF to its own header. 2026-06-17 22:37:31 +02:00
Bartosz Taudul 62560a6429 Add 8-bit length string transfers to the protocol. 2026-06-15 20:43:55 +02:00
Bartosz Taudul 33fccb3530 Typos. 2026-06-15 17:08:39 +02:00
Marcos Slomp de2a18d964 initial prototype for WebGPU back-end 2026-06-09 09:06:47 -07:00
Bartosz Taudul 45e90549aa Rewrite TaggedUserlandAddress.
Drop dead code. Move tag to low bits, keep ptr at high bits. Protocol bump,
as TaggedUserlandAddress is used to transmit "literal" messages.
2026-06-04 19:37:47 +02:00
Bartosz Taudul 1690ac0d9d Force inlining of TaggedUserlandAddress. 2026-06-04 12:31:08 +02:00
Bartosz Taudul a8fab8c977 Cosmetics. 2026-06-04 12:30:51 +02:00
Bartosz Taudul a0b50ee68e Tabs to spaces. 2026-06-04 12:27:03 +02:00
Bartosz Taudul a27dae3e88 Enforce same type in MemWrite. 2026-06-04 00:49:02 +02:00
Clément Grégoire 0e52e387bd gate GetUserNameExA behind TRACY_WIN32_NO_DESKTOP
Same as `GetUserNameA` in `GetUserLogin`
2026-05-29 17:51:33 +02:00
Clément Grégoire f93d17a96f Add TRACY_PLATFORM_HEADER hook for unsupported platforms.
Extension point so private/unsupported platforms can plug in their own implementations of the kernel/libc primitives Tracy depends on, without patching the `#if`/`#elif` chains.

Projects supply a platform header via `-DTRACY_PLATFORM_HEADER="\"my_platform.h\""` at build time. Tracy includes it in any TU that needs the hooks. The header toggles per-category `TRACY_HAS_CUSTOM_*` macros and declares matching `tracy::Platform*` functions.

Available hooks:

- `TRACY_HAS_CUSTOM_THREAD_ID` → `PlatformGetThreadId`
- `TRACY_HAS_CUSTOM_USER_INFO` → `PlatformGetHostname`, `PlatformGetUserLogin`, `PlatformGetUserFullName`
- `TRACY_HAS_CUSTOM_SAFE_COPY` → `PlatformSafeMemcpy`
- `TRACY_HAS_CUSTOM_ALLOCATOR` → `PlatformMalloc`, `PlatformFree`, `PlatformRealloc`, `PlatformAllocatorInit`, `PlatformAllocatorThreadInit`, `PlatformAllocatorFinalize`, `PlatformAllocatorThreadFinalize`

Each hook is wired as the first arm of its respective `#if`/`#elif` chain, so existing supported platforms are unaffected.

Template files in `examples/CustomPlatform/` and a new subsection in `manual/tracy.tex` document the mechanism.
2026-05-24 15:42:42 +02:00
Clément Grégoire fd68959223 Rename InitRpmalloc to InitAllocator.
The function is about to dispatch between rpmalloc and a pluggable allocator hook, so the rpmalloc-specific name no longer fits. Pure rename plus a small consequence: the SymbolWorker call site no longer needs the TRACY_USE_RPMALLOC guard, since the no-op static-inline fallback in TracyAlloc.hpp makes InitAllocator() safe to call unconditionally.
2026-05-24 15:04:31 +02:00
Clément Grégoire e7c71c991c Drop sys/param.h dependency for BSD detection
Replace `#ifdef BSD` (which requires including `<sys/param.h>` first) with explicit checks for `__FreeBSD__`, `__NetBSD__`, `__OpenBSD__` and `__DragonFly__`, matching how these BSDs are already enumerated elsewhere in the codebase (OS name strings, thread id helpers, etc.).

This also avoids leaking the `sys/param.h` requirement through public headers (`TracySysTime.hpp`, `TracyCallstack.h`), where consumers would otherwise need it to correctly see `TRACY_HAS_SYSTIME` / `TRACY_HAS_CALLSTACK`.
`libbacktrace/config.h` is left as-is — it's third-party and only included from .c files where the `BSD` macro can still be picked up locally.

Note: for `setsockopt( m_sock, IPPROTO_IPV6, IPV6_V6ONLY, (const char*)&val, sizeof( val ) );` I added `__APPLE__` too since this was the only place where it was not checked explicitely.
2026-05-21 10:18:30 +02:00
Bartosz Taudul 305382453d Add callstack sample events with 32 and 16 bit timestamps. 2026-05-07 02:16:53 +02:00
Bartosz Taudul ccaef5ba0b ZoneBegin / ZoneBeginCallstack with 32 and 16 bit time data. 2026-05-07 02:16:53 +02:00
Bartosz Taudul 4d094c108d Add zone end messages with 32 and 16 byte time deltas.
Change in test application:
    compressed data: 130 Mpbps -> 105 Mbps
    uncompressed: 830 Mbps -> 740 Mbps
2026-05-06 19:09:19 +02:00
Bartosz Taudul 58eaa330af Set TCP_NODELAY on profiler data channel. 2026-05-06 00:12:21 +02:00
Bartosz Taudul e300d56f68 Force resort of possibly broken plots. 2026-03-27 20:16:27 +01:00
Amy e9314add15 clang visibility for TRACY_API (#1310) 2026-03-18 23:59:33 +01:00
DaniPopes d47344187d fix: don't truncate thread names to 15 chars on Apple platforms 2026-02-11 16:25:42 -05:00
Bartosz Taudul 73694c7a24 Cleanup enums. 2026-01-24 01:50:11 +01:00
Kejin d6597b0bdd Check if pw_gecos is non-empty on Android
Ensure pw_gecos is not empty before returning.
2026-01-18 14:01:19 +08:00
Kejin 1cad2903a1 fix a nullptr crash on android devices 2026-01-15 21:54:24 +08:00
Bartosz Taudul 5bc2e4b95c Implement full user name retrieval on win32. 2025-12-30 15:17:08 +01:00
Bartosz Taudul 9016911a04 Fix clash with winapi define crap. 2025-12-30 14:49:23 +01:00
Bartosz Taudul 4661233904 Add missing include for UNLEN definition. 2025-12-30 14:48:17 +01:00
Bartosz Taudul f6ba6cbd4e Fix typo. 2025-12-30 14:48:11 +01:00
Bartosz Taudul 20b9d002dc Check for empty full name. 2025-12-30 14:23:37 +01:00
Bartosz Taudul 299b641173 Implement getting full user name. 2025-12-30 14:16:53 +01:00
Bartosz Taudul da85325686 Move user name retrieval to a common API. 2025-12-30 13:41:19 +01:00
Clément Grégoire 5ef64841cc Remove MessageMetadata type and replace by uint8_t everywhere 2025-12-28 15:04:18 +01:00
Clément Grégoire 2df7c53c26 Keep tracy::Profiler::Message in the stack frames that need to be ignored
This may still appear in saved traces.
2025-12-28 15:04:18 +01:00
Clément Grégoire 4cceab5ad8 Remove Profiler::Messsage since it's not part of the public API
This also replaces `___tracy_emit_message*` by `___tracy_emit_logString`.
The `TracyCMessage*` defines no long include the `;`, which may be a breaking change even though we did already require semi-colon since 0.9.0. See #493 and #592
2025-12-28 15:04:05 +01:00
Clément Grégoire 1e61dc88de Add source and severity to the server's MessageData + bump minor version for serialization
Note this does not change `sizeof(MessageData)` as there were 5 bytes left due to alignment. (now 3)
2025-12-28 14:50:38 +01:00
Clément Grégoire f650b69591 tracy_force_inline for message metadata conversion 2025-12-28 14:44:40 +01:00
Clément Grégoire f981330f66 Replace all messages text addr by TaggedUserlandAddress and send metadata over the network
There are two changes to the protocol:

- `QueueMessageLiteral*` were changed and what used to be addresses are now addresses+metadata
- Other messages now send `QueueMessage*Metadata` with added metadata.

This will later be used to store and transmit message sources, level, etc.
2025-12-28 14:44:40 +01:00
Clément Grégoire 9c57b229ea Introduce tracy::TaggedUserlandAddress to pack metadata with pointers 2025-12-28 14:42:40 +01:00
Bartosz Taudul 05cceee0df Release 0.13.1. 2025-12-11 23:46:02 +01:00
Trevor L. McDonell d1b0406801 Add option to ignore memory free faults
This replaces the IsApple flag, which was previously only used for this purpose.
2025-12-02 16:16:50 +01:00
Bartosz Taudul e6b9ea4609 Release 0.13.0. 2025-11-11 16:31:54 +01: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
Patrik Kraif dacd0fc63f Fix header guard to match the new file name 2025-07-16 12:55:22 +02:00