linux-stable/tools/perf/ui
Namhyung Kim c29bfda64b perf hists browser: Fix the number of entries for 'e' key
commit f6b8436bed upstream.

The 'e' key is to toggle expand/collapse the selected entry only.  But
the current code has a bug that it only increases the number of entries
by 1 in the hierarchy mode so users cannot move under the current entry
after the key stroke.  This is due to a wrong assumption in the
hist_entry__set_folding().

The commit b33f922651 ("perf hists browser: Put hist_entry folding
logic into single function") factored out the code, but actually it
should be handled separately.  The hist_browser__set_folding() is to
update fold state for each entry so it needs to traverse all (child)
entries regardless of the current fold state.  So it increases the
number of entries by 1.

But the hist_entry__set_folding() only cares the currently selected
entry and its all children.  So it should count all unfolded child
entries.  This code is implemented in hist_browser__toggle_fold()
already so we can just call it.

Fixes: b33f922651 ("perf hists browser: Put hist_entry folding logic into single function")
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20230731094934.1616495-2-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-09-19 12:28:07 +02:00
..
browsers perf hists browser: Fix the number of entries for 'e' key 2023-09-19 12:28:07 +02:00
gtk perf annotate: Re-add annotate_warned functionality 2021-08-03 17:04:04 -03:00
stdio perf report: Print percentage of each event statistics 2021-04-29 10:30:59 -03:00
tui perf ui: Update use of pthread mutex 2022-10-04 08:55:20 -03:00
browser.c perf ui: Update use of pthread mutex 2022-10-04 08:55:20 -03:00
browser.h perf annotate: Fix fused instr logic for assembly functions 2021-09-18 17:43:05 -03:00
Build
helpline.c perf tools: Remove util.h from where it is not needed 2019-09-20 09:19:20 -03:00
helpline.h perf tools: Remove needless evlist.h include directives 2019-08-31 22:24:10 -03:00
hist.c perf hist: Fix memory leak of a perf_hpp_fmt 2021-11-18 10:16:56 -03:00
keysyms.h perf report: Support a new key to reload the browser 2020-03-24 09:37:27 -03:00
libslang.h perf build: Handle slang being in /usr/include and in /usr/include/slang/ 2019-06-18 17:48:12 -03:00
progress.c perf tools: Remove needless evlist.h include directives 2019-08-31 22:24:10 -03:00
progress.h
setup.c perf ui: Update use of pthread mutex 2022-10-04 08:55:20 -03:00
ui.h perf ui: Update use of pthread mutex 2022-10-04 08:55:20 -03:00
util.c perf tools: Fix "kernel lock contention analysis" test by not printing warnings in quiet mode 2022-12-31 13:32:44 +01:00
util.h tools ui popup: Allow returning hotkeys 2020-01-06 11:46:10 -03:00