Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+2 -3
+2
tools/perf/include/bpf/bpf.h
··· 55 55 static int (*probe_read)(void *dst, int size, const void *unsafe_addr) = (void *)BPF_FUNC_probe_read; 56 56 static int (*probe_read_str)(void *dst, int size, const void *unsafe_addr) = (void *)BPF_FUNC_probe_read_str; 57 57 58 + static int (*perf_event_output)(void *, struct bpf_map *, int, void *, unsigned long) = (void *)BPF_FUNC_perf_event_output; 59 + 58 60 #endif /* _PERF_BPF_H */
-3
tools/perf/include/bpf/stdio.h
··· 9 9 .max_entries = __NR_CPUS__, 10 10 }; 11 11 12 - static int (*perf_event_output)(void *, struct bpf_map *, int, void *, unsigned long) = 13 - (void *)BPF_FUNC_perf_event_output; 14 - 15 12 #define puts(from) \ 16 13 ({ const int __len = sizeof(from); \ 17 14 char __from[__len] = from; \