Comparing the scaling of UST and SystemTap
[benchmarks.git] / ust-systemtap-tracepoints / runtest.sh
1 #!/bin/sh
2
3 #UST scalability test
4
5 BINARY=tracepoint_benchmark
6 REPORT=/tmp/testreport
7 TMPLOG=/tmp/testlog
8 WRAPPER=""
9 STAP=stap
10 STAPTMP=/tmp/stapconsole
11 STAPPROBE=testutrace.stp
12
13 rm $REPORT 2>/dev/null
14
15 ust_flight_recorder() {
16 # flight recorder, don't record trace to disk.
17 # default buffer size is 4k
18 echo -n "* UST Flight recorder : " | tee >> $REPORT
19 export UST_AUTOCOLLECT=0
20 export UST_OVERWRITE=1
21 export UST_SUBBUF_NUM=16
22 WRAPPER=usttrace
23 }
24
25 ust_disk() {
26 # Collect traces to disk
27 # default buffer size is 4k
28 echo -n "* UST Write to disk : " | tee >> $REPORT
29 export UST_AUTOCOLLECT=1
30 export UST_OVERWRITE=0
31 export UST_SUBBUF_NUM=16
32 WRAPPER=usttrace
33 }
34
35 stap_flight_recorder() {
36 echo -n "* SystemTap Flight recorder : " | tee >> $REPORT
37 WRAPPER=""
38 $STAP $STAPPROBE -F -m $BINARY
39 }
40
41 stap_disk() {
42 echo -n "* SystemTap Write to disk : " | tee >> $REPORT
43 WRAPPER=""
44 $STAP $STAPPROBE -o $STAPTMP -m $BINARY &
45 sleep 5
46 }
47
48 echo "Userspace tracing scalability test report" |tee >> $REPORT
49 case "$1" in
50 ust_flight_recorder)
51 TEST=ust_flight_recorder
52 ;;
53 ust_disk)
54 TEST=ust_disk
55 ;;
56 stap_flight_recorder)
57 TEST=stap_flight_recorder
58 ;;
59 stap_disk)
60 TEST=stap_disk
61 ;;
62 *)
63 echo "Usage : $0 {ust_flight_recorder|ust_disk|stap_flight_recorder|stap_disk}"
64 exit 1
65 ;;
66 esac
67
68 for nr_threads in 1 2 4 8; do
69 echo "" | tee >> $REPORT
70 echo Number of threads: $nr_threads | tee >> $REPORT
71 echo -n "* Baseline : " | tee >> $REPORT
72
73 # just some cleanup
74 killall stapio 2>/dev/null
75 rmmod $BINARY 2>/dev/null
76
77 sync
78 /usr/bin/time -f "%E" -o $TMPLOG ./$BINARY ${nr_threads}
79 cat $TMPLOG >> $REPORT
80
81 $TEST
82
83 sync
84 /usr/bin/time -f "%E" -o $TMPLOG $WRAPPER ./$BINARY ${nr_threads}
85 cat $TMPLOG >> $REPORT
86 done
87
88 cat $REPORT
89
This page took 0.041069 seconds and 4 git commands to generate.