linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL 0/4] perf/core improvements and fixes
@ 2011-10-20 13:05 Arnaldo Carvalho de Melo
  2011-10-20 13:05 ` [PATCH 1/4] perf hists browser: Honour symbol_conf.show_{nr_samples,total_period} Arnaldo Carvalho de Melo
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2011-10-20 13:05 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, David Ahern,
	Frederic Weisbecker, Mike Galbraith, Paul Mackerras,
	Peter Zijlstra, Stephane Eranian, arnaldo.melo

Hi Ingo,

        Please consider pulling from:

git://github.com/acmel/linux.git perf/core

Regards,

- Arnaldo

Arnaldo Carvalho de Melo (4):
  perf hists browser: Honour symbol_conf.show_{nr_samples,total_period}
  perf hists: Don't decay total_period for filtered entries
  perf hists: Don't consider filtered entries when calculating column widths
  perf hists browser: Elide DSO column when it is set to just one DSO, ditto for threads

 tools/perf/util/hist.c              |   14 ++++++++++----
 tools/perf/util/sort.c              |    4 +++-
 tools/perf/util/ui/browsers/hists.c |   14 ++++++++++++++
 3 files changed, 27 insertions(+), 5 deletions(-)


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

* [PATCH 1/4] perf hists browser: Honour symbol_conf.show_{nr_samples,total_period}
  2011-10-20 13:05 [GIT PULL 0/4] perf/core improvements and fixes Arnaldo Carvalho de Melo
@ 2011-10-20 13:05 ` Arnaldo Carvalho de Melo
  2011-10-20 13:05 ` [PATCH 2/4] perf hists: Don't decay total_period for filtered entries Arnaldo Carvalho de Melo
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2011-10-20 13:05 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, David Ahern,
	Frederic Weisbecker, Mike Galbraith, Paul Mackerras,
	Peter Zijlstra, Stephane Eranian

From: Arnaldo Carvalho de Melo <acme@redhat.com>

We lost that when we move it outside hist_entry__snprintf, but better
leave it untangled of 'perf diff' stuff (pair_hist, etc).

Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-qlhb6ictf5twykog6x344s0b@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/ui/browsers/hists.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/tools/perf/util/ui/browsers/hists.c b/tools/perf/util/ui/browsers/hists.c
index d762875..9e23bce 100644
--- a/tools/perf/util/ui/browsers/hists.c
+++ b/tools/perf/util/ui/browsers/hists.c
@@ -577,6 +577,16 @@ static int hist_browser__show_entry(struct hist_browser *self,
 		if (!current_entry || !self->b.navkeypressed)
 			ui_browser__set_color(&self->b, HE_COLORSET_NORMAL);
 
+		if (symbol_conf.show_nr_samples) {
+			slsmg_printf(" %11u", entry->nr_events);
+			width -= 12;
+		}
+
+		if (symbol_conf.show_total_period) {
+			slsmg_printf(" %12" PRIu64, entry->period);
+			width -= 13;
+		}
+
 		slsmg_write_nstring(s, width);
 		++row;
 		++printed;
-- 
1.6.2.5


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

* [PATCH 2/4] perf hists: Don't decay total_period for filtered entries
  2011-10-20 13:05 [GIT PULL 0/4] perf/core improvements and fixes Arnaldo Carvalho de Melo
  2011-10-20 13:05 ` [PATCH 1/4] perf hists browser: Honour symbol_conf.show_{nr_samples,total_period} Arnaldo Carvalho de Melo
@ 2011-10-20 13:05 ` Arnaldo Carvalho de Melo
  2011-10-20 13:05 ` [PATCH 3/4] perf hists: Don't consider filtered entries when calculating column widths Arnaldo Carvalho de Melo
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2011-10-20 13:05 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, David Ahern,
	Frederic Weisbecker, Mike Galbraith, Paul Mackerras,
	Peter Zijlstra, Stephane Eranian

From: Arnaldo Carvalho de Melo <acme@redhat.com>

Following the 'perf report' model we don't zap hist_entry instances from
the rb tree, we just keep them with he->filtered set to a mask of the
filters applied to it (thread, parent, DSO so far).

In top we need to decay even filtered entries, but we better not touch
total_period for them...

Now everything seems to work when filters are applied on top as they
worked in 'report', i.e. both dynamic and static hist entry browsing
works with filters.

Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-yt4xsbq20u9x9ypuwwyw2kao@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/hist.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 75526d1..1f269fd 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -105,11 +105,16 @@ static void hist_entry__decay(struct hist_entry *he)
 
 static bool hists__decay_entry(struct hists *hists, struct hist_entry *he)
 {
-	if (he->period == 0)
+	u64 prev_period = he->period;
+
+	if (prev_period == 0)
 		return true;
-	hists->stats.total_period -= he->period;
+
 	hist_entry__decay(he);
-	hists->stats.total_period += he->period;
+
+	if (!he->filtered)
+		hists->stats.total_period -= prev_period - he->period;
+
 	return he->period == 0;
 }
 
-- 
1.6.2.5


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

* [PATCH 3/4] perf hists: Don't consider filtered entries when calculating column widths
  2011-10-20 13:05 [GIT PULL 0/4] perf/core improvements and fixes Arnaldo Carvalho de Melo
  2011-10-20 13:05 ` [PATCH 1/4] perf hists browser: Honour symbol_conf.show_{nr_samples,total_period} Arnaldo Carvalho de Melo
  2011-10-20 13:05 ` [PATCH 2/4] perf hists: Don't decay total_period for filtered entries Arnaldo Carvalho de Melo
@ 2011-10-20 13:05 ` Arnaldo Carvalho de Melo
  2011-10-20 13:05 ` [PATCH 4/4] perf hists browser: Elide DSO column when it is set to just one DSO, ditto for threads Arnaldo Carvalho de Melo
  2011-10-23 10:59 ` [GIT PULL 0/4] perf/core improvements and fixes Ingo Molnar
  4 siblings, 0 replies; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2011-10-20 13:05 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, David Ahern,
	Frederic Weisbecker, Mike Galbraith, Paul Mackerras,
	Peter Zijlstra, Stephane Eranian

From: Arnaldo Carvalho de Melo <acme@redhat.com>

Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-rf01wktu1e3f3az32nry86vu@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/hist.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 1f269fd..f6a9939 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -725,7 +725,8 @@ void hists__output_recalc_col_len(struct hists *hists, int max_rows)
 
 	while (next && row++ < max_rows) {
 		n = rb_entry(next, struct hist_entry, rb_node);
-		hists__calc_col_len(hists, n);
+		if (!n->filtered)
+			hists__calc_col_len(hists, n);
 		next = rb_next(&n->rb_node);
 	}
 }
-- 
1.6.2.5


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

* [PATCH 4/4] perf hists browser: Elide DSO column when it is set to just one DSO, ditto for threads
  2011-10-20 13:05 [GIT PULL 0/4] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (2 preceding siblings ...)
  2011-10-20 13:05 ` [PATCH 3/4] perf hists: Don't consider filtered entries when calculating column widths Arnaldo Carvalho de Melo
@ 2011-10-20 13:05 ` Arnaldo Carvalho de Melo
  2011-10-23 10:59 ` [GIT PULL 0/4] perf/core improvements and fixes Ingo Molnar
  4 siblings, 0 replies; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2011-10-20 13:05 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo, David Ahern,
	Frederic Weisbecker, Mike Galbraith, Paul Mackerras,
	Peter Zijlstra, Stephane Eranian

From: Arnaldo Carvalho de Melo <acme@redhat.com>

And also no leed to show the [.] (level: k, . for userspace) when
showing just one DSO.

Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-4h3f6ro5o7ebepjbssxf0dd3@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/sort.c              |    4 +++-
 tools/perf/util/ui/browsers/hists.c |    4 ++++
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index 1ee8f1e..16da30d 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -177,7 +177,9 @@ static int hist_entry__sym_snprintf(struct hist_entry *self, char *bf,
 				       BITS_PER_LONG / 4, self->ip, o);
 	}
 
-	ret += repsep_snprintf(bf + ret, size - ret, "[%c] ", self->level);
+	if (!sort_dso.elide)
+		ret += repsep_snprintf(bf + ret, size - ret, "[%c] ", self->level);
+
 	if (self->ms.sym)
 		ret += repsep_snprintf(bf + ret, size - ret, "%s",
 				       self->ms.sym->name);
diff --git a/tools/perf/util/ui/browsers/hists.c b/tools/perf/util/ui/browsers/hists.c
index 9e23bce..a06e7d9 100644
--- a/tools/perf/util/ui/browsers/hists.c
+++ b/tools/perf/util/ui/browsers/hists.c
@@ -1007,12 +1007,14 @@ zoom_dso:
 zoom_out_dso:
 				ui_helpline__pop();
 				browser->hists->dso_filter = NULL;
+				sort_dso.elide = false;
 			} else {
 				if (dso == NULL)
 					continue;
 				ui_helpline__fpush("To zoom out press <- or -> + \"Zoom out of %s DSO\"",
 						   dso->kernel ? "the Kernel" : dso->short_name);
 				browser->hists->dso_filter = dso;
+				sort_dso.elide = true;
 				pstack__push(fstack, &browser->hists->dso_filter);
 			}
 			hists__filter_by_dso(self);
@@ -1024,11 +1026,13 @@ zoom_thread:
 zoom_out_thread:
 				ui_helpline__pop();
 				browser->hists->thread_filter = NULL;
+				sort_thread.elide = false;
 			} else {
 				ui_helpline__fpush("To zoom out press <- or -> + \"Zoom out of %s(%d) thread\"",
 						   thread->comm_set ? thread->comm : "",
 						   thread->pid);
 				browser->hists->thread_filter = thread;
+				sort_thread.elide = true;
 				pstack__push(fstack, &browser->hists->thread_filter);
 			}
 			hists__filter_by_thread(self);
-- 
1.6.2.5


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

* Re: [GIT PULL 0/4] perf/core improvements and fixes
  2011-10-20 13:05 [GIT PULL 0/4] perf/core improvements and fixes Arnaldo Carvalho de Melo
                   ` (3 preceding siblings ...)
  2011-10-20 13:05 ` [PATCH 4/4] perf hists browser: Elide DSO column when it is set to just one DSO, ditto for threads Arnaldo Carvalho de Melo
@ 2011-10-23 10:59 ` Ingo Molnar
  4 siblings, 0 replies; 6+ messages in thread
From: Ingo Molnar @ 2011-10-23 10:59 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, David Ahern, Frederic Weisbecker, Mike Galbraith,
	Paul Mackerras, Peter Zijlstra, Stephane Eranian, arnaldo.melo


* Arnaldo Carvalho de Melo <acme@infradead.org> wrote:

> Hi Ingo,
> 
>         Please consider pulling from:
> 
> git://github.com/acmel/linux.git perf/core
> 
> Regards,
> 
> - Arnaldo
> 
> Arnaldo Carvalho de Melo (4):
>   perf hists browser: Honour symbol_conf.show_{nr_samples,total_period}
>   perf hists: Don't decay total_period for filtered entries
>   perf hists: Don't consider filtered entries when calculating column widths
>   perf hists browser: Elide DSO column when it is set to just one DSO, ditto for threads
> 
>  tools/perf/util/hist.c              |   14 ++++++++++----
>  tools/perf/util/sort.c              |    4 +++-
>  tools/perf/util/ui/browsers/hists.c |   14 ++++++++++++++
>  3 files changed, 27 insertions(+), 5 deletions(-)

Pulled, thanks Arnaldo!

	Ingo

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

end of thread, other threads:[~2011-10-23 11:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-20 13:05 [GIT PULL 0/4] perf/core improvements and fixes Arnaldo Carvalho de Melo
2011-10-20 13:05 ` [PATCH 1/4] perf hists browser: Honour symbol_conf.show_{nr_samples,total_period} Arnaldo Carvalho de Melo
2011-10-20 13:05 ` [PATCH 2/4] perf hists: Don't decay total_period for filtered entries Arnaldo Carvalho de Melo
2011-10-20 13:05 ` [PATCH 3/4] perf hists: Don't consider filtered entries when calculating column widths Arnaldo Carvalho de Melo
2011-10-20 13:05 ` [PATCH 4/4] perf hists browser: Elide DSO column when it is set to just one DSO, ditto for threads Arnaldo Carvalho de Melo
2011-10-23 10:59 ` [GIT PULL 0/4] perf/core improvements and fixes Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).