1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef PERF_UTIL_BPF_FILTER_H
3 #define PERF_UTIL_BPF_FILTER_H
5 #include <linux/list.h>
7 #include "bpf_skel/sample-filter.h"
9 struct perf_bpf_filter_expr {
10 struct list_head list;
11 enum perf_bpf_filter_op op;
12 unsigned long sample_flags;
19 struct perf_bpf_filter_expr *perf_bpf_filter_expr__new(unsigned long sample_flags,
20 enum perf_bpf_filter_op op,
22 int perf_bpf_filter__parse(struct list_head *expr_head, const char *str);
23 int perf_bpf_filter__prepare(struct evsel *evsel);
24 int perf_bpf_filter__destroy(struct evsel *evsel);
26 #else /* !HAVE_BPF_SKEL */
28 static inline int perf_bpf_filter__parse(struct list_head *expr_head __maybe_unused,
29 const char *str __maybe_unused)
33 static inline int perf_bpf_filter__prepare(struct evsel *evsel __maybe_unused)
37 static inline int perf_bpf_filter__destroy(struct evsel *evsel __maybe_unused)
41 #endif /* HAVE_BPF_SKEL*/
42 #endif /* PERF_UTIL_BPF_FILTER_H */