]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
perf trace: Skip unnecessary synthesis for summary-only mode
authorNamhyung Kim <namhyung@kernel.org>
Wed, 1 Apr 2026 23:05:09 +0000 (16:05 -0700)
committerNamhyung Kim <namhyung@kernel.org>
Thu, 2 Apr 2026 19:51:09 +0000 (12:51 -0700)
It needs to synthesize task info for the comm name.  The mmap
information is only needed for callchain symbolization which is not used
by the summary mode.  Also total or cgroup summary mode don't require
the task info.  Let's skip the processing if possible.

Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/builtin-trace.c

index f487fbaa0ad60028633685527303aa3474b078d6..d121640ace6e14561d50fc71c69c9adb6d7cb34d 100644 (file)
@@ -2004,9 +2004,13 @@ static int trace__symbols_init(struct trace *trace, int argc, const char **argv,
        if (err < 0)
                goto out;
 
+       if (trace->summary_only && trace->summary_mode != SUMMARY__BY_THREAD)
+               goto out;
+
        err = __machine__synthesize_threads(trace->host, &trace->tool, &trace->opts.target,
                                            evlist->core.threads, trace__tool_process,
-                                           /*needs_mmap=*/callchain_param.enabled,
+                                           /*needs_mmap=*/callchain_param.enabled &&
+                                                          !trace->summary_only,
                                            /*mmap_data=*/false,
                                            /*nr_threads_synthesize=*/1);
 out: