[PATCH v2 1/7] perf test: Check result of has_event(cycles) test

James Clark james.clark at arm.com
Mon Sep 4 02:50:43 PDT 2023


Currently the function always returns 0, so even when the has_event()
test fails, the test still passes. Fix it by returning ret instead.

Reviewed-by: Ian Rogers <irogers at google.com>
Signed-off-by: James Clark <james.clark at arm.com>
---
 tools/perf/tests/expr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/tests/expr.c b/tools/perf/tests/expr.c
index 81229fa4f1e9..39be7f3b3a53 100644
--- a/tools/perf/tests/expr.c
+++ b/tools/perf/tests/expr.c
@@ -263,7 +263,7 @@ static int test__expr(struct test_suite *t __maybe_unused, int subtest __maybe_u
 
 	expr__ctx_free(ctx);
 
-	return 0;
+	return ret;
 }
 
 DEFINE_SUITE("Simple expression parser", expr);
-- 
2.34.1




More information about the linux-arm-kernel mailing list