Tracer: query tid only when threading is enabled

This commit is contained in:
Carter Li
2026-07-03 15:36:41 +08:00
parent 225d9e7771
commit 52c9730542
+6 -2
View File
@@ -122,10 +122,14 @@ __attribute__((no_instrument_function)) static void write_event(void* this_fn, b
}
events[idx].ts = get_time_us();
#if _WIN32
#if ENABLE_THREADS
#if _WIN32
events[idx].tid = (uint64_t) GetCurrentThreadId();
#else
#else
events[idx].tid = (uint64_t) (uintptr_t) pthread_self();
#endif
#else
events[idx].tid = 0;
#endif
events[idx].func = this_fn;
if (is_exit) {