From: Namhyung Kim <namhyung@kernel.org>
To: Andi Kleen <ak@linux.intel.com>
Cc: acme@kernel.org, linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v2 3/4] perf tools: Add support for displaying weights in annotate
Date: Fri, 14 Aug 2026 15:19:45 +0900 [thread overview]
Message-ID: <an6zgXlyzPZ_2pI-@google.com> (raw)
In-Reply-To: <20260813211109.240689-4-ak@linux.intel.com>
Hi Andi,
On Thu, Aug 13, 2026 at 02:10:09PM -0700, Andi Kleen wrote:
> Add support for showing all the three possible per IP weights in
> annotate. The weights are shown by defaults if any are non zero. This
> is useful, especially with the new insn lat statistics, but also
> for all the existing weights.
>
> Add a hotkey to the interactive browser to turn them off (w), as well
> as a perf annotate command line option.
>
> The weights are stored unconditionally in the sym_hist_entry, which
> will increase memory consumption somewhat.
>
> Assisted-by: omp:GPT-5.6-Luna
> Signed-off-by: Andi Kleen <ak@linux.intel.com>
> ---
> tools/perf/Documentation/perf-annotate.txt | 3 +
> tools/perf/builtin-annotate.c | 3 +
> tools/perf/builtin-report.c | 1 +
> tools/perf/ui/browsers/annotate.c | 17 ++-
> tools/perf/util/annotate.c | 117 ++++++++++++++++++---
> tools/perf/util/annotate.h | 32 +++++-
> tools/perf/util/symbol.c | 1 +
> tools/perf/util/symbol_conf.h | 17 ++-
> 8 files changed, 170 insertions(+), 21 deletions(-)
>
> diff --git a/tools/perf/Documentation/perf-annotate.txt b/tools/perf/Documentation/perf-annotate.txt
> index a688738809c4..50c6ea680d0d 100644
> --- a/tools/perf/Documentation/perf-annotate.txt
> +++ b/tools/perf/Documentation/perf-annotate.txt
> @@ -79,6 +79,9 @@ include::itrace.txt[]
>
> --stdio:: Use the stdio interface.
>
> +--no-weights:: Hide weight columns in annotation output. By default, weight columns
> + are shown when samples contain non-zero weights.
> +
> --stdio2:: Use the stdio2 interface, non-interactive, uses the TUI formatting.
>
> --stdio-color=<mode>::
> diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
> index 69cb72b2082a..c6c481145e45 100644
> --- a/tools/perf/builtin-annotate.c
> +++ b/tools/perf/builtin-annotate.c
> @@ -259,6 +259,7 @@ static int add_sample(struct perf_sample *sample,
> return 0;
> }
>
> +
> /*
> * XXX filtered samples can still have branch entries pointing into our
> * symbol and are missed.
> @@ -719,6 +720,8 @@ int cmd_annotate(int argc, const char **argv)
> OPT_BOOLEAN(0, "tui", &annotate.use_tui, "Use the TUI interface"),
> #endif
> OPT_BOOLEAN(0, "stdio", &annotate.use_stdio, "Use the stdio interface"),
> + OPT_BOOLEAN(0, "no-weights", &symbol_conf.hide_weight,
> + "Hide weight columns in annotation"),
Can it be just "weights"? Then we would get --no-weights for free. :)
Of course, the help message needs to say differently.
Thanks,
Namhyung
> OPT_BOOLEAN(0, "stdio2", &annotate.use_stdio2, "Use the stdio interface"),
> OPT_BOOLEAN(0, "ignore-vmlinux", &symbol_conf.ignore_vmlinux,
> "don't load vmlinux even if found"),
next prev parent reply other threads:[~2026-08-14 6:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-13 21:10 Updated patchkit to show weights in annotation Andi Kleen
2026-08-13 21:10 ` [PATCH v2 1/4] perf tools record: Modernize -W man page Andi Kleen
2026-08-14 1:03 ` sashiko-bot
2026-08-13 21:10 ` [PATCH v2 2/4] perf tools top: Add --weight option Andi Kleen
2026-08-14 1:08 ` sashiko-bot
2026-08-13 21:10 ` [PATCH v2 3/4] perf tools: Add support for displaying weights in annotate Andi Kleen
2026-08-14 1:28 ` sashiko-bot
2026-08-14 6:19 ` Namhyung Kim [this message]
2026-08-13 21:10 ` [PATCH v2 4/4] perf tools: Add test for weight annotation Andi Kleen
2026-08-14 1:38 ` sashiko-bot
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=an6zgXlyzPZ_2pI-@google.com \
--to=namhyung@kernel.org \
--cc=acme@kernel.org \
--cc=ak@linux.intel.com \
--cc=linux-perf-users@vger.kernel.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