tools/perf/util/bpf_counter.h
Source file repositories/reference/linux-study-clean/tools/perf/util/bpf_counter.h
File Facts
- System
- Linux kernel
- Corpus path
tools/perf/util/bpf_counter.h- Extension
.h- Size
- 1880 bytes
- Lines
- 76
- 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/err.h
Detected Declarations
struct evselstruct targetstruct bpf_counter_opsfunction bpf_counter__loadfunction bpf_counter__enablefunction bpf_counter__disablefunction bpf_counter__readfunction bpf_counter__destroy
Annotated Snippet
struct bpf_counter_ops {
bpf_counter_evsel_target_op load;
bpf_counter_evsel_op enable;
bpf_counter_evsel_op disable;
bpf_counter_evsel_op read;
bpf_counter_evsel_op destroy;
bpf_counter_evsel_install_pe_op install_pe;
};
int bpf_counter__load(struct evsel *evsel, struct target *target);
int bpf_counter__enable(struct evsel *evsel);
int bpf_counter__disable(struct evsel *evsel);
int bpf_counter__read(struct evsel *evsel);
void bpf_counter__destroy(struct evsel *evsel);
int bpf_counter__install_pe(struct evsel *evsel, int cpu_map_idx, int fd);
int bperf_trigger_reading(int prog_fd, int cpu);
void set_max_rlimit(void);
#else /* HAVE_BPF_SKEL */
#include <linux/err.h>
static inline int bpf_counter__load(struct evsel *evsel __maybe_unused,
struct target *target __maybe_unused)
{
return 0;
}
static inline int bpf_counter__enable(struct evsel *evsel __maybe_unused)
{
return 0;
}
static inline int bpf_counter__disable(struct evsel *evsel __maybe_unused)
{
return 0;
}
static inline int bpf_counter__read(struct evsel *evsel __maybe_unused)
{
return -EAGAIN;
}
static inline void bpf_counter__destroy(struct evsel *evsel __maybe_unused)
{
}
static inline int bpf_counter__install_pe(struct evsel *evsel __maybe_unused,
int cpu __maybe_unused,
int fd __maybe_unused)
{
return 0;
}
#endif /* HAVE_BPF_SKEL */
#endif /* __PERF_BPF_COUNTER_H */
Annotation
- Immediate include surface: `linux/err.h`.
- Detected declarations: `struct evsel`, `struct target`, `struct bpf_counter_ops`, `function bpf_counter__load`, `function bpf_counter__enable`, `function bpf_counter__disable`, `function bpf_counter__read`, `function bpf_counter__destroy`.
- 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.