mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Tengda Wu <wutengda@huaweicloud.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	james.clark@linaro.org, xueshuai@linux.alibaba.com,
	Peter Zijlstra <peterz@infradead.org>,
	leo.yan@linux.dev, Li Huafei <lihuafei1@huawei.com>,
	Ian Rogers <irogers@google.com>,
	Kim Phillips <kim.phillips@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ingo Molnar <mingo@redhat.com>, Bill Wendling <morbo@google.com>,
	Nick Desaulniers <nick.desaulniers+lkml@gmail.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Zecheng Li <zli94@ncsu.edu>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	llvm@lists.linux.dev
Subject: Re: [PATCH] perf annotate-data: Show event name in the data-type title
Date: Wed, 4 Nov 2026 21:07:48 -0800	[thread overview]
Message-ID: <auwPJIaRjtfQJdta@z2> (raw)
In-Reply-To: <20261029071510.460873-1-wutengda@huaweicloud.com>

On Thu, Oct 29, 2026 at 07:15:10AM +0000, Tengda Wu wrote:
> The same data type can be annotated for multiple sampling events, in
> which case the data-type header is printed once per event.  But the
> header only shows the type name and the sample count, so several
> identical-looking headers are emitted and the user cannot tell which
> event each of them corresponds to. E.g.
> 
>   $ perf annotate --data-type=page --stdio --itrace=f
>   Annotate type: 'struct page' in [kernel.kallsyms] (59208 samples):
>   ============================================================================
>    Percent     offset       size  field
>     100.00          0       0x40  struct page      {
>       9.95          0        0x8      long unsigned int   flags;
> 
>   Annotate type: 'struct page' in [kernel.kallsyms] (59480 samples):
>   ============================================================================
>    Percent     offset       size  field
>     100.00          0       0x40  struct page      {
>      10.15          0        0x8      long unsigned int   flags;
> 
> Add the event name to the data-type title in both the TUI browser and
> the stdio output, so each header can be attributed to its event.  For
> group events, use evsel__group_desc() to print the group description
> instead of the leader's name, so the whole group is identified.
> 
> While at it, size the underline in the stdio output dynamically based
> on the length of the header line instead of using a fixed-width string,
> so it keeps matching the header as the text grows.
> 
> Result:
> 
>   $ perf annotate --data-type=page --stdio --itrace=f
>   Annotate type: 'struct page' in [kernel.kallsyms] for l1d-miss (59208 samples):
>   ===============================================================================
>    Percent     offset       size  field
>     100.00          0       0x40  struct page      {
>       9.95          0        0x8      long unsigned int   flags;
> 
>   Annotate type: 'struct page' in [kernel.kallsyms] for l1d-access (59480 samples):
>   =================================================================================
>    Percent     offset       size  field
>     100.00          0       0x40  struct page      {
>      10.15          0        0x8      long unsigned int   flags;
> 
> Signed-off-by: Tengda Wu <wutengda@huaweicloud.com>

Applied to perf-tools-next, thanks!

Best regards
Namhyung

      parent reply	other threads:[~2026-11-05  5:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-29  7:15 Tengda Wu
2026-10-31  6:09 ` Namhyung Kim
2026-11-05  5:07 ` Namhyung Kim [this message]

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=auwPJIaRjtfQJdta@z2 \
    --to=namhyung@kernel.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=kim.phillips@arm.com \
    --cc=leo.yan@linux.dev \
    --cc=lihuafei1@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=morbo@google.com \
    --cc=nick.desaulniers+lkml@gmail.com \
    --cc=peterz@infradead.org \
    --cc=wutengda@huaweicloud.com \
    --cc=xueshuai@linux.alibaba.com \
    --cc=zli94@ncsu.edu \
    /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

all inboxes | Powered by JetHome®