benchmark tool
[ust.git] / tests / benchmark / run
CommitLineData
e6af533d
DS
1#!/bin/bash
2#
3# run ust benchmark
4#
5
6echo "ust benchmark"
7
8NR_EVENTS=2000000
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"
17t1=$(/usr/bin/time -f%e usttrace ./bench1 $NR_CPUS $NR_EVENTS 2>&1 1> /dev/null)
18echo " time=$t1 sec"
19
20
21rm -f /tmp/bench.txt
22# with markers
23echo ">running with markers activated"
24t2=$(/usr/bin/time -f%e usttrace ./bench2 $NR_CPUS $NR_EVENTS 2>&1 1> /dev/null)
25echo " time=$t2 sec"
26
27
28#penalty = t2 - t1
29echo
30penalty=$(echo "$t2 - $t1;" | bc)
31echo "time penalty=$penalty sec"
32
33#event = penalty / (nr_events * nr_cpus)
34event=$(echo "scale=8; ($penalty / ($NR_EVENTS * $NR_CPUS));" | bc)
35echo "time penalty per event=$event sec"
36
37rm -f /tmp/bench.txt
This page took 0.023205 seconds and 4 git commands to generate.