From: Ian Rogers Date: Wed, 3 Dec 2025 21:47:00 +0000 (-0800) Subject: perf stat: Allow no events to open if this is a "--null" run X-Git-Tag: v6.18.2~84 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=850f134a4c81954f95f0eafe49e80fece82b11ba;p=thirdparty%2Fkernel%2Fstable.git perf stat: Allow no events to open if this is a "--null" run [ Upstream commit 6744c0b182c1f371135bc3f4e62b96ad884c9f89 ] It is intended that a "--null" run doesn't open any events. Fixes: 2cc7aa995ce9 ("perf stat: Refactor retry/skip/fatal error handling") Tested-by: Ingo Molnar Signed-off-by: Ian Rogers Tested-by: Thomas Richter Signed-off-by: Namhyung Kim Signed-off-by: Sasha Levin --- diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index f1c9d6c94fc50..b6533dcf5465b 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -856,7 +856,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);