Remove installed headers, cleanup header names
[ust.git] / tests / benchmark / run
1 #!/bin/bash
2 #
3 # run ust benchmark
4 #
5
6 iters=20
7 NR_EVENTS=7000000
8 NR_CPUS=1
9
10 TIME="./ptime"
11
12 #PROG_NOMARKER="find /usr"
13 PROG_NOMARKER="./bench1 $NR_CPUS $NR_EVENTS"
14 #PROG_MARKER=$PROG_NOMARKER
15 PROG_MARKER="./bench2 $NR_CPUS $NR_EVENTS"
16
17 CMD_NOMARKER="$TIME '$PROG_NOMARKER >/dev/null 2>&1'"
18 CMD_MARKER="$TIME '$PROG_MARKER >/dev/null 2>&1'"
19 CMD_MARKERCONN="UST_AUTOPROBE=1 $TIME '$PROG_MARKER >/dev/null 2>&1'"
20 CMD_MARKERTRACE="UST_TRACE=1 UST_AUTOPROBE=1 UST_OVERWRITE=1 UST_AUTOCOLLECT=0 $TIME '$PROG_MARKER >/dev/null 2>&1'"
21
22 echo "ust benchmark"
23
24 rm -f result-*.txt average-*.txt perevent-*.txt
25
26 echo "using $NR_CPUS processor(s)"
27 echo "using $NR_EVENTS events per cpu"
28
29 n=0
30 while [ $n -lt "$iters" ]; do
31 # without markers
32 echo ">running without markers"
33 echo 3 >/proc/sys/vm/drop_caches
34 t1=$(sh -c "$CMD_NOMARKER")
35 echo "$t1" >>result-nomark.txt
36 echo " time=$t1 sec"
37 n=$(($n+1))
38 done
39 ./average <result-nomark.txt >average-nomark.txt
40
41 ## with markers, not connected
42 #n=0
43 #while [ $n -lt "$iters" ]; do
44 # echo ">running with markers, not connected"
45 # echo 3 >/proc/sys/vm/drop_caches
46 # t2=$(sh -c "$CMD_MARKER")
47 # echo "$t2" >>result-mark.txt
48 # echo " time=$t2 sec"
49 # n=$(($n+1))
50 #done
51 #./average <result-mark.txt >average-mark.txt
52 #echo "( $(<average-mark.txt) - $(<average-nomark.txt) ) / $NR_EVENTS" | bc -l >perevent-mark.txt
53
54 ## with markers, connected
55 #n=0
56 #while [ $n -lt "$iters" ]; do
57 # echo ">running with markers activated"
58 # echo 3 >/proc/sys/vm/drop_caches
59 # t2=$(sh -c "$CMD_MARKERCONN")
60 # echo "$t2" >>result-markconn.txt
61 # echo " time=$t2 sec"
62 # n=$(($n+1))
63 #done
64 #./average <result-markconn.txt >average-markconn.txt
65 #echo "( $(<average-markconn.txt) - $(<average-nomark.txt) ) / $NR_EVENTS" | bc -l >perevent-markconn.txt
66
67 # with markers, connected, tracing
68 n=0
69 while [ $n -lt "$iters" ]; do
70 echo ">running with markers activated, trace recording"
71 echo 3 >/proc/sys/vm/drop_caches
72 t3=$(sh -c "$CMD_MARKERTRACE")
73 echo "$t3" >>result-marktrace.txt
74 echo " time=$t3 sec"
75 n=$(($n+1))
76 done
77 ./average <result-marktrace.txt >average-marktrace.txt
78 echo "( $(<average-marktrace.txt) - $(<average-nomark.txt) ) / $NR_EVENTS" | bc -l >perevent-marktrace.txt
79
80 function print_penalty()
81 {
82 echo ""
83
84 #penalty = t2 - t1
85 penalty=$(echo "$2 - $1;" | bc)
86 echo "Penalty ($3) = $penalty sec"
87
88 #event = penalty / (nr_events * nr_cpus)
89 event=$(echo "scale=10; ($penalty / ($NR_EVENTS * $NR_CPUS));" | bc)
90 echo "Penalty per event ($3) = $event sec"
91 }
92
93 #print_penalty $t1 $t2 "Penalty for markers enabled, not tracing"
94 #print_penalty $t1 $t3 "Penalty for markers enabled, tracing"
95
96
97 rm -f /tmp/bench.txt
This page took 0.031185 seconds and 4 git commands to generate.