linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] perf top/report TUI: Provide visual cue when starting annotation
@ 2025-06-05 21:16 Arnaldo Carvalho de Melo
  2025-06-06  3:14 ` Namhyung Kim
  0 siblings, 1 reply; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2025-06-05 21:16 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Adrian Hunter, Ian Rogers, Ingo Molnar, James Clark, Jiri Olsa,
	Kan Liang, Linux Kernel Mailing List, linux-perf-users

Sometimes it takes a while for the annotation to be presented after
pressing 'a' in the 'perf top'/'report' TUI, provide a visual cue
informing that the annotation has started for that symbol.

This is the quick and most of the time improvement, but for some cases
its better to improve on it by having a cancellable progress bar, which
is now in my TODO list.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/ui/browsers/annotate.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c
index cd1d452035a265d3..66ffeb96db29532c 100644
--- a/tools/perf/ui/browsers/annotate.c
+++ b/tools/perf/ui/browsers/annotate.c
@@ -2,6 +2,7 @@
 #include "../browser.h"
 #include "../helpline.h"
 #include "../ui.h"
+#include "../util.h"
 #include "../../util/annotate.h"
 #include "../../util/debug.h"
 #include "../../util/debuginfo.h"
@@ -1016,6 +1017,7 @@ int __hist_entry__tui_annotate(struct hist_entry *he, struct map_symbol *ms,
 		return -1;
 
 	if (not_annotated || !sym->annotate2) {
+		ui__info_window("Annotating", sym->name);
 		err = symbol__annotate2(ms, evsel, &browser.arch);
 		if (err) {
 			char msg[BUFSIZ];
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] perf top/report TUI: Provide visual cue when starting annotation
  2025-06-05 21:16 [PATCH 1/1] perf top/report TUI: Provide visual cue when starting annotation Arnaldo Carvalho de Melo
@ 2025-06-06  3:14 ` Namhyung Kim
  2025-06-06 15:02   ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 4+ messages in thread
From: Namhyung Kim @ 2025-06-06  3:14 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Adrian Hunter, Ian Rogers, Ingo Molnar, James Clark, Jiri Olsa,
	Kan Liang, Linux Kernel Mailing List, linux-perf-users

On Thu, Jun 05, 2025 at 06:16:20PM -0300, Arnaldo Carvalho de Melo wrote:
> Sometimes it takes a while for the annotation to be presented after
> pressing 'a' in the 'perf top'/'report' TUI, provide a visual cue
> informing that the annotation has started for that symbol.

It's probably because objdump takes long to process DWARF.  I think I
need to update this.

https://lore.kernel.org/linux-perf-users/Z_gunJ9C3H25Uo9Q@google.com/

Thanks,
Namhyung

> 
> This is the quick and most of the time improvement, but for some cases
> its better to improve on it by having a cancellable progress bar, which
> is now in my TODO list.
> 
> Cc: Adrian Hunter <adrian.hunter@intel.com>
> Cc: Ian Rogers <irogers@google.com>
> Cc: Ingo Molnar <mingo@kernel.org>
> Cc: James Clark <james.clark@linaro.org>
> Cc: Jiri Olsa <jolsa@kernel.org>
> Cc: Kan Liang <kan.liang@linux.intel.com>
> Cc: Namhyung Kim <namhyung@kernel.org>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> ---
>  tools/perf/ui/browsers/annotate.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c
> index cd1d452035a265d3..66ffeb96db29532c 100644
> --- a/tools/perf/ui/browsers/annotate.c
> +++ b/tools/perf/ui/browsers/annotate.c
> @@ -2,6 +2,7 @@
>  #include "../browser.h"
>  #include "../helpline.h"
>  #include "../ui.h"
> +#include "../util.h"
>  #include "../../util/annotate.h"
>  #include "../../util/debug.h"
>  #include "../../util/debuginfo.h"
> @@ -1016,6 +1017,7 @@ int __hist_entry__tui_annotate(struct hist_entry *he, struct map_symbol *ms,
>  		return -1;
>  
>  	if (not_annotated || !sym->annotate2) {
> +		ui__info_window("Annotating", sym->name);
>  		err = symbol__annotate2(ms, evsel, &browser.arch);
>  		if (err) {
>  			char msg[BUFSIZ];
> -- 
> 2.49.0
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] perf top/report TUI: Provide visual cue when starting annotation
  2025-06-06  3:14 ` Namhyung Kim
@ 2025-06-06 15:02   ` Arnaldo Carvalho de Melo
  2025-06-06 17:22     ` Namhyung Kim
  0 siblings, 1 reply; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2025-06-06 15:02 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Adrian Hunter, Ian Rogers, Ingo Molnar, James Clark, Jiri Olsa,
	Kan Liang, Linux Kernel Mailing List, linux-perf-users

On Thu, Jun 05, 2025 at 08:14:10PM -0700, Namhyung Kim wrote:
> On Thu, Jun 05, 2025 at 06:16:20PM -0300, Arnaldo Carvalho de Melo wrote:
> > Sometimes it takes a while for the annotation to be presented after
> > pressing 'a' in the 'perf top'/'report' TUI, provide a visual cue
> > informing that the annotation has started for that symbol.
 
> It's probably because objdump takes long to process DWARF.  I think I
> need to update this.
 
> https://lore.kernel.org/linux-perf-users/Z_gunJ9C3H25Uo9Q@google.com/

Humm, in this case I had explicitely asked for using objdump:

root@number:~# cat ~/.perfconfig 
# this file is auto-generated.
[annotate]
	disassemblers = objdump
root@number:~# 

So, yeah, its objdump running but in my case there was no DWARF
involved, it was just a big C++ app, so the ELF files were big and
objdump takes a long time even without DWARF.

One way or the other, your patch switching to use objdump when 's' is
pressed is a good one, please update it :-)

- Arnaldo
 
> Thanks,
> Namhyung
> 
> > 
> > This is the quick and most of the time improvement, but for some cases
> > its better to improve on it by having a cancellable progress bar, which
> > is now in my TODO list.
> > 
> > Cc: Adrian Hunter <adrian.hunter@intel.com>
> > Cc: Ian Rogers <irogers@google.com>
> > Cc: Ingo Molnar <mingo@kernel.org>
> > Cc: James Clark <james.clark@linaro.org>
> > Cc: Jiri Olsa <jolsa@kernel.org>
> > Cc: Kan Liang <kan.liang@linux.intel.com>
> > Cc: Namhyung Kim <namhyung@kernel.org>
> > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> > ---
> >  tools/perf/ui/browsers/annotate.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c
> > index cd1d452035a265d3..66ffeb96db29532c 100644
> > --- a/tools/perf/ui/browsers/annotate.c
> > +++ b/tools/perf/ui/browsers/annotate.c
> > @@ -2,6 +2,7 @@
> >  #include "../browser.h"
> >  #include "../helpline.h"
> >  #include "../ui.h"
> > +#include "../util.h"
> >  #include "../../util/annotate.h"
> >  #include "../../util/debug.h"
> >  #include "../../util/debuginfo.h"
> > @@ -1016,6 +1017,7 @@ int __hist_entry__tui_annotate(struct hist_entry *he, struct map_symbol *ms,
> >  		return -1;
> >  
> >  	if (not_annotated || !sym->annotate2) {
> > +		ui__info_window("Annotating", sym->name);
> >  		err = symbol__annotate2(ms, evsel, &browser.arch);
> >  		if (err) {
> >  			char msg[BUFSIZ];
> > -- 
> > 2.49.0
> > 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] perf top/report TUI: Provide visual cue when starting annotation
  2025-06-06 15:02   ` Arnaldo Carvalho de Melo
@ 2025-06-06 17:22     ` Namhyung Kim
  0 siblings, 0 replies; 4+ messages in thread
From: Namhyung Kim @ 2025-06-06 17:22 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Adrian Hunter, Ian Rogers, Ingo Molnar, James Clark, Jiri Olsa,
	Kan Liang, Linux Kernel Mailing List, linux-perf-users

On Fri, Jun 06, 2025 at 12:02:01PM -0300, Arnaldo Carvalho de Melo wrote:
> On Thu, Jun 05, 2025 at 08:14:10PM -0700, Namhyung Kim wrote:
> > On Thu, Jun 05, 2025 at 06:16:20PM -0300, Arnaldo Carvalho de Melo wrote:
> > > Sometimes it takes a while for the annotation to be presented after
> > > pressing 'a' in the 'perf top'/'report' TUI, provide a visual cue
> > > informing that the annotation has started for that symbol.
>  
> > It's probably because objdump takes long to process DWARF.  I think I
> > need to update this.
>  
> > https://lore.kernel.org/linux-perf-users/Z_gunJ9C3H25Uo9Q@google.com/
> 
> Humm, in this case I had explicitely asked for using objdump:
> 
> root@number:~# cat ~/.perfconfig 
> # this file is auto-generated.
> [annotate]
> 	disassemblers = objdump
> root@number:~# 
> 
> So, yeah, its objdump running but in my case there was no DWARF
> involved, it was just a big C++ app, so the ELF files were big and
> objdump takes a long time even without DWARF.

Oh, ok.  I had a problem with DWARF in the past, so assumed the same.

> 
> One way or the other, your patch switching to use objdump when 's' is
> pressed is a good one, please update it :-)

Sure, will do it soon.

Thanks,
Namhyung

> > 
> > > 
> > > This is the quick and most of the time improvement, but for some cases
> > > its better to improve on it by having a cancellable progress bar, which
> > > is now in my TODO list.
> > > 
> > > Cc: Adrian Hunter <adrian.hunter@intel.com>
> > > Cc: Ian Rogers <irogers@google.com>
> > > Cc: Ingo Molnar <mingo@kernel.org>
> > > Cc: James Clark <james.clark@linaro.org>
> > > Cc: Jiri Olsa <jolsa@kernel.org>
> > > Cc: Kan Liang <kan.liang@linux.intel.com>
> > > Cc: Namhyung Kim <namhyung@kernel.org>
> > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> > > ---
> > >  tools/perf/ui/browsers/annotate.c | 2 ++
> > >  1 file changed, 2 insertions(+)
> > > 
> > > diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c
> > > index cd1d452035a265d3..66ffeb96db29532c 100644
> > > --- a/tools/perf/ui/browsers/annotate.c
> > > +++ b/tools/perf/ui/browsers/annotate.c
> > > @@ -2,6 +2,7 @@
> > >  #include "../browser.h"
> > >  #include "../helpline.h"
> > >  #include "../ui.h"
> > > +#include "../util.h"
> > >  #include "../../util/annotate.h"
> > >  #include "../../util/debug.h"
> > >  #include "../../util/debuginfo.h"
> > > @@ -1016,6 +1017,7 @@ int __hist_entry__tui_annotate(struct hist_entry *he, struct map_symbol *ms,
> > >  		return -1;
> > >  
> > >  	if (not_annotated || !sym->annotate2) {
> > > +		ui__info_window("Annotating", sym->name);
> > >  		err = symbol__annotate2(ms, evsel, &browser.arch);
> > >  		if (err) {
> > >  			char msg[BUFSIZ];
> > > -- 
> > > 2.49.0
> > > 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-06-06 17:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-05 21:16 [PATCH 1/1] perf top/report TUI: Provide visual cue when starting annotation Arnaldo Carvalho de Melo
2025-06-06  3:14 ` Namhyung Kim
2025-06-06 15:02   ` Arnaldo Carvalho de Melo
2025-06-06 17:22     ` Namhyung Kim

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).