3 # Verify /proc/interrupts parsing for various architectures.
5 # Copyright (c) 2016 Red Hat.
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
16 [ $PCP_PLATFORM = linux
] || _notrun
"Linux interrupts test, only works with Linux"
18 status
=1 # failure is the default!
19 $sudo rm -rf $tmp.
* $seq.full
24 [ -f $PCP_VAR_DIR/config
/pmda
/$domain.26.
$seq ] && \
25 _restore_config
$PCP_VAR_DIR/config
/pmda
/$domain.26
26 [ -f $PCP_VAR_DIR/config
/pmda
/$domain.27.
$seq ] && \
27 _restore_config
$PCP_VAR_DIR/config
/pmda
/$domain.27
31 trap "_cleanup; exit \$status" 0 1 2 3 15
38 echo cpu
0 0 0 0 0 0 0 0 0 > $path
40 while [ $cpu -lt $ncpu ]
42 echo cpu
$cpu 0 0 0 0 0 0 0 0 0 >> $path
47 # real QA test starts here
49 export LINUX_STATSPATH
=$root
50 pmda
=$PCP_PMDAS_DIR/linux
/pmda_linux.so
,linux_init
51 interrupts
=`echo $here/linux/interrupts-* | LC_COLLATE=POSIX sort`
52 softirqs
=`echo $here/linux/softirqs-* | LC_COLLATE=POSIX sort`
54 # override the default contents of PMDA cache files
55 # (do not want localhost versions to be used here).
58 [ -f $PCP_VAR_DIR/config
/pmda
/$domain.26 ] && \
59 _save_config
$PCP_VAR_DIR/config
/pmda
/$domain.26
60 $sudo rm -f $PCP_VAR_DIR/config
/pmda
/$domain.26
61 [ -f $PCP_VAR_DIR/config
/pmda
/$domain.27 ] && \
62 _save_config
$PCP_VAR_DIR/config
/pmda
/$domain.27
63 $sudo rm -f $PCP_VAR_DIR/config
/pmda
/$domain.27
65 for file in $interrupts
68 mkdir
-p $root/proc || _fail
"root in use when processing $file"
70 cp $file $root/proc
/interrupts
72 ncpu
=`echo $base | sed -e 's/.*-\([0-9][0-9]*\)cpu-.*/\1/'`
73 proc_stat
$root/proc
/stat
$ncpu
74 export LINUX_NCPUS
=$ncpu
76 echo "== Checking interrupts metrics from $base ($ncpu CPU)"
77 pminfo
-f -L -K clear -K add
,$domain,$pmda kernel.percpu.interrupts
78 echo && echo "== done" && echo
79 echo "== Checking interrupts helptext from $base ($ncpu CPU)"
80 pminfo
-tT -L -K clear -K add
,$domain,$pmda kernel.percpu.interrupts
81 echo && echo "== done" && echo
88 mkdir
-p $root/proc || _fail
"root in use when processing $file"
90 cp $file $root/proc
/softirqs
92 ncpu
=`echo $base | sed -e 's/.*-\([0-9][0-9]*\)cpu-.*/\1/'`
93 proc_stat
$root/proc
/stat
$ncpu
94 export LINUX_NCPUS
=$ncpu
96 echo "== Checking softirqs metrics from $base ($ncpu CPU)"
97 pminfo
-f -L -K clear -K add
,$domain,$pmda kernel.percpu.softirqs
98 echo && echo "== done" && echo