All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Ian Rogers <irogers@google.com>,
	Kan Liang <kan.liang@linux.intel.com>,
	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
Subject: Re: [PATCH 5/5] perf annotate: Add --skip-empty option
Date: Mon, 5 Aug 2024 16:22:12 -0300	[thread overview]
Message-ID: <ZrEmZLV0vgU6GUcN@x1> (raw)
In-Reply-To: <20240803211332.1107222-6-namhyung@kernel.org>

On Sat, Aug 03, 2024 at 02:13:32PM -0700, Namhyung Kim wrote:
> Like in perf report, we want to hide empty events in the perf annotate
> output.  This is consistent when the option is set in perf report.
> 
> For example, the following command would use 3 events including dummy.
> 
>   $ perf mem record -a -- perf test -w noploop
> 
>   $ perf evlist
>   cpu/mem-loads,ldlat=30/P
>   cpu/mem-stores/P
>   dummy:u
> 
> Just using perf annotate with --group will show the all 3 events.

Seems unrelated, just before compiling with this patch:

root@x1:~# perf mem record -a -- perf test -w noploop
Memory events are enabled on a subset of CPUs: 4-11
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 10.506 MB perf.data (2775 samples) ]
root@x1:~#

root@x1:~# perf annotate --group --stdio2 sched_clock
root@x1:~# perf annotate --stdio2 sched_clock
Samples: 178  of event 'cpu_atom/mem-stores/P', 4000 Hz, Event count (approx.): 565268, [percent: local period]
sched_clock() /usr/lib/debug/lib/modules/6.8.11-200.fc39.x86_64/vmlinux
Percent      0xffffffff810511e0 <sched_clock>:
               endbr64        
   5.76        incl    pcpu_hot+0x8
   5.47      → callq   sched_clock_noinstr
  88.78        decl    pcpu_hot+0x8
             ↓ je      1e     
             → jmp     __x86_return_thunk
         1e: → callq   __SCT__preempt_schedule_notrace
             → jmp     __x86_return_thunk
root@x1:~# perf annotate --group --stdio2 sched_clock
root@x1:~# perf annotate --group --stdio sched_clock
root@x1:~# perf annotate --group sched_clock
root@x1:~#

root@x1:~# perf evlist
cpu_atom/mem-loads,ldlat=30/P
cpu_atom/mem-stores/P
dummy:u
root@x1:~#

root@x1:~# perf report --header-only | grep cmdline
# cmdline : /home/acme/bin/perf mem record -a -- perf test -w noploop 
root@x1:~#

I thought it would be some hybrid oddity but seems to be just --group
related, seems like it stops if the first event has no samples? Because
it works with another symbol:

root@x1:~# perf annotate --group --stdio2 do_lookup_x | head -25
Samples: 20  of events 'cpu_atom/mem-loads,ldlat=30/P, cpu_atom/mem-stores/P, dummy:u', 4000 Hz, Event count (approx.): 769079, [percent: local period]
do_lookup_x() /usr/lib64/ld-linux-x86-64.so.2
Percent                       0x9900 <do_lookup_x>:       
                                pushq      %rbp                 
                                movq       %rsp,%rbp            
                                pushq      %r15                 
                                pushq      %r14                 
                                pushq      %r13                 
                                pushq      %r12                 
                                pushq      %rbx                 
                                subq       $0x88,%rsp           
                                movq       %rdi,-0x50(%rbp)     
                                movl       8(%r9),%edi          
                                movq       0x10(%rbp),%r12      
                                movq       0x28(%rbp),%r10      
                                movq       %rdx,-0x70(%rbp)     
                                movq       %rcx,-0x58(%rbp)     
                                movq       %rdi,%r11            
   0.00    5.73    0.00         movq       %r8,-0x68(%rbp)      
                                movq       (%r9),%r8            
                                movl       %esi,%eax            
   8.30    0.00    0.00         movl       0x30(%rbp),%r9d      
                                movl       %esi,%r15d           
                                shrl       $6, %eax             
                                movq       %r8,%r13             
root@x1:~#

Just leaving a note here, no time to fully investigate this now,

- Arnaldo

  reply	other threads:[~2024-08-05 19:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-03 21:13 [PATCHSET 0/5] perf annotate: Add --skip-empty option (v1) Namhyung Kim
2024-08-03 21:13 ` [PATCH 1/5] perf annotate: Use al->data_nr if possible Namhyung Kim
2024-08-03 21:13 ` [PATCH 2/5] perf annotate: Set notes->src->nr_events early Namhyung Kim
2024-08-03 21:13 ` [PATCH 3/5] perf annotate: Use annotation__pcnt_width() consistently Namhyung Kim
2024-08-03 21:13 ` [PATCH 4/5] perf annotate: Set al->data_nr using the notes->src->nr_events Namhyung Kim
2024-08-03 21:13 ` [PATCH 5/5] perf annotate: Add --skip-empty option Namhyung Kim
2024-08-05 19:22   ` Arnaldo Carvalho de Melo [this message]
2024-08-05 20:14     ` Namhyung Kim
2024-08-05 20:23       ` Arnaldo Carvalho de Melo
2024-08-05 20:50         ` Namhyung Kim
2024-08-06 13:12           ` Arnaldo Carvalho de Melo
2024-08-07  6:12             ` Namhyung Kim
2024-08-07  6:15               ` [PATCH] perf annotate: Fix --group behavior when leader has no samples Namhyung Kim
2024-08-09 21:15                 ` Arnaldo Carvalho de Melo
2024-08-05 19:26   ` [PATCH 5/5] perf annotate: Add --skip-empty option Arnaldo Carvalho de Melo
2024-08-05 19:26 ` [PATCHSET 0/5] perf annotate: Add --skip-empty option (v1) Arnaldo Carvalho de Melo

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=ZrEmZLV0vgU6GUcN@x1 \
    --to=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.