Commit 0e3fa7a7 authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo

perf hists browser: Add e/c hotkeys to expand/collapse callchain for current entry

Currently we allow only to expand or collapse all entries in the browser
with 'E' or 'C' keys. Allow user to expand or collapse only current
entry in the browser with e or c key.
Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Joe Mario <jmario@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1484904032-11040-3-git-send-email-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent b33f9226
...@@ -571,6 +571,15 @@ static void hist_browser__set_folding(struct hist_browser *browser, bool unfold) ...@@ -571,6 +571,15 @@ static void hist_browser__set_folding(struct hist_browser *browser, bool unfold)
ui_browser__reset_index(&browser->b); ui_browser__reset_index(&browser->b);
} }
static void hist_browser__set_folding_selected(struct hist_browser *browser, bool unfold)
{
if (!browser->he_selection)
return;
hist_entry__set_folding(browser->he_selection, browser, unfold);
browser->b.nr_entries = hist_browser__nr_entries(browser);
}
static void ui_browser__warn_lost_events(struct ui_browser *browser) static void ui_browser__warn_lost_events(struct ui_browser *browser)
{ {
ui_browser__warning(browser, 4, ui_browser__warning(browser, 4,
...@@ -644,10 +653,18 @@ int hist_browser__run(struct hist_browser *browser, const char *help) ...@@ -644,10 +653,18 @@ int hist_browser__run(struct hist_browser *browser, const char *help)
/* Collapse the whole world. */ /* Collapse the whole world. */
hist_browser__set_folding(browser, false); hist_browser__set_folding(browser, false);
break; break;
case 'c':
/* Collapse the selected entry. */
hist_browser__set_folding_selected(browser, false);
break;
case 'E': case 'E':
/* Expand the whole world. */ /* Expand the whole world. */
hist_browser__set_folding(browser, true); hist_browser__set_folding(browser, true);
break; break;
case 'e':
/* Expand the selected entry. */
hist_browser__set_folding_selected(browser, true);
break;
case 'H': case 'H':
browser->show_headers = !browser->show_headers; browser->show_headers = !browser->show_headers;
hist_browser__update_rows(browser); hist_browser__update_rows(browser);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment