diff options
Diffstat (limited to 'tools/perf/util/bpf-loader.h')
-rw-r--r-- | tools/perf/util/bpf-loader.h | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/tools/perf/util/bpf-loader.h b/tools/perf/util/bpf-loader.h index 5d3aefd6fae7..62d245a90e1d 100644 --- a/tools/perf/util/bpf-loader.h +++ b/tools/perf/util/bpf-loader.h | |||
@@ -43,6 +43,7 @@ enum bpf_loader_errno { | |||
43 | __BPF_LOADER_ERRNO__END, | 43 | __BPF_LOADER_ERRNO__END, |
44 | }; | 44 | }; |
45 | 45 | ||
46 | struct perf_evsel; | ||
46 | struct bpf_object; | 47 | struct bpf_object; |
47 | struct parse_events_term; | 48 | struct parse_events_term; |
48 | #define PERF_BPF_PROBE_GROUP "perf_bpf_probe" | 49 | #define PERF_BPF_PROBE_GROUP "perf_bpf_probe" |
@@ -82,9 +83,8 @@ int bpf__apply_obj_config(void); | |||
82 | int bpf__strerror_apply_obj_config(int err, char *buf, size_t size); | 83 | int bpf__strerror_apply_obj_config(int err, char *buf, size_t size); |
83 | 84 | ||
84 | int bpf__setup_stdout(struct perf_evlist *evlist); | 85 | int bpf__setup_stdout(struct perf_evlist *evlist); |
85 | int bpf__strerror_setup_stdout(struct perf_evlist *evlist, int err, | 86 | struct perf_evsel *bpf__setup_output_event(struct perf_evlist *evlist, const char *name); |
86 | char *buf, size_t size); | 87 | int bpf__strerror_setup_output_event(struct perf_evlist *evlist, int err, char *buf, size_t size); |
87 | |||
88 | #else | 88 | #else |
89 | #include <errno.h> | 89 | #include <errno.h> |
90 | 90 | ||
@@ -138,6 +138,12 @@ bpf__setup_stdout(struct perf_evlist *evlist __maybe_unused) | |||
138 | return 0; | 138 | return 0; |
139 | } | 139 | } |
140 | 140 | ||
141 | static inline struct perf_evsel * | ||
142 | bpf__setup_output_event(struct perf_evlist *evlist __maybe_unused, const char *name __maybe_unused) | ||
143 | { | ||
144 | return NULL; | ||
145 | } | ||
146 | |||
141 | static inline int | 147 | static inline int |
142 | __bpf_strerror(char *buf, size_t size) | 148 | __bpf_strerror(char *buf, size_t size) |
143 | { | 149 | { |
@@ -193,11 +199,16 @@ bpf__strerror_apply_obj_config(int err __maybe_unused, | |||
193 | } | 199 | } |
194 | 200 | ||
195 | static inline int | 201 | static inline int |
196 | bpf__strerror_setup_stdout(struct perf_evlist *evlist __maybe_unused, | 202 | bpf__strerror_setup_output_event(struct perf_evlist *evlist __maybe_unused, |
197 | int err __maybe_unused, char *buf, | 203 | int err __maybe_unused, char *buf, size_t size) |
198 | size_t size) | ||
199 | { | 204 | { |
200 | return __bpf_strerror(buf, size); | 205 | return __bpf_strerror(buf, size); |
201 | } | 206 | } |
207 | |||
202 | #endif | 208 | #endif |
209 | |||
210 | static inline int bpf__strerror_setup_stdout(struct perf_evlist *evlist, int err, char *buf, size_t size) | ||
211 | { | ||
212 | return bpf__strerror_setup_output_event(evlist, err, buf, size); | ||
213 | } | ||
203 | #endif | 214 | #endif |