Back to home page

OSCL-LXR

 
 

    


0001 #!/bin/sh
0002 # perf all PMU test
0003 # SPDX-License-Identifier: GPL-2.0
0004 
0005 set -e
0006 
0007 for p in $(perf list --raw-dump pmu); do
0008   # In powerpc, skip the events for hv_24x7 and hv_gpci.
0009   # These events needs input values to be filled in for
0010   # core, chip, partition id based on system.
0011   # Example: hv_24x7/CPM_ADJUNCT_INST,domain=?,core=?/
0012   # hv_gpci/event,partition_id=?/
0013   # Hence skip these events for ppc.
0014   if echo "$p" |grep -Eq 'hv_24x7|hv_gpci' ; then
0015     echo "Skipping: Event '$p' in powerpc"
0016     continue
0017   fi
0018   echo "Testing $p"
0019   result=$(perf stat -e "$p" true 2>&1)
0020   if ! echo "$result" | grep -q "$p" && ! echo "$result" | grep -q "<not supported>" ; then
0021     # We failed to see the event and it is supported. Possibly the workload was
0022     # too small so retry with something longer.
0023     result=$(perf stat -e "$p" perf bench internals synthesize 2>&1)
0024     if ! echo "$result" | grep -q "$p" ; then
0025       echo "Event '$p' not printed in:"
0026       echo "$result"
0027       exit 1
0028     fi
0029   fi
0030 done
0031 
0032 exit 0