linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf annotate-data: Check annotation on perf report TUI
@ 2024-04-24 23:00 Namhyung Kim
  2024-04-25  3:18 ` Ian Rogers
  2024-04-25 13:55 ` Arnaldo Carvalho de Melo
  0 siblings, 2 replies; 3+ messages in thread
From: Namhyung Kim @ 2024-04-24 23:00 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Ian Rogers, Kan Liang
  Cc: Jiri Olsa, Adrian Hunter, Peter Zijlstra, Ingo Molnar, LKML,
	linux-perf-users

As it removed the sample accounting for code when no symbol sort key is
given for perf report TUI, it might not allocate the annotated_source
yet.  Let's check if it's NULL first.

Fixes: 6cdd977ec24e1 ("perf report: Do not collect sample histogram unnecessarily")
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/util/annotate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index dca2c08ab8c5..f5b6b5e5e757 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -906,7 +906,7 @@ int symbol__annotate(struct map_symbol *ms, struct evsel *evsel,
 	if (parch)
 		*parch = arch;
 
-	if (!list_empty(&notes->src->source))
+	if (notes->src && !list_empty(&notes->src->source))
 		return 0;
 
 	args.arch = arch;
-- 
2.44.0.769.g3c40516874-goog


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

* Re: [PATCH] perf annotate-data: Check annotation on perf report TUI
  2024-04-24 23:00 [PATCH] perf annotate-data: Check annotation on perf report TUI Namhyung Kim
@ 2024-04-25  3:18 ` Ian Rogers
  2024-04-25 13:55 ` Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 3+ messages in thread
From: Ian Rogers @ 2024-04-25  3:18 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Arnaldo Carvalho de Melo, Kan Liang, Jiri Olsa, Adrian Hunter,
	Peter Zijlstra, Ingo Molnar, LKML, linux-perf-users

On Wed, Apr 24, 2024 at 4:00 PM Namhyung Kim <namhyung@kernel.org> wrote:
>
> As it removed the sample accounting for code when no symbol sort key is
> given for perf report TUI, it might not allocate the annotated_source
> yet.  Let's check if it's NULL first.
>
> Fixes: 6cdd977ec24e1 ("perf report: Do not collect sample histogram unnecessarily")
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>

Reviewed-by: Ian Rogers <irogers@google.com>

Thanks,
Ian

> ---
>  tools/perf/util/annotate.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
> index dca2c08ab8c5..f5b6b5e5e757 100644
> --- a/tools/perf/util/annotate.c
> +++ b/tools/perf/util/annotate.c
> @@ -906,7 +906,7 @@ int symbol__annotate(struct map_symbol *ms, struct evsel *evsel,
>         if (parch)
>                 *parch = arch;
>
> -       if (!list_empty(&notes->src->source))
> +       if (notes->src && !list_empty(&notes->src->source))
>                 return 0;
>
>         args.arch = arch;
> --
> 2.44.0.769.g3c40516874-goog
>
>

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

* Re: [PATCH] perf annotate-data: Check annotation on perf report TUI
  2024-04-24 23:00 [PATCH] perf annotate-data: Check annotation on perf report TUI Namhyung Kim
  2024-04-25  3:18 ` Ian Rogers
@ 2024-04-25 13:55 ` Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-04-25 13:55 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Ian Rogers, Kan Liang, Jiri Olsa, Adrian Hunter, Peter Zijlstra,
	Ingo Molnar, LKML, linux-perf-users

On Wed, Apr 24, 2024 at 04:00:15PM -0700, Namhyung Kim wrote:
> As it removed the sample accounting for code when no symbol sort key is
> given for perf report TUI, it might not allocate the annotated_source
> yet.  Let's check if it's NULL first.
> 
> Fixes: 6cdd977ec24e1 ("perf report: Do not collect sample histogram unnecessarily")
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>

Reviewed-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Picking it up into perf-tools-next:

⬢[acme@toolbox perf-tools-next]$ git log torvalds/master.. perf-tools-next | grep 6cdd977ec24e1
commit 6cdd977ec24e1538b35a08bde823a74b69e829f2
⬢[acme@toolbox perf-tools-next]$ 

- Arnaldo

> ---
>  tools/perf/util/annotate.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
> index dca2c08ab8c5..f5b6b5e5e757 100644
> --- a/tools/perf/util/annotate.c
> +++ b/tools/perf/util/annotate.c
> @@ -906,7 +906,7 @@ int symbol__annotate(struct map_symbol *ms, struct evsel *evsel,
>  	if (parch)
>  		*parch = arch;
>  
> -	if (!list_empty(&notes->src->source))
> +	if (notes->src && !list_empty(&notes->src->source))
>  		return 0;
>  
>  	args.arch = arch;
> -- 
> 2.44.0.769.g3c40516874-goog

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

end of thread, other threads:[~2024-04-25 13:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-24 23:00 [PATCH] perf annotate-data: Check annotation on perf report TUI Namhyung Kim
2024-04-25  3:18 ` Ian Rogers
2024-04-25 13:55 ` Arnaldo Carvalho de Melo

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