3 # Exercise Linux PMDA memory metrics.
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-specific memory metric testing"
18 config
="$PCP_PMDAS_DIR/linux/bandwidth.conf"
23 if [ -f "$config.$seq" ]
25 _restore_config
"$config"
26 $sudo rm -f "$config.$seq"
31 status
=1 # failure is the default!
32 $sudo rm -rf $tmp $tmp.
* $seq.full
33 trap "cd $here; rm -rf $tmp $tmp.*; exit \$status" 0 1 2 3 15
35 # real QA test starts here
37 export LINUX_HERTZ
=100
38 export LINUX_PAGESIZE
=4096
39 export LINUX_STATSPATH
=$root
40 pmda
=$PCP_PMDAS_DIR/linux
/pmda_linux.so
,linux_init
41 local="-L -K clear -K add,60,$pmda"
43 mem_metrics
=`pminfo $local mem | LC_COLLATE=POSIX sort`
44 slab_metrics
=`pminfo $local mem.slabinfo | LC_COLLATE=POSIX sort`
48 _save_config
"$config"
49 $sudo rm -f "$config" # ensure deterministic output, see qa/826
52 for tgz
in $here/linux
/meminfo-
*.tgz
55 mkdir
$root || _fail
"root in use when processing $tgz"
60 echo "== Checking all mem metric values - $base"
61 pminfo
$local -f $mem_metrics
62 echo && echo "== done" && echo
64 echo "== Checking slabinfo metric values - $base"
65 # requires root privileges to access these
66 $sudo pminfo
$local -f $slab_metrics
67 echo && echo "== done" && echo