perf fixes and improvements
From: Arnaldo Carvalho de Melo <[email protected]>
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(-)
PATCH 1/4 perf report: Make dso__calc_col_width agree with hist_entry__dso_snprintf
From: Arnaldo Carvalho de Melo <[email protected]>
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 <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Tom Zanussi <[email protected]>
LKML-Reference: <new-submission>
--- tools/perf/util/event.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
tools/perf/util/event.c +4 -2
@@ -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; }
Signature · 1 line
1.6.2.5
PATCH 2/4 perf/record: simplify TRACE_INFO tracepoint check
In reply to Arnaldo Carvalho de MeloFrom: Tom Zanussi <[email protected]>
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.
LKML-Reference: <1273030770.6383.6.camel@tropicana>
--- tools/perf/builtin-record.c | 11 +---------- tools/perf/util/trace-event-info.c | 8 +++++++- 2 files changed, 8 insertions(+), 11 deletions(-)
tools/perf/builtin-record.c +1 -10
@@ -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);
tools/perf/util/trace-event-info.c +7 -1
@@ -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)
Signature · 1 line
1.6.2.5
PATCH 3/4 perf list: Add explanation about raw hardware event descriptors
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
Using explanation given by Ingo Molnar in the oprofile mailing list.
LKML-Reference: <new-submission>
--- tools/perf/Documentation/perf-list.txt | 18 ++++++++++++++++++ tools/perf/util/parse-events.c | 2 +- 2 files changed, 19 insertions(+), 1 deletions(-)
tools/perf/Documentation/perf-list.txt +18 -0
@@ -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
tools/perf/util/parse-events.c +1 -1
@@ -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",
Signature · 1 line
1.6.2.5
PATCH 4/4 perf tools: Fixup minor doc formatting issues
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
Cc: Frédéric Weisbecker <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Tom Zanussi <[email protected]>
LKML-Reference: <new-submission>
--- 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(-)
tools/perf/Documentation/perf-annotate.txt +1 -1
@@ -1,5 +1,5 @@ perf-annotate(1) -============== +================ NAME ----
tools/perf/Documentation/perf-bench.txt +1 -1
@@ -1,5 +1,5 @@ perf-bench(1) -============ +============= NAME ----
tools/perf/Documentation/perf-diff.txt +1 -1
@@ -1,5 +1,5 @@ perf-diff(1) -============== +============ NAME ----
tools/perf/Documentation/perf-kmem.txt +1 -1
@@ -1,5 +1,5 @@ perf-kmem(1) -============== +============ NAME ----
tools/perf/Documentation/perf-trace-python.txt +1 -1
@@ -1,5 +1,5 @@ perf-trace-python(1) -================== +==================== NAME ----
tools/perf/Documentation/perf-trace.txt +1 -1
@@ -1,5 +1,5 @@ perf-trace(1) -============== +============= NAME ----
Signature · 1 line
1.6.2.5
Quoted 18 lines · Arnaldo Carvalho de Melo
From: Arnaldo Carvalho de Melo <[email protected]>
Hi Ingo,
Please pull from:
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux-2.6perfRegards,
Arnaldo Carvalho de Melo (3):
perf report: Makedso__calc_col_widthagree withhist_entry__dso_snprintfperf list: Add explanation about raw hardware event descriptors perf tools: Fixup minor doc formatting issuesTom Zanussi (1):
perf/record: simplifyTRACE_INFOtracepoint check
Quoted 12 lines
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