Path: blob/master/tools/testing/selftests/bpf/benchs/run_bench_ringbufs.sh
29270 views
#!/bin/bash12source ./benchs/run_common.sh34set -eufo pipefail56RUN_RB_BENCH="$RUN_BENCH -c1"78header "Single-producer, parallel producer"9for b in rb-libbpf rb-custom pb-libbpf pb-custom; do10summarize $b "$($RUN_RB_BENCH $b)"11done1213header "Single-producer, parallel producer, sampled notification"14for b in rb-libbpf rb-custom pb-libbpf pb-custom; do15summarize $b "$($RUN_RB_BENCH --rb-sampled $b)"16done1718header "Single-producer, back-to-back mode"19for b in rb-libbpf rb-custom pb-libbpf pb-custom; do20summarize $b "$($RUN_RB_BENCH --rb-b2b $b)"21summarize $b-sampled "$($RUN_RB_BENCH --rb-sampled --rb-b2b $b)"22done2324header "Ringbuf back-to-back, effect of sample rate"25for b in 1 5 10 25 50 100 250 500 1000 2000 3000; do26summarize "rb-sampled-$b" "$($RUN_RB_BENCH --rb-b2b --rb-batch-cnt $b --rb-sampled --rb-sample-rate $b rb-custom)"27done28header "Perfbuf back-to-back, effect of sample rate"29for b in 1 5 10 25 50 100 250 500 1000 2000 3000; do30summarize "pb-sampled-$b" "$($RUN_RB_BENCH --rb-b2b --rb-batch-cnt $b --rb-sampled --rb-sample-rate $b pb-custom)"31done3233header "Ringbuf back-to-back, reserve+commit vs output"34summarize "reserve" "$($RUN_RB_BENCH --rb-b2b rb-custom)"35summarize "output" "$($RUN_RB_BENCH --rb-b2b --rb-use-output rb-custom)"3637header "Ringbuf sampled, reserve+commit vs output"38summarize "reserve-sampled" "$($RUN_RB_BENCH --rb-sampled rb-custom)"39summarize "output-sampled" "$($RUN_RB_BENCH --rb-sampled --rb-use-output rb-custom)"4041header "Single-producer, consumer/producer competing on the same CPU, low batch count"42for b in rb-libbpf rb-custom pb-libbpf pb-custom; do43summarize $b "$($RUN_RB_BENCH --rb-batch-cnt 1 --rb-sample-rate 1 --prod-affinity 0 --cons-affinity 0 $b)"44done4546header "Ringbuf, multi-producer contention"47for b in 1 2 3 4 8 12 16 20 24 28 32 36 40 44 48 52; do48summarize "rb-libbpf nr_prod $b" "$($RUN_RB_BENCH -p$b --rb-batch-cnt 50 rb-libbpf)"49done50515253