benchmark: fix various problems
[ust.git] / tests / benchmark / run
CommitLineData
e6af533d
DS
1#!/bin/bash
2#
3# run ust benchmark
4#
5
6echo "ust benchmark"
7
e6eed717 8NR_EVENTS=4000000
e6af533d
DS
9NR_CPUS=2
10echo "using $NR_CPUS processor(s)"
11echo "using $NR_EVENTS events per cpu"
12
13
14rm -f /tmp/bench.txt
15# without markers
16echo ">running without markers"
e6eed717
PMF
17#t1=$(/usr/bin/time -f%e usttrace ./bench1 $NR_CPUS $NR_EVENTS 2>&1 1> /dev/null)
18t1=$(/usr/bin/time -f%e ./bench1 $NR_CPUS $NR_EVENTS 2>&1 1> /dev/null)
e6af533d
DS
19echo " time=$t1 sec"
20
21
22rm -f /tmp/bench.txt
23# with markers
24echo ">running with markers activated"
25t2=$(/usr/bin/time -f%e usttrace ./bench2 $NR_CPUS $NR_EVENTS 2>&1 1> /dev/null)
26echo " time=$t2 sec"
27
28
29#penalty = t2 - t1
30echo
31penalty=$(echo "$t2 - $t1;" | bc)
32echo "time penalty=$penalty sec"
33
34#event = penalty / (nr_events * nr_cpus)
e6eed717 35event=$(echo "scale=10; ($penalty / ($NR_EVENTS * $NR_CPUS));" | bc)
e6af533d
DS
36echo "time penalty per event=$event sec"
37
38rm -f /tmp/bench.txt
This page took 0.025706 seconds and 4 git commands to generate.