]> git.ipfire.org Git - thirdparty/kernel/linux.git/blob - tools/perf/util/bpf-event.h
perf bpf: Save bpf_prog_info in a rbtree in perf_env
[thirdparty/kernel/linux.git] / tools / perf / util / bpf-event.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __PERF_BPF_EVENT_H
3 #define __PERF_BPF_EVENT_H
4
5 #include <linux/compiler.h>
6 #include <linux/rbtree.h>
7 #include "event.h"
8
9 struct machine;
10 union perf_event;
11 struct perf_sample;
12 struct record_opts;
13
14 struct bpf_prog_info_node {
15 struct bpf_prog_info_linear *info_linear;
16 struct rb_node rb_node;
17 };
18
19 #ifdef HAVE_LIBBPF_SUPPORT
20 int machine__process_bpf_event(struct machine *machine, union perf_event *event,
21 struct perf_sample *sample);
22
23 int perf_event__synthesize_bpf_events(struct perf_session *session,
24 perf_event__handler_t process,
25 struct machine *machine,
26 struct record_opts *opts);
27 #else
28 static inline int machine__process_bpf_event(struct machine *machine __maybe_unused,
29 union perf_event *event __maybe_unused,
30 struct perf_sample *sample __maybe_unused)
31 {
32 return 0;
33 }
34
35 static inline int perf_event__synthesize_bpf_events(struct perf_session *session __maybe_unused,
36 perf_event__handler_t process __maybe_unused,
37 struct machine *machine __maybe_unused,
38 struct record_opts *opts __maybe_unused)
39 {
40 return 0;
41 }
42 #endif // HAVE_LIBBPF_SUPPORT
43 #endif