Skip to content

Commit 070b315

Browse files
Chun-Tse Shaoacmel
authored andcommitted
perf test: Restrict uniquifying test to machines with 'uncore_imc'
The test would fail if target machine does not have 'uncore_imc' devices. Since event uniquifying behavior is similar among different architectures, we are restricting the test to only run on machines with `uncore_imc` devices. Suggested-by: Ian Rogers <[email protected]> Signed-off-by: Chun-Tse Shao <[email protected]> Tested-by: Arnaldo Carvalho de Melo <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Kan Liang <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: https://lore.kernel.org/r/[email protected] [ Skip the test, i.e. return 2, instead of returning 0 as if the test had succeed ] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 44a5ab7 commit 070b315

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tools/perf/tests/shell/stat+event_uniquifying.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ perf_tool=perf
99
err=0
1010

1111
test_event_uniquifying() {
12-
# We use `clockticks` to verify the uniquify behavior.
12+
# We use `clockticks` in `uncore_imc` to verify the uniquify behavior.
13+
pmu="uncore_imc"
1314
event="clockticks"
1415

1516
# If the `-A` option is added, the event should be uniquified.
@@ -43,11 +44,18 @@ test_event_uniquifying() {
4344
echo "stat event uniquifying test"
4445
uniquified_event_array=()
4546

47+
# Skip if the machine does not have `uncore_imc` device.
48+
if ! ${perf_tool} list pmu | grep -q ${pmu}; then
49+
echo "Target does not support PMU ${pmu} [Skipped]"
50+
err=2
51+
return
52+
fi
53+
4654
# Check how many uniquified events.
4755
while IFS= read -r line; do
4856
uniquified_event=$(echo "$line" | awk '{print $1}')
4957
uniquified_event_array+=("${uniquified_event}")
50-
done < <(${perf_tool} list -v ${event} | grep "\[Kernel PMU event\]")
58+
done < <(${perf_tool} list -v ${event} | grep ${pmu})
5159

5260
perf_command="${perf_tool} stat -e $event -A -o ${stat_output} -- true"
5361
$perf_command

0 commit comments

Comments
 (0)