lkml.org 
[lkml]   [2024]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] perf annotate: Fix data type profiling on stdio
On Mon, Apr 22, 2024 at 7:06 PM Namhyung Kim <namhyung@kernel.org> wrote:
>
> The loop in hists__find_annotations() never set the 'nd' pointer to NULL
> and it makes stdio output repeating the last element forever. I think
> it doesn't set to NULL for TUI to prevent it from exiting unexpectedly.
> But it should just set on stdio mode.
>
> Fixes: d001c7a7f473 ("perf annotate-data: Add hist_entry__annotate_data_tui()")
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>

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

Should we have a test to cover things like this?

Thanks,
Ian

> ---
> tools/perf/builtin-annotate.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
> index 6f7104f06c42..83812b9d5363 100644
> --- a/tools/perf/builtin-annotate.c
> +++ b/tools/perf/builtin-annotate.c
> @@ -491,7 +491,7 @@ static void hists__find_annotations(struct hists *hists,
> return;
> }
>
> - if (next != NULL)
> + if (use_browser == 0 || next != NULL)
> nd = next;
>
> continue;
> --
> 2.44.0.769.g3c40516874-goog
>

\
 
 \ /
  Last update: 2024-05-27 17:59    [W:0.047 / U:1.712 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site