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

perf test: Add ARM SPE system wide test

In the past it had a problem not setting the pid/tid on the sample
correctly when system-wide mode is used. Although it's fixed now it'd
be nice if we have a test case for it.

Reviewed-by: German Gomez <german.gomez@arm.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Leo Yan <leo.yan@linaro.org>
Cc: German Gomez <german.gomez@arm.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: James Clark <james.clark@arm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: John Garry <john.garry@huawei.com>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20220701230932.1000495-1-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Namhyung Kim and committed by
Arnaldo Carvalho de Melo
00b32625 5f4e821c

+27 -3
+27 -3
tools/perf/tests/shell/test_arm_spe.sh
··· 23 23 cleanup_files() 24 24 { 25 25 rm -f ${perfdata} 26 + rm -f ${perfdata}.old 26 27 exit $glb_err 27 28 } 28 29 29 30 trap cleanup_files exit term int 30 31 31 32 arm_spe_report() { 32 - if [ $2 != 0 ]; then 33 + if [ $2 = 0 ]; then 34 + echo "$1: PASS" 35 + elif [ $2 = 2 ]; then 36 + echo "$1: SKIPPED" 37 + else 33 38 echo "$1: FAIL" 34 39 glb_err=$2 35 - else 36 - echo "$1: PASS" 37 40 fi 38 41 } 39 42 ··· 88 85 arm_spe_report "SPE snapshot testing" $err 89 86 } 90 87 88 + arm_spe_system_wide_test() { 89 + echo "Recording trace with system-wide mode $perfdata" 90 + 91 + perf record -o - -e dummy -a -B true > /dev/null 2>&1 92 + if [ $? != 0 ]; then 93 + arm_spe_report "SPE system-wide testing" 2 94 + return 95 + fi 96 + 97 + perf record -o ${perfdata} -e arm_spe// -a --no-bpf-event \ 98 + -- dd if=/dev/zero of=/dev/null count=100000 > /dev/null 2>&1 99 + 100 + perf_script_samples dd && 101 + perf_report_samples dd 102 + 103 + err=$? 104 + arm_spe_report "SPE system-wide testing" $err 105 + } 106 + 91 107 arm_spe_snapshot_test 108 + arm_spe_system_wide_test 109 + 92 110 exit $glb_err