From: Ian Rogers Date: Wed, 12 Nov 2025 19:53:10 +0000 (-0800) Subject: perf test: Don't fail if user rdpmc returns 0 when disabled X-Git-Tag: v6.19-rc1~61^2~106 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=efee18981aeebc14d6fa06f7556a6df1bd1acf92;p=thirdparty%2Flinux.git perf test: Don't fail if user rdpmc returns 0 when disabled In certain hypervisor set ups the value 0 may be returned but this is only erroneous if the user rdpmc isn't disabled. Signed-off-by: Ian Rogers Signed-off-by: Namhyung Kim --- diff --git a/tools/perf/tests/mmap-basic.c b/tools/perf/tests/mmap-basic.c index 3c89d30018874..3313c236104ee 100644 --- a/tools/perf/tests/mmap-basic.c +++ b/tools/perf/tests/mmap-basic.c @@ -322,7 +322,7 @@ static int test_stat_user_read(u64 event, enum user_read_state enabled) } perf_evsel__read(evsel, 0, 0, &counts); - if (counts.val == 0) { + if (rdpmc_supported && counts.val == 0) { pr_err("User space counter reading for PMU %s [Failed read]\n", pmu->name); ret = TEST_FAIL; goto cleanup;