summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPuranjay Mohan <puranjay@kernel.org>2026-04-28 02:22:59 +0300
committerAlexei Starovoitov <ast@kernel.org>2026-05-12 01:25:24 +0300
commit08158c111d7d87d88269d9f873a2fc54b87bcb99 (patch)
treeb3e82a50caa68ce6b5f0fcf7ab96a4a191a2da11 /include
parent2b6f0a1e4c9e0f618179c4a108249cc4a0442d11 (diff)
downloadlinux-08158c111d7d87d88269d9f873a2fc54b87bcb99.tar.xz
selftests/bpf: Add BPF batch-timing library
Add a reusable timing library for BPF benchmarks that need to measure BPF program execution time. The BPF side (progs/bench_bpf_timing.bpf.h) provides per-CPU sample arrays and BENCH_BPF_LOOP(), a macro that brackets batch_iters iterations with bpf_ktime_get_ns() reads and records the elapsed time. One extra untimed iteration runs afterward for output validation. The userspace side (benchs/bench_bpf_timing.c) collects samples from the skeleton BSS, computes percentile statistics, and auto-calibrates batch_iters to target ~10 ms per batch. Signed-off-by: Puranjay Mohan <puranjay@kernel.org> Link: https://lore.kernel.org/r/20260427232313.1582588-3-puranjay@kernel.org Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions