tools/perf/util/bpf-filter.h
Source file repositories/reference/linux-study-clean/tools/perf/util/bpf-filter.h
File Facts
- System
- Linux kernel
- Corpus path
tools/perf/util/bpf-filter.h- Extension
.h- Size
- 1914 bytes
- Lines
- 71
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/list.hbpf_skel/sample-filter.hutil/debug.herrno.h
Detected Declarations
struct perf_bpf_filter_exprstruct evselstruct targetfunction perf_bpf_filter__parsefunction perf_bpf_filter__preparefunction perf_bpf_filter__destroyfunction perf_bpf_filter__lost_countfunction perf_bpf_filter__pinfunction perf_bpf_filter__unpin
Annotated Snippet
struct perf_bpf_filter_expr {
struct list_head list;
struct list_head groups;
enum perf_bpf_filter_op op;
int part;
enum perf_bpf_filter_term term;
unsigned long val;
};
struct evsel;
struct target;
/* path in BPF-fs for the pinned program and maps */
#define PERF_BPF_FILTER_PIN_PATH "perf_filter"
#ifdef HAVE_BPF_SKEL
struct perf_bpf_filter_expr *perf_bpf_filter_expr__new(enum perf_bpf_filter_term term,
int part,
enum perf_bpf_filter_op op,
unsigned long val);
int perf_bpf_filter__parse(struct list_head *expr_head, const char *str);
int perf_bpf_filter__prepare(struct evsel *evsel, struct target *target);
int perf_bpf_filter__destroy(struct evsel *evsel);
u64 perf_bpf_filter__lost_count(struct evsel *evsel);
int perf_bpf_filter__pin(void);
int perf_bpf_filter__unpin(void);
#else /* !HAVE_BPF_SKEL */
#include <errno.h>
static inline int perf_bpf_filter__parse(struct list_head *expr_head __maybe_unused,
const char *str __maybe_unused)
{
pr_err("Error: BPF filter is requested but perf is not built with BPF.\n"
"\tPlease make sure to build with libbpf and BPF skeleton.\n");
return -EOPNOTSUPP;
}
static inline int perf_bpf_filter__prepare(struct evsel *evsel __maybe_unused,
struct target *target __maybe_unused)
{
return -EOPNOTSUPP;
}
static inline int perf_bpf_filter__destroy(struct evsel *evsel __maybe_unused)
{
return -EOPNOTSUPP;
}
static inline u64 perf_bpf_filter__lost_count(struct evsel *evsel __maybe_unused)
{
return 0;
}
static inline int perf_bpf_filter__pin(void)
{
return -EOPNOTSUPP;
}
static inline int perf_bpf_filter__unpin(void)
{
return -EOPNOTSUPP;
}
#endif /* HAVE_BPF_SKEL*/
#endif /* PERF_UTIL_BPF_FILTER_H */
Annotation
- Immediate include surface: `linux/list.h`, `bpf_skel/sample-filter.h`, `util/debug.h`, `errno.h`.
- Detected declarations: `struct perf_bpf_filter_expr`, `struct evsel`, `struct target`, `function perf_bpf_filter__parse`, `function perf_bpf_filter__prepare`, `function perf_bpf_filter__destroy`, `function perf_bpf_filter__lost_count`, `function perf_bpf_filter__pin`, `function perf_bpf_filter__unpin`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.