Fix: loglevel and model_emf_uri with g++ compiled probes
[lttng-ust.git] / tests / benchmark / test_benchmark
1 #!/bin/bash
2
3 CURDIR=$(dirname $0)/
4 TESTDIR=$CURDIR/..
5 source $TESTDIR/utils/tap.sh
6
7 plan_tests 1
8
9 : ${ITERS:=20}
10 : ${NR_EVENTS:=7000000}
11 : ${NR_CPUS:=1}
12
13 : ${TIME:="./$CURDIR/ptime"}
14
15 : ${PROG_NOTRACING:="./$CURDIR/bench1 $NR_CPUS $NR_EVENTS"}
16 : ${PROG_TRACING:="./$CURDIR/bench2 $NR_CPUS $NR_EVENTS"}
17
18 CMD_NOTRACING="$TIME '$PROG_NOTRACING >/dev/null 2>&1'"
19 CMD_TRACING="$TIME '$PROG_TRACING >/dev/null 2>&1'"
20
21 time_notrace=0
22 for i in $(seq $ITERS); do
23 echo 3 >/proc/sys/vm/drop_caches
24 time_notrace="$time_notrace+$(sh -c "$CMD_NOTRACING")"
25 done
26
27 lttng-sessiond -d --no-kernel
28 lttng -q create
29 lttng -q enable-event -u -a
30 lttng -q start
31
32 time_trace=0
33 for i in $(seq $ITERS); do
34 echo 3 >/proc/sys/vm/drop_caches
35 time_trace="$time_trace+$(sh -c "$CMD_TRACING")"
36 done
37
38 lttng -q stop
39 lttng -q destroy
40
41 pass "Trace benchmark"
42 diag "Average tracing overhead per event is $(echo "scale=6;( ($time_trace) - ($time_notrace) ) / $ITERS / $NR_EVENTS" | bc -l)s"
This page took 0.037616 seconds and 4 git commands to generate.