perf stat: Allow no events to open if this is a "--null" run

It is intended that a "--null" run doesn't open any events.

Fixes: 2cc7aa995c ("perf stat: Refactor retry/skip/fatal error handling")
Tested-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Ian Rogers <irogers@google.com>
Tested-by: Thomas Richter <tmricht@linux.ibm.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
This commit is contained in:
Ian Rogers 2025-12-03 13:47:00 -08:00 committed by Namhyung Kim
parent b58261584d
commit 6744c0b182

View File

@ -923,7 +923,7 @@ static int __run_perf_stat(int argc, const char **argv, int run_idx)
goto err_out;
}
}
if (!has_supported_counters) {
if (!has_supported_counters && !stat_config.null_run) {
evsel__open_strerror(evlist__first(evsel_list), &target, open_err,
msg, sizeof(msg));
ui__error("No supported events found.\n%s\n", msg);