--- third_party/perfetto/perfetto/perfetto.h.orig 2025-07-15 17:16:00 UTC +++ third_party/perfetto/perfetto/perfetto.h @@ -34,6 +34,8 @@ * limitations under the License. */ +#include + // Generated by write_buildflag_header.py // fix_include_guards: off @@ -129,10 +131,10 @@ #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_MAC() 1 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_IOS() 0 #endif -#elif defined(__linux__) +#elif defined(__linux__) || defined(__FreeBSD__) #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_ANDROID() 0 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_LINUX() 1 -#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_LINUX_BUT_NOT_QNX() 1 +#define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_LINUX_BUT_NOT_QNX() 0 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_WIN() 0 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_APPLE() 0 #define PERFETTO_BUILDFLAG_DEFINE_PERFETTO_OS_MAC() 0 @@ -1075,7 +1077,7 @@ inline TimeNanos GetWallTimeRawNs() { } inline TimeNanos GetWallTimeRawNs() { - return GetTimeInternalNs(CLOCK_MONOTONIC_RAW); + return GetTimeInternalNs(CLOCK_MONOTONIC); } inline TimeNanos GetThreadCPUTimeNs() { @@ -8167,7 +8169,7 @@ inline PlatformThreadId GetThreadId() { #elif PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX) using PlatformThreadId = pid_t; inline PlatformThreadId GetThreadId() { - return static_cast(syscall(__NR_gettid)); + return static_cast(pthread_getthreadid_np()); } #elif PERFETTO_BUILDFLAG(PERFETTO_OS_FUCHSIA) using PlatformThreadId = zx_koid_t;