Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1563419 > unrolled thread

[PATCH 2/4] perf hists browser: Add e/c key handlers to expand callchain for current entry

Started byJiri Olsa <jolsa@kernel.org>
First post2017-01-20 10:30 +0100
Last post2017-01-26 16:30 +0100
Articles 5 — 4 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/4] perf hists browser: Add e/c key handlers to expand callchain for current entry Jiri Olsa <jolsa@kernel.org> - 2017-01-20 10:30 +0100
    Re: [PATCH 2/4] perf hists browser: Add e/c key handlers to expand  callchain for current entry Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-01-20 17:50 +0100
      Re: [PATCH 2/4] perf hists browser: Add e/c key handlers to expand  callchain for current entry Jiri Olsa <jolsa@redhat.com> - 2017-01-23 10:10 +0100
    Re: [PATCH 2/4] perf hists browser: Add e/c key handlers to expand  callchain for current entry Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-01-20 17:50 +0100
    [tip:perf/core] perf hists browser: Add e/c hotkeys to  expand/collapse callchain for current entry tip-bot for Jiri Olsa <tipbot@zytor.com> - 2017-01-26 16:30 +0100

#1563419 — [PATCH 2/4] perf hists browser: Add e/c key handlers to expand callchain for current entry

FromJiri Olsa <jolsa@kernel.org>
Date2017-01-20 10:30 +0100
Subject[PATCH 2/4] perf hists browser: Add e/c key handlers to expand callchain for current entry
Message-ID<t1DGa-5sP-19@gated-at.bofh.it>
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>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
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

[toc] | [next] | [standalone]


#1563774 — Re: [PATCH 2/4] perf hists browser: Add e/c key handlers to expand callchain for current entry

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2017-01-20 17:50 +0100
SubjectRe: [PATCH 2/4] perf hists browser: Add e/c key handlers to expand callchain for current entry
Message-ID<t1KxX-1do-1@gated-at.bofh.it>
In reply to#1563419
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 <jolsa@kernel.org>
> > Cc: David Ahern <dsahern@gmail.com>
> > Cc: Namhyung Kim <namhyung@kernel.org>
> > Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
> > 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

[toc] | [prev] | [next] | [standalone]


#1564792 — Re: [PATCH 2/4] perf hists browser: Add e/c key handlers to expand callchain for current entry

FromJiri Olsa <jolsa@redhat.com>
Date2017-01-23 10:10 +0100
SubjectRe: [PATCH 2/4] perf hists browser: Add e/c key handlers to expand callchain for current entry
Message-ID<t2INs-4wN-35@gated-at.bofh.it>
In reply to#1563774
On Fri, Jan 20, 2017 at 01:43:26PM -0300, Arnaldo Carvalho de Melo wrote:
> 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.

yep, that was my impression also, but wanted to keep the current way

I think we could use only C/c keys to toggle 'collapse all'/'collapse current'

thanks,
jirka

[toc] | [prev] | [next] | [standalone]


#1563779 — Re: [PATCH 2/4] perf hists browser: Add e/c key handlers to expand callchain for current entry

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2017-01-20 17:50 +0100
SubjectRe: [PATCH 2/4] perf hists browser: Add e/c key handlers to expand callchain for current entry
Message-ID<t1KxX-1do-3@gated-at.bofh.it>
In reply to#1563419
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,

Thanks!

- Arnaldo
 
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> Cc: David Ahern <dsahern@gmail.com>
> Cc: Namhyung Kim <namhyung@kernel.org>
> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
> 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

[toc] | [prev] | [next] | [standalone]


#1567512 — [tip:perf/core] perf hists browser: Add e/c hotkeys to expand/collapse callchain for current entry

Fromtip-bot for Jiri Olsa <tipbot@zytor.com>
Date2017-01-26 16:30 +0100
Subject[tip:perf/core] perf hists browser: Add e/c hotkeys to expand/collapse callchain for current entry
Message-ID<t3U9Q-AX-9@gated-at.bofh.it>
In reply to#1563419
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);

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web