Skip to content

Commit 61d0071

Browse files
committed
perf bpf: Move perf_event_output() from stdio.h to bpf.h
So that we don't always carry that __bpf_output__ map, leaving that to the scripts wanting to use that facility. 'perf trace' will be changed to look if that map is present and only setup the bpf-output events if so. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: https://lkml.kernel.org/n/tip-azwys8irxqx9053vpajr0k5h@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent b27b38e commit 61d0071

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

‎tools/perf/include/bpf/bpf.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,6 @@ int _version SEC("version") = LINUX_VERSION_CODE;
5555
static int (*probe_read)(void *dst, int size, const void *unsafe_addr) = (void *)BPF_FUNC_probe_read;
5656
static int (*probe_read_str)(void *dst, int size, const void *unsafe_addr) = (void *)BPF_FUNC_probe_read_str;
5757

58+
static int (*perf_event_output)(void *, struct bpf_map *, int, void *, unsigned long) = (void *)BPF_FUNC_perf_event_output;
59+
5860
#endif /* _PERF_BPF_H */

‎tools/perf/include/bpf/stdio.h‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ struct bpf_map SEC("maps") __bpf_stdout__ = {
99
.max_entries = __NR_CPUS__,
1010
};
1111

12-
static int (*perf_event_output)(void *, struct bpf_map *, int, void *, unsigned long) =
13-
(void *)BPF_FUNC_perf_event_output;
14-
1512
#define puts(from) \
1613
({ const int __len = sizeof(from); \
1714
char __from[__len] = from; \

0 commit comments

Comments
 (0)