mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-08-16 17:48:47 +00:00

Utilize bpf_modify_return_test_tp() kfunc to have a fast way to trigger tp/raw_tp/fmodret programs from another BPF program, which gives us comparable batched benchmarks to (batched) kprobe/fentry benchmarks. We don't switch kprobe/fentry batched benchmarks to this kfunc to make bench tool usable on older kernels as well. Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/r/20240326162151.3981687-7-andrii@kernel.org Signed-off-by: Alexei Starovoitov <ast@kernel.org>
24 lines
438 B
Bash
Executable File
24 lines
438 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -eufo pipefail
|
|
|
|
def_tests=( \
|
|
usermode-count kernel-count syscall-count \
|
|
fentry fexit fmodret \
|
|
rawtp tp \
|
|
kprobe kprobe-multi \
|
|
kretprobe kretprobe-multi \
|
|
)
|
|
|
|
tests=("$@")
|
|
if [ ${#tests[@]} -eq 0 ]; then
|
|
tests=("${def_tests[@]}")
|
|
fi
|
|
|
|
p=${PROD_CNT:-1}
|
|
|
|
for t in "${tests[@]}"; do
|
|
summary=$(sudo ./bench -w2 -d5 -a -p$p trig-$t | tail -n1 | cut -d'(' -f1 | cut -d' ' -f3-)
|
|
printf "%-15s: %s\n" $t "$summary"
|
|
done
|