summaryrefslogtreecommitdiffstats
path: root/tools/perf/include/bpf/unistd.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tools/perf/include/bpf/unistd.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/perf/include/bpf/unistd.h b/tools/perf/include/bpf/unistd.h
new file mode 100644
index 000000000..ca7877f9a
--- /dev/null
+++ b/tools/perf/include/bpf/unistd.h
@@ -0,0 +1,10 @@
+// SPDX-License-Identifier: LGPL-2.1
+
+#include <bpf.h>
+
+static int (*bpf_get_current_pid_tgid)(void) = (void *)BPF_FUNC_get_current_pid_tgid;
+
+static pid_t getpid(void)
+{
+ return bpf_get_current_pid_tgid();
+}