From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753553AbdAZP1u (ORCPT ); Thu, 26 Jan 2017 10:27:50 -0500 Received: from terminus.zytor.com ([65.50.211.136]:47458 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753177AbdAZP1t (ORCPT ); Thu, 26 Jan 2017 10:27:49 -0500 Date: Thu, 26 Jan 2017 07:26:36 -0800 From: tip-bot for Jiri Olsa Message-ID: 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 Reply-To: acme@redhat.com, jolsa@kernel.org, a.p.zijlstra@chello.nl, dsahern@gmail.com, linux-kernel@vger.kernel.org, namhyung@kernel.org, dzickus@redhat.com, hpa@zytor.com, jmario@redhat.com, mingo@kernel.org, tglx@linutronix.de In-Reply-To: <1484904032-11040-3-git-send-email-jolsa@kernel.org> References: <1484904032-11040-3-git-send-email-jolsa@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf hists browser: Add e/c hotkeys to expand/collapse callchain for current entry Git-Commit-ID: 0e3fa7a7acdd5f6ec89b3692276e35006c06fb92 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 0e3fa7a7acdd5f6ec89b3692276e35006c06fb92 Gitweb: http://git.kernel.org/tip/0e3fa7a7acdd5f6ec89b3692276e35006c06fb92 Author: Jiri Olsa AuthorDate: Fri, 20 Jan 2017 10:20:30 +0100 Committer: Arnaldo Carvalho de Melo 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 Tested-by: Arnaldo Carvalho de Melo Cc: David Ahern Cc: Don Zickus Cc: Joe Mario Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1484904032-11040-3-git-send-email-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- 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);