[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-0e3fa7a7acdd5f6ec89b3692276e35006c06fb92@git.kernel.org>
Date: Thu, 26 Jan 2017 07:26:36 -0800
From: tip-bot for Jiri Olsa <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: jmario@...hat.com, tglx@...utronix.de, mingo@...nel.org,
hpa@...or.com, namhyung@...nel.org, dzickus@...hat.com,
linux-kernel@...r.kernel.org, a.p.zijlstra@...llo.nl,
dsahern@...il.com, acme@...hat.com, jolsa@...nel.org
Subject: [tip:perf/core] perf hists browser: Add e/c hotkeys to
expand/collapse callchain for current entry
Commit-ID: 0e3fa7a7acdd5f6ec89b3692276e35006c06fb92
Gitweb: http://git.kernel.org/tip/0e3fa7a7acdd5f6ec89b3692276e35006c06fb92
Author: Jiri Olsa <jolsa@...nel.org>
AuthorDate: Fri, 20 Jan 2017 10:20:30 +0100
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Fri, 20 Jan 2017 13:37:26 -0300
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: Jiri Olsa <jolsa@...nel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: David Ahern <dsahern@...il.com>
Cc: Don Zickus <dzickus@...hat.com>
Cc: Joe Mario <jmario@...hat.com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Link: http://lkml.kernel.org/r/1484904032-11040-3-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/ui/browsers/hists.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index 8bf18af..fc4fb66 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -571,6 +571,15 @@ static void hist_browser__set_folding(struct hist_browser *browser, bool unfold)
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)
{
ui_browser__warning(browser, 4,
@@ -644,10 +653,18 @@ int hist_browser__run(struct hist_browser *browser, const char *help)
/* Collapse the whole world. */
hist_browser__set_folding(browser, false);
break;
+ case 'c':
+ /* Collapse the selected entry. */
+ hist_browser__set_folding_selected(browser, false);
+ break;
case 'E':
/* Expand the whole world. */
hist_browser__set_folding(browser, true);
break;
+ case 'e':
+ /* Expand the selected entry. */
+ hist_browser__set_folding_selected(browser, true);
+ break;
case 'H':
browser->show_headers = !browser->show_headers;
hist_browser__update_rows(browser);
Powered by blists - more mailing lists