[PATCH 2/4] perf tests c2c: Report skip when the workload fails

Jiebin Sun <[email protected]>
Newsgroups org.kernel.vger.linux-perf-users,org.kernel.vger.linux-kernel
Message-ID <7d472dc1b51dbdbf68254535d608c4fb24b75274.1787283281.git.jiebin.sun@intel.com>
The workload path leaves err at 0 and returns, so the test exits 0 and is
reported as a pass even though nothing was recorded and neither report
invocation ran. The check_c2c_support() path above it already sets err=2.

Set err=2 there as well so a failing workload is reported as a skip.

Fixes: ac881007c4bf ("perf tests c2c: Add a basic c2c")
Signed-off-by: Jiebin Sun <[email protected]>
Cc: Dapeng Mi <[email protected]>
Cc: Ian Rogers <[email protected]>
Cc: James Clark <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Thomas Falcon <[email protected]>
Reviewed-by: Tianyou Li <[email protected]>
Reviewed-by: Wangyang Guo <[email protected]>
---
 tools/perf/tests/shell/c2c.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/perf/tests/shell/c2c.sh b/tools/perf/tests/shell/c2c.sh
index 2471d44595c3..f5f223cbf9cc 100755
--- a/tools/perf/tests/shell/c2c.sh
+++ b/tools/perf/tests/shell/c2c.sh
@@ -39,6 +39,7 @@ test_c2c_record_report() {
 	# Run a workload that does some memory operations.
 	if ! perf c2c record -o "${perfdata}" -- perf test -w datasym 1 > /dev/null 2>&1 ; then
 		echo "c2c record and report test [Skipped: perf c2c record failed during workload]"
+		err=2
 		return
 	fi
 
-- 
2.52.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.