diff options
author | Leo Yan <leo.yan@linaro.org> | 2021-02-15 19:59:44 +0800 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2021-02-18 16:30:36 -0300 |
commit | 11d45d4fb9239e89751bc79c7029453bee8f498c (patch) | |
tree | 93ce467829d0f6a61d0e9c5c894ab0f6421b33d5 /tools | |
parent | 46355e3d793c6d67fbfb4b155abd0869b6a7d79b (diff) |
perf test: Output the sub testing result in cs-etm
The CoreSight testing contains sub cases, e.g. every CPU iterates the
possible conntected sinks and tests the paths between the associated ETM
with the found sink. Besides the per-thread testing, it also contains
system wide testing and snapshot testing.
To easier observe results for the sub cases, this patch introduces a new
function arm_cs_report(), it outputs the result as "PASS" or "FAIL" for
every sub case; and it records the error in the variable "glb_err" which
is used as the final return value when exits the testing.
Before:
# perf test 73 -v
73: Check Arm CoreSight trace data recording and synthesized samples:
--- start ---
test child forked, pid 17423
Recording trace (only user mode) with path: CPU0 => tmc_etf0
Looking at perf.data file for dumping branch samples:
Looking at perf.data file for reporting branch samples:
Looking at perf.data file for instruction samples:
Recording trace (only user mode) with path: CPU0 => tmc_etr0
Looking at perf.data file for dumping branch samples:
Looking at perf.data file for reporting branch samples:
Looking at perf.data file for instruction samples:
[...]
After:
# perf test 73 -v
73: Check Arm CoreSight trace data recording and synthesized samples:
--- start ---
test child forked, pid 17423
Recording trace (only user mode) with path: CPU0 => tmc_etf0
Looking at perf.data file for dumping branch samples:
Looking at perf.data file for reporting branch samples:
Looking at perf.data file for instruction samples:
CoreSight path testing (CPU0 -> tmc_etf0): PASS
Recording trace (only user mode) with path: CPU0 => tmc_etr0
Looking at perf.data file for dumping branch samples:
Looking at perf.data file for reporting branch samples:
Looking at perf.data file for instruction samples:
CoreSight path testing (CPU0 -> tmc_etr0): PASS
[...]
Signed-off-by: Leo Yan <leo.yan@linaro.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Basil Eljuse <basil.eljuse@arm.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Naresh Kamboju <naresh.kamboju@linaro.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Link: http://lore.kernel.org/lkml/20210215115944.535986-3-leo.yan@linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/perf/tests/shell/test_arm_coresight.sh | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/tools/perf/tests/shell/test_arm_coresight.sh b/tools/perf/tests/shell/test_arm_coresight.sh index 59b647455ec6..c9eef0bba6f1 100755 --- a/tools/perf/tests/shell/test_arm_coresight.sh +++ b/tools/perf/tests/shell/test_arm_coresight.sh @@ -11,6 +11,7 @@ perfdata=$(mktemp /tmp/__perf_test.perf.data.XXXXX) file=$(mktemp /tmp/temporary_file.XXXXX) +glb_err=0 skip_if_no_cs_etm_event() { perf list | grep -q 'cs_etm//' && return 0 @@ -69,6 +70,15 @@ perf_report_instruction_samples() { egrep " +[0-9]+\.[0-9]+% +$1" > /dev/null 2>&1 } +arm_cs_report() { + if [ $2 != 0 ]; then + echo "$1: FAIL" + glb_err=$2 + else + echo "$1: PASS" + fi +} + is_device_sink() { # If the node of "enable_sink" is existed under the device path, this # means the device is a sink device. Need to exclude 'tpiu' since it @@ -113,9 +123,7 @@ arm_cs_iterate_devices() { perf_report_instruction_samples touch err=$? - - # Exit when find failure - [ $err != 0 ] && exit $err + arm_cs_report "CoreSight path testing (CPU$2 -> $device_name)" $err fi arm_cs_iterate_devices $dev $2 @@ -143,9 +151,7 @@ arm_cs_etm_system_wide_test() { perf_report_instruction_samples perf err=$? - - # Exit when find failure - [ $err != 0 ] && exit $err + arm_cs_report "CoreSight system wide testing" $err } arm_cs_etm_snapshot_test() { @@ -169,12 +175,10 @@ arm_cs_etm_snapshot_test() { perf_report_instruction_samples dd err=$? - - # Exit when find failure - [ $err != 0 ] && exit $err + arm_cs_report "CoreSight snapshot testing" $err } arm_cs_etm_traverse_path_test arm_cs_etm_system_wide_test arm_cs_etm_snapshot_test -exit 0 +exit $glb_err |