Commit | Line | Data |
---|---|---|
e6af533d DS |
1 | #!/bin/bash |
2 | # | |
3 | # run ust benchmark | |
4 | # | |
5 | ||
6 | echo "ust benchmark" | |
7 | ||
8 | NR_EVENTS=2000000 | |
9 | NR_CPUS=2 | |
10 | echo "using $NR_CPUS processor(s)" | |
11 | echo "using $NR_EVENTS events per cpu" | |
12 | ||
13 | ||
14 | rm -f /tmp/bench.txt | |
15 | # without markers | |
16 | echo ">running without markers" | |
17 | t1=$(/usr/bin/time -f%e usttrace ./bench1 $NR_CPUS $NR_EVENTS 2>&1 1> /dev/null) | |
18 | echo " time=$t1 sec" | |
19 | ||
20 | ||
21 | rm -f /tmp/bench.txt | |
22 | # with markers | |
23 | echo ">running with markers activated" | |
24 | t2=$(/usr/bin/time -f%e usttrace ./bench2 $NR_CPUS $NR_EVENTS 2>&1 1> /dev/null) | |
25 | echo " time=$t2 sec" | |
26 | ||
27 | ||
28 | #penalty = t2 - t1 | |
29 | echo | |
30 | penalty=$(echo "$t2 - $t1;" | bc) | |
31 | echo "time penalty=$penalty sec" | |
32 | ||
33 | #event = penalty / (nr_events * nr_cpus) | |
34 | event=$(echo "scale=8; ($penalty / ($NR_EVENTS * $NR_CPUS));" | bc) | |
35 | echo "time penalty per event=$event sec" | |
36 | ||
37 | rm -f /tmp/bench.txt |