xref: /linux/tools/testing/selftests/bpf/benchs/run_bench_trigger.sh (revision 3124591f686115aca25d772c2ccb7b1e202c3197)
1#!/bin/bash
2
3set -eufo pipefail
4
5def_tests=( \
6	usermode-count kernel-count syscall-count \
7	fentry fexit \
8	kprobe kprobe-multi \
9	kretprobe kretprobe-multi \
10)
11
12tests=("$@")
13if [ ${#tests[@]} -eq 0 ]; then
14	tests=("${def_tests[@]}")
15fi
16
17p=${PROD_CNT:-1}
18
19for t in "${tests[@]}"; do
20	summary=$(sudo ./bench -w2 -d5 -a -p$p trig-$t | tail -n1 | cut -d'(' -f1 | cut -d' ' -f3-)
21	printf "%-15s: %s\n" $t "$summary"
22done
23