Skip to content

Commit e6d6abf

Browse files
committed
perf report/top: Make 'e' visible in the help and make it toggle showing callchains
The 'e' and 'c' hotkeys were present for a long time, but not documented in the help window, change 'e' to be a toggle so that it gets consistent with other toggles like '+' and document it in the help window. Keep 'c' as is for people used to it but don't document, as it is easier to just use 'e' to show/hide all the callchains for a top level histogram entry. Reviewed-by: Jiri Olsa <jolsa@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jin Yao <yao.jin@linux.intel.com> Cc: Kan Liang <kan.liang@intel.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Namhyung Kim <namhyung@kernel.org> Link: https://lkml.kernel.org/n/tip-pmyi5x34stlqmyu81rci94x9@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent ea537f2 commit e6d6abf

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tools/perf/ui/browsers/hists.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,11 @@ static bool hist_browser__selection_has_children(struct hist_browser *browser)
407407
return container_of(ms, struct callchain_list, ms)->has_children;
408408
}
409409

410+
static bool hist_browser__he_selection_unfolded(struct hist_browser *browser)
411+
{
412+
return browser->he_selection ? browser->he_selection->unfolded : false;
413+
}
414+
410415
static bool hist_browser__selection_unfolded(struct hist_browser *browser)
411416
{
412417
struct hist_entry *he = browser->he_selection;
@@ -727,7 +732,7 @@ static int hist_browser__handle_hotkey(struct hist_browser *browser, bool warn_l
727732
break;
728733
case 'e':
729734
/* Expand the selected entry. */
730-
hist_browser__set_folding_selected(browser, true);
735+
hist_browser__set_folding_selected(browser, !hist_browser__he_selection_unfolded(browser));
731736
break;
732737
case 'H':
733738
browser->show_headers = !browser->show_headers;
@@ -2942,6 +2947,7 @@ static int perf_evsel__hists_browse(struct evsel *evsel, int nr_events,
29422947
"a Annotate current symbol\n" \
29432948
"C Collapse all callchains\n" \
29442949
"d Zoom into current DSO\n" \
2950+
"e Expand/Collapse main entry callchains\n" \
29452951
"E Expand all callchains\n" \
29462952
"F Toggle percentage of filtered entries\n" \
29472953
"H Display column headers\n" \

0 commit comments

Comments
 (0)