tools/testing/selftests/bpf/bench_bpf_timing.h
Source file repositories/reference/linux-study-clean/tools/testing/selftests/bpf/bench_bpf_timing.h
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/bpf/bench_bpf_timing.h- Extension
.h- Size
- 1553 bytes
- Lines
- 51
- 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
stdbool.hlinux/types.hbench.h
Detected Declarations
struct bpf_bench_timing
Annotated Snippet
struct bpf_bench_timing {
__u64 (*samples)[BENCH_NR_SAMPLES]; /* skel->bss->timing_samples */
__u32 *idx; /* skel->bss->timing_idx */
volatile __u32 *timing_enabled; /* &skel->bss->timing_enabled */
volatile __u32 *batch_iters_bss; /* &skel->bss->batch_iters */
__u32 batch_iters;
__u32 target_samples;
__u32 nr_cpus;
int warmup_ticks;
bool done;
bool machine_readable;
};
#define BENCH_TIMING_INIT(t, skel, iters) do { \
(t)->samples = (skel)->bss->timing_samples; \
(t)->idx = (skel)->bss->timing_idx; \
(t)->timing_enabled = &(skel)->bss->timing_enabled; \
(t)->batch_iters_bss = &(skel)->bss->batch_iters; \
(t)->batch_iters = (iters); \
(t)->target_samples = 200; \
(t)->nr_cpus = env.nr_cpus; \
(t)->warmup_ticks = 0; \
(t)->done = false; \
(t)->machine_readable = false; \
} while (0)
void bpf_bench_timing_measure(struct bpf_bench_timing *t, struct bench_res *res);
void bpf_bench_timing_report(struct bpf_bench_timing *t, const char *name, const char *desc);
void bpf_bench_calibrate(struct bpf_bench_timing *t, bpf_bench_run_fn run_fn, void *ctx);
#endif /* __BENCH_BPF_TIMING_H__ */
Annotation
- Immediate include surface: `stdbool.h`, `linux/types.h`, `bench.h`.
- Detected declarations: `struct bpf_bench_timing`.
- 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.