Merge branch 'master' of git://git.pcp.io/pcp into qt
[pcp.git] / qa / 857
blob295cdcc5903b34b0f9d6458f784c0d0113375443
1 #!/bin/sh
2 # PCP QA Test No. 857
3 # Check Linux interrupts and softirqs metrics with valgrind.
5 # Copyright (c) 2016 Red Hat.
8 seq=`basename $0`
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
12 . ./common.product
13 . ./common.filter
14 . ./common.check
16 _check_valgrind
17 [ $PCP_PLATFORM = linux ] || _notrun "Linux interrupts test, only works with Linux"
19 status=1 # failure is the default!
20 $sudo rm -rf $tmp.* $seq.full
21 trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
23 _filter()
25 sed \
26 -e "s,$PCP_PMDAS_DIR,PCP_PMDAS_DIR,g" \
27 #end
30 _mk_proc_stat()
32 path=$1
33 ncpu=$2
35 echo cpu 0 0 0 0 0 0 0 0 0 > $path
36 cpu=0
37 while [ $cpu -lt $ncpu ]
39 echo cpu$cpu 0 0 0 0 0 0 0 0 0 >> $path
40 cpu=`expr $cpu + 1`
41 done
44 # real QA test starts here
45 pmda=$PCP_PMDAS_DIR/linux/pmda_linux.so,linux_init
46 metrics="kernel.percpu.intr kernel.percpu.interrupts kernel.percpu.softirqs"
47 machine=8cpu-x86_64
49 export LINUX_STATSPATH=$tmp.root
50 export LINUX_NCPUS=8
52 mkdir -p $LINUX_STATSPATH/proc
53 cp $here/linux/interrupts-$machine $LINUX_STATSPATH/proc/interrupts
54 cp $here/linux/softirqs-$machine $LINUX_STATSPATH/proc/softirqs
55 _mk_proc_stat $LINUX_STATSPATH/proc/stat $LINUX_NCPUS
57 echo "== Checking interrupts and softirqs names"
58 _run_valgrind pminfo -L -K clear -K add,60,$pmda $metrics | _filter
59 echo && echo "== done" && echo
61 echo "== Checking interrupts and softirqs values"
62 _run_valgrind pminfo --fetch -L -K clear -K add,60,$pmda $metrics | _filter
63 echo && echo "== done" && echo
65 echo "== Checking interrupts and softirqs helptext"
66 _run_valgrind pminfo -tT -L -K clear -K add,60,$pmda $metrics | _filter
67 echo && echo "== done" && echo
69 # success, all done
70 status=0
71 exit