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 struct list_head groups;
12 enum perf_bpf_filter_op op;
14 unsigned long sample_flags;
21 struct perf_bpf_filter_expr *perf_bpf_filter_expr__new(unsigned long sample_flags, int part,
22 enum perf_bpf_filter_op op,
24 int perf_bpf_filter__parse(struct list_head *expr_head, const char *str);
25 int perf_bpf_filter__prepare(struct evsel *evsel);
26 int perf_bpf_filter__destroy(struct evsel *evsel);
27 u64 perf_bpf_filter__lost_count(struct evsel *evsel);
29 #else /* !HAVE_BPF_SKEL */
31 static inline int perf_bpf_filter__parse(struct list_head *expr_head __maybe_unused,
32 const char *str __maybe_unused)
36 static inline int perf_bpf_filter__prepare(struct evsel *evsel __maybe_unused)
40 static inline int perf_bpf_filter__destroy(struct evsel *evsel __maybe_unused)
44 static inline u64 perf_bpf_filter__lost_count(struct evsel *evsel __maybe_unused)
48 #endif /* HAVE_BPF_SKEL*/
49 #endif /* PERF_UTIL_BPF_FILTER_H */