Commit Graph

25 Commits

Author SHA1 Message Date
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
DaniPopes
d47344187d fix: don't truncate thread names to 15 chars on Apple platforms 2026-02-11 16:25:42 -05: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
Patrik Kraif
4a3713cca8 Add support for GDK 2025-07-16 12:51:16 +02:00
Thomas Klausner
7272f9cac1 Use correct header on NetBSD. 2025-01-20 14:10:34 +01:00
Bartosz Taudul
beb42a3d29 Change group hint from unsigned to signed. 2024-08-03 19:40:11 +02:00
Bartosz Taudul
5e224101c4 Allow direct access to ThreadNameData. 2024-08-03 19:33:19 +02:00
Bartosz Taudul
3658c0c90f Add thread group hint to ThreadNameData. 2024-08-03 19:15:01 +02:00
Razakhel
cef21ef035 Added preprocessor checks for Clang on Windows
- MSVC-specific code is used in some places and compiled only if _MSC_VER is set; however, Clang under Windows also defines this, which reports errors on this non-standard code if the -pedantic-errors compiler flag is set
2024-02-21 22:54:44 +01:00
Michael Leslie
daba5ae1d8 add qnx support for instrumentation profiling only 2023-10-24 17:40:13 -07:00
Bartosz Taudul
73da891805 Remove std:: qualifier from size_t. 2023-09-11 11:33:40 +02:00
xyz1001
30fb2b5f89 Fix two bugs (#615)
* Fix wrong check for wcstombs return value
* Fix memory leak when call GetThreadDescription
2023-09-08 14:02:55 +02:00
ReplayCoding
9da24b713c Always fallback to using native thread name...
...even when TRACY_ENABLE is defined.
2022-11-29 12:02:42 -08:00
Daniel
dc74b8adfd Using push/pop in all pragma pack pair to avoid potential padding bugs 2022-08-03 18:39:42 +08:00
Bartosz Taudul
fca8a7707d Don't fail compilation on emscripten. 2022-07-19 15:49:29 +02:00
Bartosz Taudul
06c7984a16 Move all client headers and sources to public/ directory. 2022-07-17 15:47:38 +02:00