[PATCH 2/3] perf jvmti: use gettid from libc_compat
From: Riccardo Mancini
Date: Thu Jul 22 2021 - 11:34:29 EST
This patch removes the re-definition of gettid in jvmti_agent.c, adding
the include of the libc_compat.h header, which now contains the gettid
function.
Signed-off-by: Riccardo Mancini <rickyman7@xxxxxxxxx>
---
tools/perf/jvmti/jvmti_agent.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/tools/perf/jvmti/jvmti_agent.c b/tools/perf/jvmti/jvmti_agent.c
index 526dcaf9f07903dd..299e7e87198cc18d 100644
--- a/tools/perf/jvmti/jvmti_agent.c
+++ b/tools/perf/jvmti/jvmti_agent.c
@@ -33,7 +33,7 @@
#include <unistd.h>
#include <time.h>
#include <sys/mman.h>
-#include <syscall.h> /* for gettid() */
+#include <tools/libc_compat.h> /* for gettid() */
#include <err.h>
#include <linux/kernel.h>
@@ -45,13 +45,6 @@
static char jit_path[PATH_MAX];
static void *marker_addr;
-#ifndef HAVE_GETTID
-static inline pid_t gettid(void)
-{
- return (pid_t)syscall(__NR_gettid);
-}
-#endif
-
static int get_e_machine(struct jitheader *hdr)
{
ssize_t sret;
--
2.31.1