From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753304AbdATQne (ORCPT ); Fri, 20 Jan 2017 11:43:34 -0500 Received: from mail.kernel.org ([198.145.29.136]:56194 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752780AbdATQnc (ORCPT ); Fri, 20 Jan 2017 11:43:32 -0500 Date: Fri, 20 Jan 2017 13:43:26 -0300 From: Arnaldo Carvalho de Melo To: Jiri Olsa Cc: David Ahern , Namhyung Kim , Peter Zijlstra , lkml , Ingo Molnar Subject: Re: [PATCH 2/4] perf hists browser: Add e/c key handlers to expand callchain for current entry Message-ID: <20170120164326.GK14872@kernel.org> References: <1484904032-11040-1-git-send-email-jolsa@kernel.org> <1484904032-11040-3-git-send-email-jolsa@kernel.org> <20170120164133.GJ14872@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170120164133.GJ14872@kernel.org> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Fri, Jan 20, 2017 at 01:41:33PM -0300, Arnaldo Carvalho de Melo escreveu: > Em Fri, Jan 20, 2017 at 10:20:30AM +0100, Jiri Olsa escreveu: > > 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. > > I guess we can start with this but then fix it to collapse just the > subtree, not the whole tree for the current hist_entry, for big > callchains we can have multiple sub(sub)trees, being able to > expand/collapse just from where we are in a callchain seems even better. > > Applying anyway, better than what we have now, Also I think that pressing 'e' on an already expanded tree should mean 'c', i.e. make it a toggle, so that we can go back and forth faster. - Arnaldo > > Signed-off-by: Jiri Olsa > > Cc: David Ahern > > Cc: Namhyung Kim > > Cc: Peter Zijlstra > > Link: http://lkml.kernel.org/n/tip-vbzhy5yje03v9cvxhht90pyc@git.kernel.org > > --- > > 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 8bf18afe2a1f..fc4fb669ceee 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); > > -- > > 2.7.4