benchmarks: Include my ezbench test runners

Just a set of scripts to integrate these benchmarks with ezbench. They
need to be revised to plugin into latest version of ezbench.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2016-04-03 16:45:22 +01:00
parent eac26718e6
commit 1a50172302
10 changed files with 242 additions and 0 deletions

View File

@ -0,0 +1,34 @@
test_exec_time=2
[ -e $IGT_BENCHMARKS/gem_blt ] || return 1
sudo -n true || return 1
while read size batch label; do
name="gem:blt:copy:${label}"
test_name="$test_name $name"
eval "${name}_run() { sudo $IGT_BENCHMARKS/gem_blt -r \$1 -s $size -b $batch; }"
done<<SIZES
4096 1 4KiBx1
4096 16 4KiBx16
4096 64 4KiBx64
4096 256 4KiBx256
4096 1024 4KiBx1024
131072 1 128KiBx1
131072 16 128KiBx16
131072 64 128KiBx64
131072 256 128KiBx256
131072 1024 128KiBx1024
4194304 1 4MiBx1
4194304 32 4MiBx32
4194304 1024 4MiBx1024
SIZES
while read size label; do
name="gem:blt:copy:${label}:sync"
test_name="$test_name $name"
eval "${name}_run() { sudo $IGT_BENCHMARKS/gem_blt -S -r \$1 -s $size -b 1 ; }"
done<<SIZES
4096 4KiB
131072 128KiB
4194304 4MiB
SIZES

View File

@ -0,0 +1,8 @@
test_exec_time=2
[ -e $IGT_BENCHMARKS/gem_create ] || return 1
sudo -n true || return 1
test_name="gem:create:4k gem:create:4M"
gem:create:4k_run() { sudo $IGT_BENCHMARKS/gem_create -s 4096 -r $1; }
gem:create:4M_run() { sudo $IGT_BENCHMARKS/gem_create -s 4194304 -r $1; }

View File

@ -0,0 +1,21 @@
# This outputs a graph of time(N), the us it takes to execute N empty batches
# performing the associated context operation each time.
# e.g. 110 59 34 22 16 13 11 10 10 10 9 4 1.4 1.4 1.2 0.9 0.8
# As a summary, print the number of nop/s (so that it matches the bigger is
# better motif of fps).
[ -e $IGT_BENCHMARKS/gem_exec_ctx ] || return 1
sudo -n true || return 1
for i in nop default switch create; do
name="gem:exec:ctx:$i:single"
test_name="$test_name $name"
eval "${name}_run() { sudo $IGT_BENCHMARKS/gem_exec_ctx -s -b $i -r \$1 ; }"
name="gem:exec:ctx:$i:continuous"
test_name="$test_name $name"
eval "${name}_run() { sudo $IGT_BENCHMARKS/gem_exec_ctx -b $i -r \$1 ; }"
done
test_exec_time=3
test_invert=1

View File

@ -0,0 +1,15 @@
[ -e $IGT_BENCHMARKS/gem_exec_nop ] || return 1
sudo -n true || return 1
for ring in rcs bcs vcs vecs all; do
name="gem:exec:nop:$ring:single"
test_name="$test_name $name"
eval "${name}_run() { sudo $IGT_BENCHMARKS/gem_exec_nop -s -e $ring -r \$1 ; }"
name="gem:exec:nop:$ring:continuous"
test_name="$test_name $name"
eval "${name}_run() { sudo $IGT_BENCHMARKS/gem_exec_nop -e $ring -r \$1 ; }"
done
test_exec_time=3
test_invert=1

View File

@ -0,0 +1,20 @@
test_exec_time=18
test_invert=1
[ -e $IGT_BENCHMARKS/gem_exec_reloc ] || return 1
sudo -n true || return 1
for i in old lut; do
for j in busy cyclic fault skip none; do
for k in constant sequential reverse random; do
for b in 2 4096; do
test_name="$test_name gem:exec:reloc:$i:$j:$k:$b"
eval "gem:exec:reloc:${i}:${j}:${k}:${b}_run() { sudo $IGT_BENCHMARKS/gem_exec_reloc -s 65536 -m $i -e $j -o $k -l \$1 -b $b -r 4096 ; } "
done
done
done
for j in 0 32 1024 32768; do
test_name="$test_name gem:exec:reloc:$i:0:$j"
eval "gem:exec:reloc:${i}:0:${j}_run() { sudo $IGT_BENCHMARKS/gem_exec_reloc -s 4096 -m $i -e none -o constant -l \$1 -b $j -r 0 ; } "
done
done

View File

@ -0,0 +1,19 @@
[ -e $IGT_BENCHMARKS/gem_exec_trace ] || return 1
sudo -n true || return 1
function __trace__ {
sudo $IGT_BENCHMARKS/gem_exec_trace $IGT_TRACES/$2.gem_exec_trace >/dev/null
for (( c=0; c<$1; c++ )); do
sudo $IGT_BENCHMARKS/gem_exec_trace $IGT_TRACES/$2.gem_exec_trace | sed 's/.*: //'
done
}
for i in $IGT_TRACES/*.gem_exec_trace; do
trace=$(basename $i .gem_exec_trace)
name=gem:exec:trace:$trace
test_name="$test_name $name"
eval "${name}_run() { __trace__ \$1 $trace; }"
done
test_exec_time=4
test_invert=1

View File

@ -0,0 +1,79 @@
test_exec_time=2
test_invert=1
[ -e $IGT_BENCHMARKS/gem_latency ] || return 1
sudo -n true || return 1
__gem:dispatch__() {
for (( c=0; c<$1; c++ )); do
sudo $IGT_BENCHMARKS/gem_latency -t 2 -n $2 -p $3 -f 1 $4
done
}
# Measure the delay to execute N nops
for n in 0 1 2 4 8 16 32 64 128 256 512 1024; do
name="gem:exec:latency:$n"
test_name="$test_name $name"
eval "${name}_run() { __gem:dispatch__ \$1 $n 1 ; } "
done
for n in 0 1 2 4 8 16 32 64 128 256 512 1024; do
name="gem:parser:latency:$n"
test_name="$test_name $name"
eval "${name}_run() { __gem:dispatch__ \$1 $n 1 -C ; } "
done
# Measure the execution delay vs contention, just for fun
for p in 1 2 4 8 16 32 64 128 256 512 1024; do
name="gem:latency:dispatch:$p"
test_name="$test_name $name"
eval "${name}_run() { __gem:dispatch__ \$1 0 $p ; } "
done
# Measure the wakeup delay (each wakeup should be uncontended)
__gem:latency:wait__() {
for (( c=0; c<$1; c++ )); do
sudo $IGT_BENCHMARKS/gem_latency -t 2 -w 2 -p $2 -f 2
done
}
for p in 1 2 4 8 16 32 64 128 256 512 1024; do
name="gem:latency:wait:$p"
test_name="$test_name $name"
eval "${name}_run() { __gem:latency:wait__ \$1 $p ; } "
done
# Measure the total CPU cycles for the uncontended wakeups
__gem:latency:cpu__() {
for (( c=0; c<$1; c++ )); do
sudo $IGT_BENCHMARKS/gem_latency -t 2 -w 2 -p $2 -f 4
done
}
for p in 1 2 4 8 16 32 64 128 512 1024; do
name="gem:latency:cpu:$p"
test_name="$test_name $name"
eval "${name}_run() { __gem:latency:cpu__ \$1 $p ; } "
done
# Measure the wakeup delay for contended wakeups (multiple waiters per request)
__gem:latency:herd__() {
for (( c=0; c<$1; c++ )); do
sudo $IGT_BENCHMARKS/gem_latency -t 2 -w 1 -c $2 -f 2
done
}
for p in 0 1 2 4 8 16 32 64 128 512 1024; do
name="gem:latency:herd:$p"
test_name="$test_name $name"
eval "${name}_run() { __gem:latency:herd__ \$1 $p ; } "
done
# Measure the impact of contended wakeups on the RealTime waiter
__gem:latency:realtime__() {
for (( c=0; c<$1; c++ )); do
sudo $IGT_BENCHMARKS/gem_latency -t 2 -w 1 -c $2 -R -f 3
done
}
for p in 0 1 2 4 8 16 32 64 128 512 1024; do
name="gem:latency:realtime:$p"
test_name="$test_name $name"
eval "${name}_run() { __gem:latency:realtime__ \$1 $p ; } "
done

View File

@ -0,0 +1,14 @@
[ -e $IGT_BENCHMARKS/gem_mmap ] || return 1
sudo -n true || return 1
for i in cpu gtt wc; do
for j in fault clear write read; do
for k in none x y; do
test_name="$test_name gem:mmap:$i:$j:$k"
eval "gem:mmap:${i}:${j}:${k}_run() { sudo $IGT_BENCHMARKS/gem_mmap -m $i -d $j -t $k -r \$1 ; } "
done
done
done
test_exec_time=2

View File

@ -0,0 +1,20 @@
# This outputs a graph of time(N), the time it takes to write 1<<N bytes in us.
# e.g. 0 1 2 4 8 16 32
# The last value is for 4M, convert that to MiB/s for comparison
#
# Ideally we want to run this per ring,
# gem_exec_nop:rcs, gem_exec_nop:bcs, gem_exec_nop:vcs
# though for the time being just one will suffice
[ -e $IGT_BENCHMARKS/gem_prw ] || return 1
sudo -n true || return 1
for j in read write; do
for i in cpu gtt; do
test_name="$test_name gem:p$j:$i"
eval "gem:p$j:${i}_run() { sudo $IGT_BENCHMARKS/gem_prw -D $j -d $i -r \$1 ; }"
eval "gem:p$j:${i}_process() { bc -l <<< \" 4*1000000 / \${@: -1} \" ; }"
done
done
test_exec_time=1

View File

@ -0,0 +1,12 @@
test_name="gem:sys:latency"
test_exec_time=10
test_invert=1
[ -e $IGT_BENCHMARKS/gem_syslatency ] || return 1
sudo -n true || return 1
gem:sys:latency_run() {
for (( c=0; c<$1; c++ )); do
sudo $IGT_BENCHMARKS/gem_syslatency -f 1
done
}