From: Namhyung Kim <namhyung@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>,
Ian Rogers <irogers@google.com>,
James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>,
Adrian Hunter <adrian.hunter@intel.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
linux-perf-users@vger.kernel.org,
Howard Chu <howardchu95@gmail.com>
Subject: [PATCH] perf trace: Skip unnecessary synthesis for summary-only mode
Date: Mon, 30 Mar 2026 13:14:39 -0700 [thread overview]
Message-ID: <20260330201439.689899-1-namhyung@kernel.org> (raw)
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.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/perf/builtin-trace.c | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index f487fbaa0ad60028..d09d78b3222717d1 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -2004,11 +2004,23 @@ static int trace__symbols_init(struct trace *trace, int argc, const char **argv,
if (err < 0)
goto out;
- err = __machine__synthesize_threads(trace->host, &trace->tool, &trace->opts.target,
- evlist->core.threads, trace__tool_process,
- /*needs_mmap=*/callchain_param.enabled,
- /*mmap_data=*/false,
- /*nr_threads_synthesize=*/1);
+ if (trace->summary_only) {
+ if (trace->summary_mode == SUMMARY__BY_THREAD) {
+ err = __machine__synthesize_threads(trace->host, &trace->tool,
+ &trace->opts.target,
+ evlist->core.threads,
+ trace__tool_process,
+ /*needs_mmap=*/false,
+ /*mmap_data=*/false,
+ /*nr_threads_synthesize=*/1);
+ }
+ } else {
+ err = __machine__synthesize_threads(trace->host, &trace->tool, &trace->opts.target,
+ evlist->core.threads, trace__tool_process,
+ /*needs_mmap=*/callchain_param.enabled,
+ /*mmap_data=*/false,
+ /*nr_threads_synthesize=*/1);
+ }
out:
if (err) {
perf_env__exit(&trace->host_env);
--
2.53.0.1185.g05d4b7b318-goog
next reply other threads:[~2026-03-30 20:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-30 20:14 Namhyung Kim [this message]
2026-03-30 21:00 ` [PATCH] perf trace: Skip unnecessary synthesis for summary-only mode Ian Rogers
2026-03-31 7:07 ` Namhyung Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260330201439.689899-1-namhyung@kernel.org \
--to=namhyung@kernel.org \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=howardchu95@gmail.com \
--cc=irogers@google.com \
--cc=james.clark@linaro.org \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox