xref: /openbmc/linux/tools/perf/util/bpf-event.h (revision 89e33ea7)
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 "event.h"
7 
8 struct machine;
9 union perf_event;
10 struct perf_sample;
11 struct perf_tool;
12 struct record_opts;
13 
14 #ifdef HAVE_LIBBPF_SUPPORT
15 int machine__process_bpf_event(struct machine *machine, union perf_event *event,
16 			       struct perf_sample *sample);
17 
18 int perf_event__synthesize_bpf_events(struct perf_tool *tool,
19 				      perf_event__handler_t process,
20 				      struct machine *machine,
21 				      struct record_opts *opts);
22 #else
23 static inline int machine__process_bpf_event(struct machine *machine __maybe_unused,
24 					     union perf_event *event __maybe_unused,
25 					     struct perf_sample *sample __maybe_unused)
26 {
27 	return 0;
28 }
29 
30 static inline int perf_event__synthesize_bpf_events(struct perf_tool *tool __maybe_unused,
31 						    perf_event__handler_t process __maybe_unused,
32 						    struct machine *machine __maybe_unused,
33 						    struct record_opts *opts __maybe_unused)
34 {
35 	return 0;
36 }
37 #endif // HAVE_LIBBPF_SUPPORT
38 #endif
39