$OpenBSD: patch-third_party_perfetto_include_perfetto_base_thread_utils_h,v 1.5 2021/10/29 14:49:42 robert Exp $

Index: third_party/perfetto/include/perfetto/base/thread_utils.h
--- third_party/perfetto/include/perfetto/base/thread_utils.h.orig
+++ third_party/perfetto/include/perfetto/base/thread_utils.h
@@ -32,6 +32,7 @@
 #include <sys/syscall.h>
 #include <sys/types.h>
 #include <unistd.h>
+#include <pthread.h>
 #else
 #include <pthread.h>
 #endif
@@ -43,6 +44,11 @@ namespace base {
 using PlatformThreadId = pid_t;
 inline PlatformThreadId GetThreadId() {
   return gettid();
+}
+#elif PERFETTO_BUILDFLAG(PERFETTO_OS_OPENBSD)
+using PlatformThreadId = pid_t;
+inline PlatformThreadId GetThreadId() {
+  return reinterpret_cast<int64_t>(pthread_self());
 }
 #elif PERFETTO_BUILDFLAG(PERFETTO_OS_LINUX)
 using PlatformThreadId = pid_t;
