linux/tools/perf/ui
James Clark 74802634e4 perf annotate: Fix crashes on empty annotate windows
Annotate can open with an empty window if the disassembly tool fails.
After the linked change, the TUI started assuming there was a current
annotation line and could assert or segfault in the seek, refresh, and
source-toggle paths.

Handle empty annotate windows explicitly: set the asm entry count before
resetting the browser, return early when refreshing an empty list, and
ignore source line toggle when there is no current annotation line.

Fixes the following when opening an annotation:

  perf: ui/browser.c:125: ui_browser__list_head_seek: Assertion `pos != NULL' failed.
  Aborted

Fixes: e201757f7a ("perf annotate: Fix source code annotate with objdump")
Assisted-by: GitHub Copilot:GPT-5.4
Signed-off-by: James Clark <james.clark@linaro.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2026-06-04 11:13:25 -03:00
..
browsers perf annotate: Fix crashes on empty annotate windows 2026-06-04 11:13:25 -03:00
gtk perf annotate: Prefer passing evsel to evsel->core.idx 2025-01-18 10:02:10 -08:00
stdio perf hist: Support multi-line header 2025-05-02 15:36:14 -03:00
tui perf debug: Add function symbols to dump_stack 2025-06-25 10:59:19 -07:00
browser.c perf annotate: Fix crashes on empty annotate windows 2026-06-04 11:13:25 -03:00
browser.h perf evlist: Change env variable to session 2025-07-25 10:37:56 -07:00
Build perf ui browser: Add key_name() helper 2025-04-10 10:45:37 -03:00
helpline.c
helpline.h
hist.c perf auxtrace: Remove errno.h from auxtrace.h and fix transitive dependencies 2025-11-13 23:03:11 -08:00
keysyms.c perf ui browser: Add key_name() helper 2025-04-10 10:45:37 -03:00
keysyms.h perf ui browser: Add key_name() helper 2025-04-10 10:45:37 -03:00
libslang.h tools build: Remove feature-libslang-include-subdir 2025-10-03 16:49:51 -03:00
progress.c
progress.h
setup.c perf ui: Move window resize signal functions 2023-04-10 19:20:38 -03:00
ui.h perf ui: Move window resize signal functions 2023-04-10 19:20:38 -03:00
util.c perf tools: Fix "kernel lock contention analysis" test by not printing warnings in quiet mode 2022-10-27 16:37:26 -03:00
util.h