All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Jiri Olsa <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: jmario@redhat.com, tglx@linutronix.de, mingo@kernel.org,
	hpa@zytor.com, namhyung@kernel.org, dzickus@redhat.com,
	linux-kernel@vger.kernel.org, a.p.zijlstra@chello.nl,
	dsahern@gmail.com, acme@redhat.com, jolsa@kernel.org
Subject: [tip:perf/core] perf hists browser: Add e/c hotkeys to expand/collapse callchain for current entry
Date: Thu, 26 Jan 2017 07:26:36 -0800	[thread overview]
Message-ID: <tip-0e3fa7a7acdd5f6ec89b3692276e35006c06fb92@git.kernel.org> (raw)
In-Reply-To: <1484904032-11040-3-git-send-email-jolsa@kernel.org>

Commit-ID:  0e3fa7a7acdd5f6ec89b3692276e35006c06fb92
Gitweb:     http://git.kernel.org/tip/0e3fa7a7acdd5f6ec89b3692276e35006c06fb92
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Fri, 20 Jan 2017 10:20:30 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.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@kernel.org>
Tested-by: Arnaldo 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.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.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);

  parent reply	other threads:[~2017-01-26 15:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-20  9:20 [PATCH 0/4] perf tools: Few fixes Jiri Olsa
2017-01-20  9:20 ` [PATCH 1/4] perf hists browser: Put hist_entry folding login into single function Jiri Olsa
2017-01-26 15:26   ` [tip:perf/core] perf hists browser: Put hist_entry folding logic " tip-bot for Jiri Olsa
2017-01-20  9:20 ` [PATCH 2/4] perf hists browser: Add e/c key handlers to expand callchain for current entry Jiri Olsa
2017-01-20 16:41   ` Arnaldo Carvalho de Melo
2017-01-20 16:43     ` Arnaldo Carvalho de Melo
2017-01-23  9:01       ` Jiri Olsa
2017-01-26 15:26   ` tip-bot for Jiri Olsa [this message]
2017-01-20  9:20 ` [PATCH 3/4] perf c2c report: Display Total records column in offset view Jiri Olsa
2017-01-26 15:27   ` [tip:perf/core] " tip-bot for Jiri Olsa
2017-01-20  9:20 ` [PATCH 4/4] perf c2c report: Coalesce by default only by pid,iaddr Jiri Olsa
2017-01-26 15:27   ` [tip:perf/core] " tip-bot for Jiri Olsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-0e3fa7a7acdd5f6ec89b3692276e35006c06fb92@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=dsahern@gmail.com \
    --cc=dzickus@redhat.com \
    --cc=hpa@zytor.com \
    --cc=jmario@redhat.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.