From: lirongqing <lirongqing@baidu.com>
To: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
Adrian Hunter <adrian.hunter@intel.com>,
James Clark <james.clark@linaro.org>,
Li RongQing <lirongqing@baidu.com>,
Zide Chen <zide.chen@intel.com>,
<linux-perf-users@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH] perf tests x86: Fail the topdown test when event iteration fails
Date: Thu, 3 Dec 2026 19:43:35 +0800 [thread overview]
Message-ID: <20261203114335.1776-1-lirongqing@baidu.com> (raw)
From: Li RongQing <lirongqing@baidu.com>
The event callback returns -ENOMEM if it cannot allocate an evlist,
without updating the test result. The caller only breaks the PMU loop
on an iteration error and can return its initial TEST_OK value despite
having aborted the checks.
Return TEST_FAIL when iteration fails, retaining the callback result
for successful iterations. Identified and fixed with Comate assistance.
Fixes: 5b546de9cc17 ("perf topdown: Use attribute to see an event is a topdown metic or slots")
Signed-off-by: Li RongQing <lirongqing@baidu.com>
---
tools/perf/arch/x86/tests/topdown.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/arch/x86/tests/topdown.c b/tools/perf/arch/x86/tests/topdown.c
index 5200753..33803b2 100644
--- a/tools/perf/arch/x86/tests/topdown.c
+++ b/tools/perf/arch/x86/tests/topdown.c
@@ -72,7 +72,7 @@ static int test__x86_topdown(struct test_suite *test __maybe_unused, int subtest
while ((pmu = perf_pmus__scan_core(pmu)) != NULL) {
if (perf_pmu__for_each_event(pmu, /*skip_duplicate_pmus=*/false, &ret, event_cb))
- break;
+ return TEST_FAIL;
}
return ret;
}
--
2.9.4
reply other threads:[~2026-12-03 11:43 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261203114335.1776-1-lirongqing@baidu.com \
--to=lirongqing@baidu.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=irogers@google.com \
--cc=james.clark@linaro.org \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=zide.chen@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®