Skip to content

Commit 3b573bf

Browse files
committed
perf bpf: Remove bpf/ subdir from bpf.h headers used to build bpf events
The bpf.h file needed gets installed in /usr/lib/include/perf/bpf/bpf.h, and /usr/lib/include/perf/ is added to the include path passed to clang to build the eBPF bytecode, so just remove "bpf/", its directly in the path passed already. This was working by accident, fix it. I.e. now this is back working: # cat /home/acme/git/perf/tools/perf/examples/bpf/hello.c #include <stdio.h> int syscall_enter(openat)(void *args) { puts("Hello, world\n"); return 0; } license(GPL); # perf trace -e /home/acme/git/perf/tools/perf/examples/bpf/hello.c 0.000 pickup/21493 __bpf_stdout__(Hello, world) 56.462 sh/13539 __bpf_stdout__(Hello, world) 56.536 sh/13539 __bpf_stdout__(Hello, world) 56.673 sh/13539 __bpf_stdout__(Hello, world) 56.781 sh/13539 __bpf_stdout__(Hello, world) 56.707 perf/13182 __bpf_stdout__(Hello, world) 56.849 perf/13182 __bpf_stdout__(Hello, world) ^C # Cc: Adrian Hunter <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Link: https://lkml.kernel.org/n/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent b1da3ac commit 3b573bf

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

tools/perf/include/bpf/pid_filter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#ifndef _PERF_BPF_PID_FILTER_
44
#define _PERF_BPF_PID_FILTER_
55

6-
#include <bpf/bpf.h>
6+
#include <bpf.h>
77

88
#define pid_filter(name) pid_map(name, bool)
99

tools/perf/include/bpf/stdio.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0
22

3-
#include <bpf/bpf.h>
3+
#include <bpf.h>
44

55
struct bpf_map SEC("maps") __bpf_stdout__ = {
66
.type = BPF_MAP_TYPE_PERF_EVENT_ARRAY,

tools/perf/include/bpf/unistd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: LGPL-2.1
22

3-
#include <bpf/bpf.h>
3+
#include <bpf.h>
44

55
static int (*bpf_get_current_pid_tgid)(void) = (void *)BPF_FUNC_get_current_pid_tgid;
66

0 commit comments

Comments
 (0)