]> rtime.felk.cvut.cz Git - can-benchmark.git/blob - tests/cpuload2.sh
Preliminary version of the first test
[can-benchmark.git] / tests / cpuload2.sh
1 #!/bin/bash
2
3 . _lib.sh
4
5 NUM_PROC=30
6
7 t() {
8     for i in norm boost; do
9         for budget in 300 1 1000; do
10             echo $budget > /proc/sys/net/core/netdev_budget
11             ( while hackbench -pipe 20; do true; done ) &
12             PID_LOAD=$!
13             echo 0 1 > $DRIVER-$i-$budget-1000.dat
14             if [ $budget -eq 300 -o $DRIVER == "socketcan" ]; then
15                 if [ $i != "boost" ] || boost_irq_prio 90; then
16                     PID_S=`vca_canping -s 1 -b -R FF:$RTPRIO -d $CAN1`
17                     vca_canping -m 1 -R FF:$RTPRIO -v -g $DRIVER-$i-$budget -t 1 -d $CAN0 -w 0 -c $COUNT
18                     kill $PID_S
19                 fi
20             fi
21             kill $PID_LOAD  
22         done
23     done
24 }
25
26
27
28 p() { cat <<EOF
29 set title "Round-trip time with CPU load (hackbench)"
30 set logscale y
31 set grid
32 set xlabel "Time [ms]"
33 set ylabel "Latency profile [messages]"
34 plot [0:] \
35           "socketcan-norm-300-1000.dat" with lp lt 1 title "Socketcan",\
36           "lincan-norm-300-1000.dat" with lp lt 2 title "Lincan",\
37           "socketcan-boost-300-1000.dat" with lp lt 1 title "Socketcan boosted IRQ prio",\
38            "lincan-boost-300-1000.dat" with lp lt 2 title "Lincan boosted IRQ prio",\
39           "socketcan-norm-1-1000.dat" with lp lt 1 title "Socketcan netdev\\\\_budget=1",\
40           "socketcan-boost-1-1000.dat" with lp lt 1 title "Socketcan boosted IRQ prio, netdev\\\\_budget=1",\
41           "socketcan-norm-1000-1000.dat" with lp lt 1 title "Socketcan, netdev\\\\_budget=1000",\
42           "socketcan-boost-1000-1000.dat" with lp lt 1 title "Socketcan boosted IRQ prio, netdev\\\\_budget=1000"
43 EOF
44 }