All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] perf tools: Few fixes
@ 2017-01-20  9:20 Jiri Olsa
  2017-01-20  9:20 ` [PATCH 1/4] perf hists browser: Put hist_entry folding login into single function Jiri Olsa
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Jiri Olsa @ 2017-01-20  9:20 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: lkml, Ingo Molnar, Peter Zijlstra, Namhyung Kim, David Ahern

hi,
sending out few assorted fixes before I loose them ;-)

Available also here:
  git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
  perf/fixes

thanks,
jirka


---
Jiri Olsa (4):
      perf hists browser: Put hist_entry folding login into single function
      perf hists browser: Add e/c key handlers to expand callchain for current entry
      perf c2c report: Display Total records column in offset view
      perf c2c report: Coalesce by default only by pid,iaddr

 tools/perf/Documentation/perf-c2c.txt |  2 +-
 tools/perf/builtin-c2c.c              |  3 ++-
 tools/perf/ui/browsers/hists.c        | 60 ++++++++++++++++++++++++++++++++++++++++++------------------
 3 files changed, 45 insertions(+), 20 deletions(-)

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/4] perf hists browser: Put hist_entry folding login into single function
  2017-01-20  9:20 [PATCH 0/4] perf tools: Few fixes Jiri Olsa
@ 2017-01-20  9:20 ` 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
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 12+ messages in thread
From: Jiri Olsa @ 2017-01-20  9:20 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: David Ahern, Namhyung Kim, Peter Zijlstra, lkml, Ingo Molnar

It will be used in following patch to expand or collapse
only the current entry of the browser.

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-9lh8jzpzuac5ymqnmrm55h3j@git.kernel.org
---
 tools/perf/ui/browsers/hists.c | 43 ++++++++++++++++++++++++------------------
 1 file changed, 25 insertions(+), 18 deletions(-)

diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index 641b40234a9d..8bf18afe2a1f 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -501,8 +501,8 @@ static int hierarchy_set_folding(struct hist_browser *hb, struct hist_entry *he,
 	return n;
 }
 
-static void hist_entry__set_folding(struct hist_entry *he,
-				    struct hist_browser *hb, bool unfold)
+static void __hist_entry__set_folding(struct hist_entry *he,
+				      struct hist_browser *hb, bool unfold)
 {
 	hist_entry__init_have_children(he);
 	he->unfolded = unfold ? he->has_children : false;
@@ -520,12 +520,34 @@ static void hist_entry__set_folding(struct hist_entry *he,
 		he->nr_rows = 0;
 }
 
+static void hist_entry__set_folding(struct hist_entry *he,
+				    struct hist_browser *browser, bool unfold)
+{
+	double percent;
+
+	percent = hist_entry__get_percent_limit(he);
+	if (he->filtered || percent < browser->min_pcnt)
+		return;
+
+	__hist_entry__set_folding(he, browser, unfold);
+
+	if (!he->depth || unfold)
+		browser->nr_hierarchy_entries++;
+	if (he->leaf)
+		browser->nr_callchain_rows += he->nr_rows;
+	else if (unfold && !hist_entry__has_hierarchy_children(he, browser->min_pcnt)) {
+		browser->nr_hierarchy_entries++;
+		he->has_no_entry = true;
+		he->nr_rows = 1;
+	} else
+		he->has_no_entry = false;
+}
+
 static void
 __hist_browser__set_folding(struct hist_browser *browser, bool unfold)
 {
 	struct rb_node *nd;
 	struct hist_entry *he;
-	double percent;
 
 	nd = rb_first(&browser->hists->entries);
 	while (nd) {
@@ -535,21 +557,6 @@ __hist_browser__set_folding(struct hist_browser *browser, bool unfold)
 		nd = __rb_hierarchy_next(nd, HMD_FORCE_CHILD);
 
 		hist_entry__set_folding(he, browser, unfold);
-
-		percent = hist_entry__get_percent_limit(he);
-		if (he->filtered || percent < browser->min_pcnt)
-			continue;
-
-		if (!he->depth || unfold)
-			browser->nr_hierarchy_entries++;
-		if (he->leaf)
-			browser->nr_callchain_rows += he->nr_rows;
-		else if (unfold && !hist_entry__has_hierarchy_children(he, browser->min_pcnt)) {
-			browser->nr_hierarchy_entries++;
-			he->has_no_entry = true;
-			he->nr_rows = 1;
-		} else
-			he->has_no_entry = false;
 	}
 }
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/4] perf hists browser: Add e/c key handlers to expand callchain for current entry
  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-20  9:20 ` Jiri Olsa
  2017-01-20 16:41   ` Arnaldo Carvalho de Melo
  2017-01-26 15:26   ` [tip:perf/core] perf hists browser: Add e/c hotkeys to expand/collapse " tip-bot for Jiri Olsa
  2017-01-20  9:20 ` [PATCH 3/4] perf c2c report: Display Total records column in offset view Jiri Olsa
  2017-01-20  9:20 ` [PATCH 4/4] perf c2c report: Coalesce by default only by pid,iaddr Jiri Olsa
  3 siblings, 2 replies; 12+ messages in thread
From: Jiri Olsa @ 2017-01-20  9:20 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: David Ahern, Namhyung Kim, Peter Zijlstra, lkml, Ingo Molnar

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

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/4] perf c2c report: Display Total records column in offset view
  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-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  9:20 ` 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
  3 siblings, 1 reply; 12+ messages in thread
From: Jiri Olsa @ 2017-01-20  9:20 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: David Ahern, Namhyung Kim, Peter Zijlstra, lkml, Ingo Molnar

Adding "Total records" column into cacheline pareto table,
between cycles and cpu info.

  $ perf c2c report
  ...

  ---    ---------- cycles ----------    Total       cpu
         rmt hitm  lcl hitm      load  records       cnt
  ...    ........  ........  ........  .......  ........

                0       112        71       34         4
                0         0         0       18         1
                0         0         0        2         1
                0       132         0        3         3

  ...

It's useful to see how many recorded samples
represent each offset.

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-kq06b6zjv3uuy1wfhkm3dewc@git.kernel.org
---
 tools/perf/builtin-c2c.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c
index f8ca7a4ebabc..616cb1418c3f 100644
--- a/tools/perf/builtin-c2c.c
+++ b/tools/perf/builtin-c2c.c
@@ -2476,6 +2476,7 @@ static int build_cl_output(char *cl_sort, bool no_source)
 		"mean_rmt,"
 		"mean_lcl,"
 		"mean_load,"
+		"tot_recs,"
 		"cpucnt,",
 		add_sym ? "symbol," : "",
 		add_dso ? "dso," : "",
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 4/4] perf c2c report: Coalesce by default only by pid,iaddr
  2017-01-20  9:20 [PATCH 0/4] perf tools: Few fixes Jiri Olsa
                   ` (2 preceding siblings ...)
  2017-01-20  9:20 ` [PATCH 3/4] perf c2c report: Display Total records column in offset view Jiri Olsa
@ 2017-01-20  9:20 ` Jiri Olsa
  2017-01-26 15:27   ` [tip:perf/core] " tip-bot for Jiri Olsa
  3 siblings, 1 reply; 12+ messages in thread
From: Jiri Olsa @ 2017-01-20  9:20 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: David Ahern, Namhyung Kim, Peter Zijlstra, lkml, Ingo Molnar

It seems to be the most used argument for -c option so far.
In the beginning when you want to have the overall process
report, so it makes sense to make it the default one.

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-70pfa7swi7l3p47qaad0w5ub@git.kernel.org
---
 tools/perf/Documentation/perf-c2c.txt | 2 +-
 tools/perf/builtin-c2c.c              | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/Documentation/perf-c2c.txt b/tools/perf/Documentation/perf-c2c.txt
index 3f06730c7f47..2da07e51e119 100644
--- a/tools/perf/Documentation/perf-c2c.txt
+++ b/tools/perf/Documentation/perf-c2c.txt
@@ -248,7 +248,7 @@ output fields set for caheline offsets output:
              Code address, Code symbol, Shared Object, Source line
   dso   - coalesced by shared object
 
-By default the coalescing is setup with 'pid,tid,iaddr'.
+By default the coalescing is setup with 'pid,iaddr'.
 
 STDIO OUTPUT
 ------------
diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c
index 616cb1418c3f..e2b21723bbf8 100644
--- a/tools/perf/builtin-c2c.c
+++ b/tools/perf/builtin-c2c.c
@@ -58,7 +58,7 @@ struct c2c_hist_entry {
 	struct hist_entry	he;
 };
 
-static char const *coalesce_default = "pid,tid,iaddr";
+static char const *coalesce_default = "pid,iaddr";
 
 struct perf_c2c {
 	struct perf_tool	tool;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/4] perf hists browser: Add e/c key handlers to expand callchain for current entry
  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-26 15:26   ` [tip:perf/core] perf hists browser: Add e/c hotkeys to expand/collapse " tip-bot for Jiri Olsa
  1 sibling, 1 reply; 12+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-01-20 16:41 UTC (permalink / raw)
  To: Jiri Olsa; +Cc: David Ahern, Namhyung Kim, Peter Zijlstra, lkml, Ingo Molnar

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/4] perf hists browser: Add e/c key handlers to expand callchain for current entry
  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
  0 siblings, 1 reply; 12+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-01-20 16:43 UTC (permalink / raw)
  To: Jiri Olsa; +Cc: David Ahern, Namhyung Kim, Peter Zijlstra, lkml, Ingo Molnar

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/4] perf hists browser: Add e/c key handlers to expand callchain for current entry
  2017-01-20 16:43     ` Arnaldo Carvalho de Melo
@ 2017-01-23  9:01       ` Jiri Olsa
  0 siblings, 0 replies; 12+ messages in thread
From: Jiri Olsa @ 2017-01-23  9:01 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Jiri Olsa, David Ahern, Namhyung Kim, Peter Zijlstra, lkml, Ingo Molnar

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [tip:perf/core] perf hists browser: Put hist_entry folding logic into single function
  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-bot for Jiri Olsa
  0 siblings, 0 replies; 12+ messages in thread
From: tip-bot for Jiri Olsa @ 2017-01-26 15:26 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: hpa, linux-kernel, jolsa, mingo, tglx, namhyung, a.p.zijlstra,
	dsahern, acme

Commit-ID:  b33f922651011effafec4508474e8591569a3e98
Gitweb:     http://git.kernel.org/tip/b33f922651011effafec4508474e8591569a3e98
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Fri, 20 Jan 2017 10:20:29 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 20 Jan 2017 10:04:45 -0300

perf hists browser: Put hist_entry folding logic into single function

It will be used in following patch to expand or collapse only the
current browser entry.

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/r/1484904032-11040-2-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/ui/browsers/hists.c | 43 ++++++++++++++++++++++++------------------
 1 file changed, 25 insertions(+), 18 deletions(-)

diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index 641b402..8bf18af 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -501,8 +501,8 @@ static int hierarchy_set_folding(struct hist_browser *hb, struct hist_entry *he,
 	return n;
 }
 
-static void hist_entry__set_folding(struct hist_entry *he,
-				    struct hist_browser *hb, bool unfold)
+static void __hist_entry__set_folding(struct hist_entry *he,
+				      struct hist_browser *hb, bool unfold)
 {
 	hist_entry__init_have_children(he);
 	he->unfolded = unfold ? he->has_children : false;
@@ -520,12 +520,34 @@ static void hist_entry__set_folding(struct hist_entry *he,
 		he->nr_rows = 0;
 }
 
+static void hist_entry__set_folding(struct hist_entry *he,
+				    struct hist_browser *browser, bool unfold)
+{
+	double percent;
+
+	percent = hist_entry__get_percent_limit(he);
+	if (he->filtered || percent < browser->min_pcnt)
+		return;
+
+	__hist_entry__set_folding(he, browser, unfold);
+
+	if (!he->depth || unfold)
+		browser->nr_hierarchy_entries++;
+	if (he->leaf)
+		browser->nr_callchain_rows += he->nr_rows;
+	else if (unfold && !hist_entry__has_hierarchy_children(he, browser->min_pcnt)) {
+		browser->nr_hierarchy_entries++;
+		he->has_no_entry = true;
+		he->nr_rows = 1;
+	} else
+		he->has_no_entry = false;
+}
+
 static void
 __hist_browser__set_folding(struct hist_browser *browser, bool unfold)
 {
 	struct rb_node *nd;
 	struct hist_entry *he;
-	double percent;
 
 	nd = rb_first(&browser->hists->entries);
 	while (nd) {
@@ -535,21 +557,6 @@ __hist_browser__set_folding(struct hist_browser *browser, bool unfold)
 		nd = __rb_hierarchy_next(nd, HMD_FORCE_CHILD);
 
 		hist_entry__set_folding(he, browser, unfold);
-
-		percent = hist_entry__get_percent_limit(he);
-		if (he->filtered || percent < browser->min_pcnt)
-			continue;
-
-		if (!he->depth || unfold)
-			browser->nr_hierarchy_entries++;
-		if (he->leaf)
-			browser->nr_callchain_rows += he->nr_rows;
-		else if (unfold && !hist_entry__has_hierarchy_children(he, browser->min_pcnt)) {
-			browser->nr_hierarchy_entries++;
-			he->has_no_entry = true;
-			he->nr_rows = 1;
-		} else
-			he->has_no_entry = false;
 	}
 }
 

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [tip:perf/core] perf hists browser: Add e/c hotkeys to expand/collapse callchain for current entry
  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-26 15:26   ` tip-bot for Jiri Olsa
  1 sibling, 0 replies; 12+ messages in thread
From: tip-bot for Jiri Olsa @ 2017-01-26 15:26 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: jmario, tglx, mingo, hpa, namhyung, dzickus, linux-kernel,
	a.p.zijlstra, dsahern, acme, jolsa

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);

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [tip:perf/core] perf c2c report: Display Total records column in offset view
  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-bot for Jiri Olsa
  0 siblings, 0 replies; 12+ messages in thread
From: tip-bot for Jiri Olsa @ 2017-01-26 15:27 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: acme, linux-kernel, a.p.zijlstra, namhyung, jolsa, hpa, mingo,
	jmario, dsahern, dzickus, tglx

Commit-ID:  8763e6ac2d368ac9d650df35b00c3af2a7c1878b
Gitweb:     http://git.kernel.org/tip/8763e6ac2d368ac9d650df35b00c3af2a7c1878b
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Fri, 20 Jan 2017 10:20:31 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 20 Jan 2017 16:52:43 -0300

perf c2c report: Display Total records column in offset view

Adding "Total records" column into cacheline pareto table, between
cycles and cpu info.

  $ perf c2c report
  ...

  ---    ---------- cycles ----------    Total       cpu
         rmt hitm  lcl hitm      load  records       cnt
  ...    ........  ........  ........  .......  ........

                0       112        71       34         4
                0         0         0       18         1
                0         0         0        2         1
                0       132         0        3         3

  ...

It's useful to see how many recorded samples represent each offset.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
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-4-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-c2c.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c
index f8ca7a4..616cb14 100644
--- a/tools/perf/builtin-c2c.c
+++ b/tools/perf/builtin-c2c.c
@@ -2476,6 +2476,7 @@ static int build_cl_output(char *cl_sort, bool no_source)
 		"mean_rmt,"
 		"mean_lcl,"
 		"mean_load,"
+		"tot_recs,"
 		"cpucnt,",
 		add_sym ? "symbol," : "",
 		add_dso ? "dso," : "",

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [tip:perf/core] perf c2c report: Coalesce by default only by pid,iaddr
  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-bot for Jiri Olsa
  0 siblings, 0 replies; 12+ messages in thread
From: tip-bot for Jiri Olsa @ 2017-01-26 15:27 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: dzickus, jolsa, a.p.zijlstra, acme, namhyung, hpa, jmario, mingo,
	dsahern, tglx, linux-kernel

Commit-ID:  190bacca16d0627dce1d4ceb873f041ebbaef69a
Gitweb:     http://git.kernel.org/tip/190bacca16d0627dce1d4ceb873f041ebbaef69a
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Fri, 20 Jan 2017 10:20:32 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 20 Jan 2017 16:52:56 -0300

perf c2c report: Coalesce by default only by pid,iaddr

It seems to be the most used argument for -c option so far.  In the
beginning when you want to have the overall process report, so it makes
sense to make it the default one.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
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-5-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/perf-c2c.txt | 2 +-
 tools/perf/builtin-c2c.c              | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/Documentation/perf-c2c.txt b/tools/perf/Documentation/perf-c2c.txt
index 3f06730..2da07e5 100644
--- a/tools/perf/Documentation/perf-c2c.txt
+++ b/tools/perf/Documentation/perf-c2c.txt
@@ -248,7 +248,7 @@ output fields set for caheline offsets output:
              Code address, Code symbol, Shared Object, Source line
   dso   - coalesced by shared object
 
-By default the coalescing is setup with 'pid,tid,iaddr'.
+By default the coalescing is setup with 'pid,iaddr'.
 
 STDIO OUTPUT
 ------------
diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c
index 616cb14..e2b2172 100644
--- a/tools/perf/builtin-c2c.c
+++ b/tools/perf/builtin-c2c.c
@@ -58,7 +58,7 @@ struct c2c_hist_entry {
 	struct hist_entry	he;
 };
 
-static char const *coalesce_default = "pid,tid,iaddr";
+static char const *coalesce_default = "pid,iaddr";
 
 struct perf_c2c {
 	struct perf_tool	tool;

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2017-01-26 15:29 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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:perf/core] perf hists browser: Add e/c hotkeys to expand/collapse " tip-bot for Jiri Olsa
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

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.