Skip to contentSkip to conversation

perf test: Skip CoreSight tests if cs_etm// event is not available

PATCH Applied Michael Petlan 4 participants 4 messages Oct 19, 2023 – Oct 26, 2023 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf test: Skip CoreSight tests if cs_etm// event is not available

CoreSight might be not available, in such case, skip the tests.

---
 tools/perf/tests/shell/lib/coresight.sh | 2 ++
 1 file changed, 2 insertions(+)
tools/perf/tests/shell/lib/coresight.sh +2 -0
index 6c3d34ec64d8..11ed2c25ed91 100644
@@ -10,20 +10,22 @@
 
 # perf record options for the perf tests to use
 PERFRECMEM="-m ,16M"
 PERFRECOPT="$PERFRECMEM -e cs_etm//u"
 
 TOOLS=$(dirname $0)
 DIR="$TOOLS/$TEST"
 BIN="$DIR/$TEST"
 # If the test tool/binary does not exist and is executable then skip the test
 if ! test -x "$BIN"; then exit 2; fi
+# If CoreSight is not available, skip the test
+perf list cs_etm | grep -q cs_etm || exit 2
 DATD="."
 # If the data dir env is set then make the data dir use that instead of ./
 if test -n "$PERF_TEST_CORESIGHT_DATADIR"; then
 	DATD="$PERF_TEST_CORESIGHT_DATADIR";
 fi
 # If the stat dir env is set then make the data dir use that instead of ./
 STATD="."
 if test -n "$PERF_TEST_CORESIGHT_STATDIR"; then
 	STATD="$PERF_TEST_CORESIGHT_STATDIR";
 fi
Signature · 1 line
2.18.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 14 lines · Michael Petlan

CoreSight might be not available, in such case, skip the tests.

---
 tools/perf/tests/shell/lib/coresight.sh | 2 ++
 1 file changed, 2 insertions(+)
tools/perf/tests/shell/lib/coresight.sh +0 -0
index 6c3d34ec64d8..11ed2c25ed91 100644
@@ -10,20 +10,22 @@
 
 # perf record options for the perf tests to use

tools/perf/tests/shell/lib/coresight.sh line 21

Quoted 10 lines
tools/perf/tests/shell/lib/coresight.sh +2 -0
 PERFRECMEM="-m ,16M"
 PERFRECOPT="$PERFRECMEM -e cs_etm//u"
 
 TOOLS=$(dirname $0)
 DIR="$TOOLS/$TEST"
 BIN="$DIR/$TEST"
 # If the test tool/binary does not exist and is executable then skip the test
 if ! test -x "$BIN"; then exit 2; fi
+# If CoreSight is not available, skip the test
+perf list cs_etm | grep -q cs_etm || exit 2
Reviewed-by
#2 lore raw
Quoted 18 lines · Leo Yan
Quoted 17 lines · Michael Petlan

CoreSight might be not available, in such case, skip the tests.

---
  tools/perf/tests/shell/lib/coresight.sh | 2 ++
  1 file changed, 2 insertions(+)
tools/perf/tests/shell/lib/coresight.sh +0 -0
index 6c3d34ec64d8..11ed2c25ed91 100644
@@ -10,20 +10,22 @@
 
  # perf record options for the perf tests to use
  PERFRECMEM="-m ,16M"
  PERFRECOPT="$PERFRECMEM -e cs_etm//u"
 
Quoted 8 lines

tools/perf/tests/shell/lib/coresight.sh line 21

Quoted 7 lines
tools/perf/tests/shell/lib/coresight.sh +2 -0
  TOOLS=$(dirname $0)
  DIR="$TOOLS/$TEST"
  BIN="$DIR/$TEST"
  # If the test tool/binary does not exist and is executable then skip the test
  if ! test -x "$BIN"; then exit 2; fi
+# If CoreSight is not available, skip the test
+perf list cs_etm | grep -q cs_etm || exit 2

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.