Commit Graph

727 Commits

Author SHA1 Message Date
Bartosz Taudul
20e6835da6 Fix remaining MemWrites. 2026-06-05 00:00:04 +02:00
Bartosz Taudul
6b92ec1a23 Message queue item is already in the right format.
After swapping ptr and tag in TaggedUserlandAddress, the tag part aligns
exactly with the metadata field.
2026-06-04 20:08:07 +02: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
896a59d00b Simplify. 2026-06-04 12:11:14 +02:00
Bartosz Taudul
d3db50c201 Mingw fixes. 2026-06-04 12:08:53 +02:00
Bartosz Taudul
185482c0d9 MemRead deduces returned type from pointer. 2026-06-04 00:49:02 +02:00
Bartosz Taudul
a27dae3e88 Enforce same type in MemWrite. 2026-06-04 00:49:02 +02:00
Bartosz Taudul
7d139a7bf1 Use proper data types for MemWrite. 2026-06-04 00:49:02 +02:00
Bartosz Taudul
02e279bd38 Unaligned memory reads must go via MemRead. 2026-06-04 00:00:08 +02:00
Marcos Slomp
224ff6d0e8 bumping "down" CUDA version 2026-06-03 11:05:06 -07:00
Marcos Slomp
21b9f50cea CUDA version check 2026-06-01 11:25:40 -07: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
e93ddd2aa7 When using the MSVC C runtime, fileno doesn't actually exist, use _fileno instead.
OLDNAMES.lib may not be linked if you use /NODEFAULTLIB.
Note: This uses `_MSC_VER` as a gate and not _WIN32 as MinGW apparently uses `fileno` and not `_fileno`.
2026-05-29 17:51:30 +02:00
Bartosz Taudul
74eea83051 Merge pull request #1375 from wolfpld/slomp/vulkan-calibration-patch
GPU: Vulkan: upper-bound to the calibration loop
2026-05-28 11:37:00 +02:00
Marcos Slomp
c9fa58f2bb keep preprocessor directives idented to the margin 2026-05-27 16:12:24 -07:00
Marcos Slomp
b7fdc8c0eb newlines 2026-05-27 15:54:03 -07:00
Marcos Slomp
e57c0869df (take care of dead code warning) 2026-05-26 14:49:32 -07:00
Marcos Slomp
4cf754f3fe Calibrate no takes a max sample count 2026-05-26 14:39:12 -07:00
Marcos Slomp
884415264b error check 2026-05-26 07:53:01 -07:00
Marcos Slomp
ea8cbc849f adding an upper-bound to the calibration loop 2026-05-26 07:15:54 -07:00
Bartosz Taudul
ee37bb40f0 Merge pull request #1372 from wolfpld/slomp/nvcc-msvc-fix
NVCC (with MSVC/cl.exe) build fix
2026-05-24 16:29:58 +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
Marcos Slomp
564e0e1e71 removing scope qualifiers 2026-05-23 14:20:06 -07: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
Clément Grégoire
e59601cf1c Fix ProfilerWorker hang when TRACY_HAS_CALLSTACK is not defined 2026-05-20 17:51:42 +02:00
Ryan Mehri
f74a452b89 fix: header definition of start/end sampling profiling 2026-05-17 15:16:45 -04:00
Marcos Slomp
4a58c42e2d Merge pull request #1316 from slomp/slomp/d3d12-ring
GPU: D3D12: remove NewFrame() API + drop unresolved queries when under pressure
2026-05-14 09:16:32 -07:00
Marcos Slomp
af9802e3f2 debugbreak only for msvc 2026-05-14 08:24:54 -07:00
Marcos Slomp
ad9c6f2f18 addressing code review 2026-05-14 08:13:59 -07:00
Bartosz Taudul
5cb283073e Store kernel symbol end address, not size.
The end address is now readily available in lower_bound search, instead
of needing to be calculated constantly in the lambda.

The size can be equivalently calculated from the end address, but this
only happens once, after the symbol is found.
2026-05-10 00:15:18 +02:00
Bartosz Taudul
a6c72f1cc7 Do not repeatedly read from all ring buffers to find minimum time entry. 2026-05-09 20:41:29 +02:00
Bartosz Taudul
95416a4b9c Since active[] order doesn't matter, memmove can be replaced with a swap. 2026-05-09 17:48:57 +02:00
Bartosz Taudul
7de27ebffa Force inline RingBuffer::Read(). 2026-05-09 01:05:33 +02:00
Bartosz Taudul
70535435f2 Use masking instead of calculating remainder.
size is power-of-two (asserted).
2026-05-09 00:58:16 +02:00
Bartosz Taudul
61a6fb6780 Batch ring buffer reads. 2026-05-09 00:50:50 +02:00
Marcos Slomp
d5bce07a90 oopsie 2026-05-08 15:33:12 -07:00
Marcos Slomp
027a37409b addressing code review comments 2026-05-08 14:30:24 -07: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
8c2a970222 Merge pull request #1352 from wolfpld/slomp/apple-systrace
System tracing (callstack sampling) for Apple devices
2026-05-05 19:05:41 +02:00
Marcos Slomp
6a214ed419 refactoring globals 2026-05-05 08:28:15 -07:00
Marcos Slomp
df20e8ad84 refactoring 2026-05-05 08:05:56 -07:00
Marcos Slomp
761d50e8f5 debug cleanup 2026-05-05 07:49:15 -07:00
Clément Grégoire
2997a78872 Fix #1243 compatibility with WinSDK < 10.0.26100
After investigating (downloading and installing) all publicly available SDKs at https://learn.microsoft.com/en-us/windows/apps/windows-sdk/downloads-archive I concluded the `TRACEHANDLE` deprecation started in `10.0.26100`.
This defines `PROCESSTRACE_HANDLE` and `CONTROLTRACE_ID` as done by the SDK when using older versions. Using `WDK_NTDDI_VERSION` (and not `NTDDI_VERSION` which may change based on `_WIN32_WINNT` or user input seems to be the most reliable way to do it. While it says "WDK" it's been part of the SDK in `shared\sdkddkver.h`. Note it doesn't work for MinGW because it updates half of its sdk files for some reason.
Tested with both 10.0.26100 and 10.0.22621.0 which is the last one I found without the new types.
Also changes CONTROLTRACE_ID to ULONG64 on mingw which is correct (type used by `TRACEHANDLE` too in mingw fe2763863a/mingw-w64-headers/include/evntrace.h (L60) )
2026-05-05 16:14:21 +02:00