From: Namhyung Kim Date: Tue, 23 Apr 2024 02:06:43 +0000 (-0700) Subject: perf annotate: Fix data type profiling on stdio X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=2b87383c885c52f051a90574fb857ca3b76b3f5c;p=users%2Fwilly%2Flinux.git perf annotate: Fix data type profiling on stdio 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: d001c7a7f4736743 ("perf annotate-data: Add hist_entry__annotate_data_tui()") Signed-off-by: Namhyung Kim Acked-by: Ian Rogers Cc: Adrian Hunter Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20240423020643.740029-1-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- 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 @@ find_next: return; } - if (next != NULL) + if (use_browser == 0 || next != NULL) nd = next; continue;