Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf test: Update cs_etm testcase for Arm ETE

Add ETE as one of the supported device types in perf cs_etm testcase.

Reviewed-by: James Clark <james.clark@arm.com>
Signed-off-by: Ruidong Tian <tianruidong@linux.alibaba.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
Cc: coresight@lists.linaro.org
Cc: linux-arm-kernel@lists.infradead.org
Link: https://lore.kernel.org/r/20230911065541.91293-1-tianruidong@linux.alibaba.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Ruidong Tian and committed by
Arnaldo Carvalho de Melo
bb350847 5cdb51ba

+14 -1
+14 -1
tools/perf/tests/shell/test_arm_coresight.sh
··· 11 11 12 12 glb_err=0 13 13 14 + cs_etm_dev_name() { 15 + cs_etm_path=$(find /sys/bus/event_source/devices/cs_etm/ -name cpu* -print -quit) 16 + trcdevarch=$(cat ${cs_etm_path}/mgmt/trcdevarch) 17 + archhver=$((($trcdevarch >> 12) & 0xf)) 18 + archpart=$(($trcdevarch & 0xfff)) 19 + 20 + if [ $archhver -eq 5 -a "$(printf "0x%X\n" $archpart)" = "0xA13" ] ; then 21 + echo "ete" 22 + else 23 + echo "etm" 24 + fi 25 + } 26 + 14 27 skip_if_no_cs_etm_event() { 15 28 perf list | grep -q 'cs_etm//' && return 0 16 29 ··· 149 136 150 137 arm_cs_etm_traverse_path_test() { 151 138 # Iterate for every ETM device 152 - for dev in /sys/bus/coresight/devices/etm*; do 139 + for dev in /sys/bus/coresight/devices/$(cs_etm_dev_name)*; do 153 140 154 141 # Find the ETM device belonging to which CPU 155 142 cpu=`cat $dev/cpu`