From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=180.76.5.236 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796298237; b=ekt6n6B1gVAGDLq3PzTQi5iFP/5Dll90W4jPC6tCUrN0hs8ruVfMVZm4Gh8g9K+AEO/P chC/BV35acZR6ZBuhPnMTWyZNBbEKQGs0uABIHQ0KAYAZsWdh1k3BK8SPupAOeF+ow3m1 PjKAzqTo3f0QqfKa0bMm8rEPo9ZEoVIwPkFefnAHaf3paqLC4tuE5k5UsPSm9ARSEY8OO pmmVLvR4c+s5o80VKeVhAx72z0lU0m6f8uOOzEtNFZWNRd0mXm0SgbUuzAUtxY601Sluv 7DeG+bnMS7TbIedtVxL5YJL/CCXKNT/FHJFzqy5HHwLeIeYb2YAoxQSWHrvvBjGisbw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796298237; h=DMARC-Filter:X-MD-Sfrom:X-MD-SrcIP:From:To:Subject:Date:Message-ID: X-Mailer:MIME-Version:Content-Type:X-Originating-IP:X-ClientProxiedBy: DKIM-Signature; bh=9DrxbnAFlMb8yXhsXJ78odefaXB00wQRmVeQIsiuaQk=; b=g+xIaIvVzfRSqg4ce+6xrtgY+HlDzdyg9J4QCBMweAcvK4PENJPDOsuQuzAaiIKGmXSv mFPbQq+qdkAPCN5fXqjaX2GmFPwAhjvnUgoyTIY5tqMYIsXpJ/uBmfKIEgvXb6Lipcuc/ EzTXjUnNoSSO3HvgpVRiYxhx4xKlOmooyTWws6GeiGzB3fJy5uGFItSh3B/0vWc0RfeB1 9BmTHDrnBgtR8iZCAEv3UOUsYZYZjAEKaQ9sb66WduC9fMeogf9ds3JWpacLNyAC4h9ry n5PzhSrrT9rqACPFsx2WskTyy3o2eRBpTiwteYK3nwq8WhKbpCZ6+cwh1mooKj9JGTw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=baidu.com; spf=pass smtp.mailfrom=baidu.com; dkim=pass header.d=baidu.com header.i=@baidu.com header.a=rsa-sha256 header.s=selector1 header.b=WhF7eybe; arc=none smtp.remote-ip=180.76.5.236 Received: from outbound.baidu.com (outbound.baidu.com [180.76.5.236]) by smtp.subspace.kernel.org (Postfix) with SMTP id 923F1606A322; Thu, 3 Dec 2026 11:43:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 923F1606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=baidu.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baidu.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=baidu.com header.i=@baidu.com header.a=rsa-sha256 header.s=selector1 header.b=WhF7eybe X-MD-Sfrom: lirongqing@baidu.com X-MD-SrcIP: 172.31.50.47 From: lirongqing To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , James Clark , Li RongQing , Zide Chen , , Subject: [PATCH] perf tests x86: Fail the topdown test when event iteration fails Date: Thu, 3 Dec 2026 19:43:35 +0800 Message-ID: <20261203114335.1776-1-lirongqing@baidu.com> X-Mailer: git-send-email 2.17.1 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: bjkjy-exc3.internal.baidu.com (172.31.50.47) To bjkjy-exc3.internal.baidu.com (172.31.50.47) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baidu.com; s=selector1; t=1796298232; bh=9DrxbnAFlMb8yXhsXJ78odefaXB00wQRmVeQIsiuaQk=; h=From:To:Subject:Date:Message-ID:Content-Type; b=WhF7eybehvV7f55CazYmcbODBKbkTNk5M7lR64F5xophOX1S2mPvB/zVg8pQd0/Ga nKPQAEZJoizKwT1MlUXjCcR0meQZQW4qvh0N7+f6LLfdmYIG0xeWER5CYLj9NJ4AbV ZDVe5OCu70BmixYKKOk84uMma+BBylcMmh1Qo25cH6CJnhMtFoAmazGpCEkqceZ84p +QInzgOrc7CPu6ZoK3DcJcBmx6s9JgYpP0K1dkbOMFVmh7opaQglWS+BdYciOZgCca HlxyLXDlNORok//SVYewmf7keTQ35UQtV8ho0LA0zlDavWPG0QBTqlxTx2H2OUEbFy IpCsDuOY/h9zg== From: Li RongQing 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 --- 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