]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
perf stat: Allow no events to open if this is a "--null" run
authorIan Rogers <irogers@google.com>
Wed, 3 Dec 2025 21:47:00 +0000 (13:47 -0800)
committerNamhyung Kim <namhyung@kernel.org>
Thu, 4 Dec 2025 08:36:14 +0000 (00:36 -0800)
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 <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>
tools/perf/builtin-stat.c

index 5c06e9b61821d95a696459a0cfb1eb183eca86cb..6410115ed9c5ef1fc2ced854dd98f2255cdbae2f 100644 (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);