linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ian Rogers <irogers@google.com>
Cc: Breno Leitao <leitao@debian.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	leit@meta.com,
	"open list:PERFORMANCE EVENTS SUBSYSTEM"
	<linux-perf-users@vger.kernel.org>,
	"open list:PERFORMANCE EVENTS SUBSYSTEM"
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] perf list: Fix the --no-desc option
Date: Sat, 11 May 2024 14:25:53 -0300	[thread overview]
Message-ID: <Zj-qIbUN2XFBnvP8@x1> (raw)
In-Reply-To: <CAP-5=fXXYVgb4rnftaiTZTEniGOr5NnpfXJFNqX96GXP6=oTiA@mail.gmail.com>

On Sat, May 11, 2024 at 09:11:00AM -0700, Ian Rogers wrote:
>    On Sat, May 11, 2024, 9:00 AM Arnaldo Carvalho de Melo
>    <[1]acme@kernel.org> wrote:
> 
>      On Wed, May 08, 2024 at 06:35:17AM -0700, Breno Leitao wrote:
>      > Currently, the --no-desc option in perf list isn't functioning as
>      > intended.
>      >
>      > This issue arises from the overwriting of struct option->desc with
>      the
>      > opposite value of struct option->long_desc. Consequently, whatever
>      > parse_options() returns at struct option->desc gets overridden
>      later,
>      > rendering the --desc or --no-desc arguments ineffective.
>      >
>      > To resolve this, set ->desc as true by default and allow
>      parse_options()
>      > to adjust it accordingly. This adjustment will fix the --no-desc
>      > option while preserving the functionality of the other parameters.
> 
>      Thanks, applied to perf-tools-next, and added this:
> 
>          Committer testing:
> 
>          Before:
> 
>            $ perf list --no-desc
>            <SNIP>
>            cache:
>              longest_lat_cache.miss
>                   [Counts the number of cacheable memory requests that
>      miss in the LLC. Counts on a per core basis. Unit: cpu_atom]
>              longest_lat_cache.reference
>                   [Counts the number of cacheable memory requests that
>      access the LLC. Counts on a per core basis. Unit: cpu_atom]
>              mem_bound_stalls.ifetch
>                   [Counts the number of cycles the core is stalled due to
>      an instruction cache or TLB miss which hit in the L2,LLC,DRAM or
>      MMIO (Non-DRAM). Unit: cpu_atom]
>              mem_bound_stalls.ifetch_dram_hit
>                   [Counts the number of cycles the core is stalled due to
>      an instruction cache or TLB miss which hit in DRAM or MMIO
>      (Non-DRAM). Unit: cpu_atom]
>              mem_bound_stalls.ifetch_l2_hit
>                   [Counts the number of cycles the core is stalled due to
>      an instruction cache or TLB miss which hit in the L2 cache. Unit:
>      cpu_atom]
>              mem_bound_stalls.ifetch_llc_hit
>                   [Counts the number of cycles the core is stalled due to
>      an instruction cache or TLB miss which hit in the LLC or other core
>      with HITE/F/M. Unit: cpu_atom]
>            <SNIP>
> 
>          After:
> 
>            $ perf list --no-desc
>            <SNIP>
>              cache:
>              longest_lat_cache.miss
>              longest_lat_cache.reference
>              mem_bound_stalls.ifetch
>              mem_bound_stalls.ifetch_dram_hit
>              mem_bound_stalls.ifetch_l2_hit
>              mem_bound_stalls.ifetch_llc_hit
>            <SNIP>
> 
>          Signed-off-by: Breno Leitao <[2]leitao@debian.org>
>          Tested-by: Arnaldo Carvalho de Melo <[3]acme@redhat.com>
> 
>      - Arnaldo
> 
>      > Signed-off-by: Breno Leitao <[4]leitao@debian.org>
>      > ---
>      >  tools/perf/builtin-list.c | 2 +-
>      >  1 file changed, 1 insertion(+), 1 deletion(-)
>      >
>      > diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c
>      > index 02bf608d585e..58589f67e800 100644
>      > --- a/tools/perf/builtin-list.c
>      > +++ b/tools/perf/builtin-list.c
>      > @@ -491,6 +491,7 @@ int cmd_list(int argc, const char **argv)
>      >       int i, ret = 0;
>      >       struct print_state default_ps = {
>      >               .fp = stdout,
>      > +             .desc = true,
>      >       };
>      >       struct print_state json_ps = {
>      >               .fp = stdout,
>      > @@ -563,7 +564,6 @@ int cmd_list(int argc, const char **argv)
>      >               };
>      >               ps = &json_ps;
>      >       } else {
>      > -             default_ps.desc = !default_ps.long_desc;
> 
>    Given this, did you test the long description behavior?

So, without the patch:

perf list
<SNIP>
cache:
  longest_lat_cache.miss
       [Counts the number of cacheable memory requests that miss in the LLC. Counts on a per core basis. Unit: cpu_atom]
<SNIP>

perf list --long-desc
<SNIP>
cache:
  longest_lat_cache.miss
       [Counts the number of cacheable memory requests that miss in the Last Level Cache (LLC). Requests include demand loads,reads for ownership (RFO),instruction fetches and L1 HW
        prefetches. If the platform has an L3 cache,the LLC is the L3 cache,otherwise it is the L2 cache. Counts on a per core basis]
<SNIP>

perf list --no-desc
<SNIP>
cache:
  longest_lat_cache.miss
       [Counts the number of cacheable memory requests that miss in the LLC. Counts on a per core basis. Unit: cpu_atom]
<SNIP>

With Breno's patch the default doesn't change, --no-desc gets fixed but
--long-desc is broken:

perf list --long-desc
<SNIP>
cache:
  longest_lat_cache.miss
       [Counts the number of cacheable memory requests that miss in the LLC. Counts on a per core basis. Unit: cpu_atom]
       [Counts the number of cacheable memory requests that miss in the Last Level Cache (LLC). Requests include demand loads,reads for ownership (RFO),instruction fetches and L1 HW
        prefetches. If the platform has an L3 cache,the LLC is the L3 cache,otherwise it is the L2 cache. Counts on a per core basis]
<SNIP>

Thanks for asking the question, I'm dropping the patch, Breno, can you
try again?

- Arnaldo

  parent reply	other threads:[~2024-05-11 17:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-08 13:35 [PATCH] perf list: Fix the --no-desc option Breno Leitao
2024-05-11 16:00 ` Arnaldo Carvalho de Melo
     [not found]   ` <CAP-5=fXXYVgb4rnftaiTZTEniGOr5NnpfXJFNqX96GXP6=oTiA@mail.gmail.com>
2024-05-11 17:25     ` Arnaldo Carvalho de Melo [this message]
2024-05-13 17:07       ` Breno Leitao
2024-05-13 17:13         ` Ian Rogers
2024-05-13 20:45           ` Breno Leitao
2024-05-13 20:59             ` Ian Rogers

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=Zj-qIbUN2XFBnvP8@x1 \
    --to=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=leit@meta.com \
    --cc=leitao@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@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;
as well as URLs for NNTP newsgroup(s).