mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [GIT PULL 0/4] perf fixes and improvements
@ 2010-05-05 14:30 Arnaldo Carvalho de Melo
  2010-05-05 14:30 ` [PATCH 1/4] perf report: Make dso__calc_col_width agree with hist_entry__dso_snprintf Arnaldo Carvalho de Melo
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2010-05-05 14:30 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo,
	Frédéric Weisbecker, Mike Galbraith, Nick Black,
	Paul Mackerras, Peter Zijlstra, Tom Zanussi

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

Hi Ingo,

        Please pull from:

git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux-2.6 perf

Regards,

Arnaldo Carvalho de Melo (3):
  perf report: Make dso__calc_col_width agree with hist_entry__dso_snprintf
  perf list: Add explanation about raw hardware event descriptors
  perf tools: Fixup minor doc formatting issues

Tom Zanussi (1):
  perf/record: simplify TRACE_INFO tracepoint check

 tools/perf/Documentation/perf-annotate.txt     |    2 +-
 tools/perf/Documentation/perf-bench.txt        |    2 +-
 tools/perf/Documentation/perf-diff.txt         |    2 +-
 tools/perf/Documentation/perf-kmem.txt         |    2 +-
 tools/perf/Documentation/perf-list.txt         |   18 ++++++++++++++++++
 tools/perf/Documentation/perf-trace-python.txt |    2 +-
 tools/perf/Documentation/perf-trace.txt        |    2 +-
 tools/perf/builtin-record.c                    |   11 +----------
 tools/perf/util/event.c                        |    6 ++++--
 tools/perf/util/parse-events.c                 |    2 +-
 tools/perf/util/trace-event-info.c             |    8 +++++++-
 11 files changed, 37 insertions(+), 20 deletions(-)


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

* [PATCH 1/4] perf report: Make dso__calc_col_width agree with hist_entry__dso_snprintf
  2010-05-05 14:30 [GIT PULL 0/4] perf fixes and improvements Arnaldo Carvalho de Melo
@ 2010-05-05 14:30 ` Arnaldo Carvalho de Melo
  2010-05-05 14:30 ` [PATCH 2/4] perf/record: simplify TRACE_INFO tracepoint check Arnaldo Carvalho de Melo
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2010-05-05 14:30 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo,
	Frédéric Weisbecker, Mike Galbraith, Paul Mackerras,
	Peter Zijlstra, Tom Zanussi

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

The first was always using the ->long_name, while the later used
->short_name if verbose was not set, resulting in the dso column to be
much wider than needed most of the time.

Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/event.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index 2477270..23d5dfd 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -626,8 +626,10 @@ static void dso__calc_col_width(struct dso *self)
 	if (!symbol_conf.col_width_list_str && !symbol_conf.field_sep &&
 	    (!symbol_conf.dso_list ||
 	     strlist__has_entry(symbol_conf.dso_list, self->name))) {
-		unsigned int slen = strlen(self->name);
-		if (slen > dsos__col_width)
+		u16 slen = self->short_name_len;
+		if (verbose)
+			slen = self->long_name_len;
+		if (dsos__col_width < slen)
 			dsos__col_width = slen;
 	}
 
-- 
1.6.2.5


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

* [PATCH 2/4] perf/record: simplify TRACE_INFO tracepoint check
  2010-05-05 14:30 [GIT PULL 0/4] perf fixes and improvements Arnaldo Carvalho de Melo
  2010-05-05 14:30 ` [PATCH 1/4] perf report: Make dso__calc_col_width agree with hist_entry__dso_snprintf Arnaldo Carvalho de Melo
@ 2010-05-05 14:30 ` Arnaldo Carvalho de Melo
  2010-05-05 14:30 ` [PATCH 3/4] perf list: Add explanation about raw hardware event descriptors Arnaldo Carvalho de Melo
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2010-05-05 14:30 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Tom Zanussi, Frederic Weisbecker, Ingo Molnar,
	Mike Galbraith, Paul Mackerras, Peter Zijlstra,
	Arnaldo Carvalho de Melo

From: Tom Zanussi <tzanussi@gmail.com>

Fix a couple of inefficiencies and redundancies related to
have_tracepoints() and its use when checking whether to write
TRACE_INFO.

First, there's no need to use get_tracepoints_path() in
have_tracepoints() - we really just want the part that checks whether
any attributes correspondo to tracepoints.

Second, we really don't care about raw_samples per se - tracepoints
are always raw_samples.  In any case, the have_tracepoints() check
should be sufficient to decide whether or not to write TRACE_INFO.

Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>,
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <1273030770.6383.6.camel@tropicana>
Signed-off-by: Tom Zanussi <tzanussi@gmail.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-record.c        |   11 +----------
 tools/perf/util/trace-event-info.c |    8 +++++++-
 2 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 0ff67d1..d3981ac 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -560,17 +560,8 @@ static int __cmd_record(int argc, const char **argv)
 			return err;
 	}
 
-	if (raw_samples && have_tracepoints(attrs, nr_counters)) {
+	if (have_tracepoints(attrs, nr_counters))
 		perf_header__set_feat(&session->header, HEADER_TRACE_INFO);
-	} else {
-		for (i = 0; i < nr_counters; i++) {
-			if (attrs[i].sample_type & PERF_SAMPLE_RAW &&
-				attrs[i].type == PERF_TYPE_TRACEPOINT) {
-				perf_header__set_feat(&session->header, HEADER_TRACE_INFO);
-				break;
-			}
-		}
-	}
 
 	atexit(atexit_header);
 
diff --git a/tools/perf/util/trace-event-info.c b/tools/perf/util/trace-event-info.c
index 0a1fb9d..b157260 100644
--- a/tools/perf/util/trace-event-info.c
+++ b/tools/perf/util/trace-event-info.c
@@ -489,7 +489,13 @@ get_tracepoints_path(struct perf_event_attr *pattrs, int nb_events)
 
 bool have_tracepoints(struct perf_event_attr *pattrs, int nb_events)
 {
-	return get_tracepoints_path(pattrs, nb_events) ? true : false;
+	int i;
+
+	for (i = 0; i < nb_events; i++)
+		if (pattrs[i].type == PERF_TYPE_TRACEPOINT)
+			return true;
+
+	return false;
 }
 
 int read_tracing_data(int fd, struct perf_event_attr *pattrs, int nb_events)
-- 
1.6.2.5


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

* [PATCH 3/4] perf list: Add explanation about raw hardware event descriptors
  2010-05-05 14:30 [GIT PULL 0/4] perf fixes and improvements Arnaldo Carvalho de Melo
  2010-05-05 14:30 ` [PATCH 1/4] perf report: Make dso__calc_col_width agree with hist_entry__dso_snprintf Arnaldo Carvalho de Melo
  2010-05-05 14:30 ` [PATCH 2/4] perf/record: simplify TRACE_INFO tracepoint check Arnaldo Carvalho de Melo
@ 2010-05-05 14:30 ` Arnaldo Carvalho de Melo
  2010-05-05 14:30 ` [PATCH 4/4] perf tools: Fixup minor doc formatting issues Arnaldo Carvalho de Melo
  2010-05-05 16:48 ` [GIT PULL 0/4] perf fixes and improvements Ingo Molnar
  4 siblings, 0 replies; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2010-05-05 14:30 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo,
	Frédéric Weisbecker, Mike Galbraith, Nick Black,
	Paul Mackerras, Peter Zijlstra, Tom Zanussi

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

Using explanation given by Ingo Molnar in the oprofile mailing list.

Suggested-by: Nick Black <dank@qemfd.net>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Nick Black <dank@qemfd.net>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/perf-list.txt |   18 ++++++++++++++++++
 tools/perf/util/parse-events.c         |    2 +-
 2 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/tools/perf/Documentation/perf-list.txt b/tools/perf/Documentation/perf-list.txt
index 8290b94..ad765e0 100644
--- a/tools/perf/Documentation/perf-list.txt
+++ b/tools/perf/Documentation/perf-list.txt
@@ -15,6 +15,24 @@ DESCRIPTION
 This command displays the symbolic event types which can be selected in the
 various perf commands with the -e option.
 
+RAW HARDWARE EVENT DESCRIPTOR
+-----------------------------
+Even when an event is not available in a symbolic form within perf right now,
+it can be encoded as <UMASK VALUE><EVENT NUM>, for instance, if the Intel docs
+describe an event as:
+
+  Event  Umask  Event Mask
+  Num.   Value  Mnemonic    Description                        Comment
+
+  A8H      01H  LSD.UOPS    Counts the number of micro-ops     Use cmask=1 and
+                            delivered by loop stream detector  invert to count
+                                                               cycles
+
+raw encoding of 0x1A8 can be used:
+
+ perf stat -e r1a8 -a sleep 1
+ perf record -e r1a8 ...
+
 OPTIONS
 -------
 None
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 600d327..bc8b7e6 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -936,7 +936,7 @@ void print_events(void)
 
 	printf("\n");
 	printf("  %-42s [%s]\n",
-		"rNNN", event_type_descriptors[PERF_TYPE_RAW]);
+		"rNNN (NNN=<UMASK VALUE><EVENT NUM>)", event_type_descriptors[PERF_TYPE_RAW]);
 	printf("\n");
 
 	printf("  %-42s [%s]\n",
-- 
1.6.2.5


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

* [PATCH 4/4] perf tools: Fixup minor doc formatting issues
  2010-05-05 14:30 [GIT PULL 0/4] perf fixes and improvements Arnaldo Carvalho de Melo
                   ` (2 preceding siblings ...)
  2010-05-05 14:30 ` [PATCH 3/4] perf list: Add explanation about raw hardware event descriptors Arnaldo Carvalho de Melo
@ 2010-05-05 14:30 ` Arnaldo Carvalho de Melo
  2010-05-05 16:48 ` [GIT PULL 0/4] perf fixes and improvements Ingo Molnar
  4 siblings, 0 replies; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2010-05-05 14:30 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo,
	Frédéric Weisbecker, Mike Galbraith, Paul Mackerras,
	Peter Zijlstra, Tom Zanussi

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

Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/Documentation/perf-annotate.txt     |    2 +-
 tools/perf/Documentation/perf-bench.txt        |    2 +-
 tools/perf/Documentation/perf-diff.txt         |    2 +-
 tools/perf/Documentation/perf-kmem.txt         |    2 +-
 tools/perf/Documentation/perf-trace-python.txt |    2 +-
 tools/perf/Documentation/perf-trace.txt        |    2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/perf/Documentation/perf-annotate.txt b/tools/perf/Documentation/perf-annotate.txt
index c9dcade..5164a65 100644
--- a/tools/perf/Documentation/perf-annotate.txt
+++ b/tools/perf/Documentation/perf-annotate.txt
@@ -1,5 +1,5 @@
 perf-annotate(1)
-==============
+================
 
 NAME
 ----
diff --git a/tools/perf/Documentation/perf-bench.txt b/tools/perf/Documentation/perf-bench.txt
index 0181ddd..a3dbadb 100644
--- a/tools/perf/Documentation/perf-bench.txt
+++ b/tools/perf/Documentation/perf-bench.txt
@@ -1,5 +1,5 @@
 perf-bench(1)
-============
+=============
 
 NAME
 ----
diff --git a/tools/perf/Documentation/perf-diff.txt b/tools/perf/Documentation/perf-diff.txt
index 8974e20..20d97d8 100644
--- a/tools/perf/Documentation/perf-diff.txt
+++ b/tools/perf/Documentation/perf-diff.txt
@@ -1,5 +1,5 @@
 perf-diff(1)
-==============
+============
 
 NAME
 ----
diff --git a/tools/perf/Documentation/perf-kmem.txt b/tools/perf/Documentation/perf-kmem.txt
index eac4d85..a52fcde 100644
--- a/tools/perf/Documentation/perf-kmem.txt
+++ b/tools/perf/Documentation/perf-kmem.txt
@@ -1,5 +1,5 @@
 perf-kmem(1)
-==============
+============
 
 NAME
 ----
diff --git a/tools/perf/Documentation/perf-trace-python.txt b/tools/perf/Documentation/perf-trace-python.txt
index 16a8650..864aac2 100644
--- a/tools/perf/Documentation/perf-trace-python.txt
+++ b/tools/perf/Documentation/perf-trace-python.txt
@@ -1,5 +1,5 @@
 perf-trace-python(1)
-==================
+====================
 
 NAME
 ----
diff --git a/tools/perf/Documentation/perf-trace.txt b/tools/perf/Documentation/perf-trace.txt
index 8879299..122ec9d 100644
--- a/tools/perf/Documentation/perf-trace.txt
+++ b/tools/perf/Documentation/perf-trace.txt
@@ -1,5 +1,5 @@
 perf-trace(1)
-==============
+=============
 
 NAME
 ----
-- 
1.6.2.5


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

* Re: [GIT PULL 0/4] perf fixes and improvements
  2010-05-05 14:30 [GIT PULL 0/4] perf fixes and improvements Arnaldo Carvalho de Melo
                   ` (3 preceding siblings ...)
  2010-05-05 14:30 ` [PATCH 4/4] perf tools: Fixup minor doc formatting issues Arnaldo Carvalho de Melo
@ 2010-05-05 16:48 ` Ingo Molnar
  4 siblings, 0 replies; 6+ messages in thread
From: Ingo Molnar @ 2010-05-05 16:48 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Fr??d??ric Weisbecker,
	Mike Galbraith, Nick Black, Paul Mackerras, Peter Zijlstra,
	Tom Zanussi


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

> From: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> Hi Ingo,
> 
>         Please pull from:
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux-2.6 perf
> 
> Regards,
> 
> Arnaldo Carvalho de Melo (3):
>   perf report: Make dso__calc_col_width agree with hist_entry__dso_snprintf
>   perf list: Add explanation about raw hardware event descriptors
>   perf tools: Fixup minor doc formatting issues
> 
> Tom Zanussi (1):
>   perf/record: simplify TRACE_INFO tracepoint check
> 
>  tools/perf/Documentation/perf-annotate.txt     |    2 +-
>  tools/perf/Documentation/perf-bench.txt        |    2 +-
>  tools/perf/Documentation/perf-diff.txt         |    2 +-
>  tools/perf/Documentation/perf-kmem.txt         |    2 +-
>  tools/perf/Documentation/perf-list.txt         |   18 ++++++++++++++++++
>  tools/perf/Documentation/perf-trace-python.txt |    2 +-
>  tools/perf/Documentation/perf-trace.txt        |    2 +-
>  tools/perf/builtin-record.c                    |   11 +----------
>  tools/perf/util/event.c                        |    6 ++++--
>  tools/perf/util/parse-events.c                 |    2 +-
>  tools/perf/util/trace-event-info.c             |    8 +++++++-
>  11 files changed, 37 insertions(+), 20 deletions(-)

Pulled, thanks Arnaldo!

	Ingo

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

end of thread, other threads:[~2010-05-05 16:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-05 14:30 [GIT PULL 0/4] perf fixes and improvements Arnaldo Carvalho de Melo
2010-05-05 14:30 ` [PATCH 1/4] perf report: Make dso__calc_col_width agree with hist_entry__dso_snprintf Arnaldo Carvalho de Melo
2010-05-05 14:30 ` [PATCH 2/4] perf/record: simplify TRACE_INFO tracepoint check Arnaldo Carvalho de Melo
2010-05-05 14:30 ` [PATCH 3/4] perf list: Add explanation about raw hardware event descriptors Arnaldo Carvalho de Melo
2010-05-05 14:30 ` [PATCH 4/4] perf tools: Fixup minor doc formatting issues Arnaldo Carvalho de Melo
2010-05-05 16:48 ` [GIT PULL 0/4] perf fixes and improvements Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®