]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-118518: Use the raw syscall directly for gettid (#118592)
authorPablo Galindo Salgado <Pablogsal@gmail.com>
Sun, 5 May 2024 12:37:32 +0000 (14:37 +0200)
committerGitHub <noreply@github.com>
Sun, 5 May 2024 12:37:32 +0000 (12:37 +0000)
Python/perf_jit_trampoline.c

index fdce0da3eded720f28364a292b0800a16231e20d..23478c6d469c2b3c95ca9c375b95fd92d43ac2da 100644 (file)
@@ -13,6 +13,7 @@
 #include <sys/types.h>
 #include <unistd.h>               // sysconf()
 #include <sys/time.h>           // gettimeofday()
+#include <sys/syscall.h>
 
 // ----------------------------------
 //         Perf jitdump API
@@ -575,7 +576,7 @@ static void perf_map_jit_write_entry(void *state, const void *code_addr,
     ev.base.size = sizeof(ev) + (name_length+1) + size;
     ev.base.time_stamp = get_current_monotonic_ticks();
     ev.process_id = getpid();
-    ev.thread_id = gettid();
+    ev.thread_id = syscall(SYS_gettid);
     ev.vma = base;
     ev.code_address = base;
     ev.code_size = size;