diff options
author | David Ahern <dsahern@gmail.com> | 2011-05-30 10:55:59 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-06-02 12:26:15 -0400 |
commit | 2cee77c4505fc581f41b44e18ffc0953b67a414c (patch) | |
tree | 12777ada659829082c27a1da31a295387355fd4b /tools | |
parent | 64348153c63b8c1f99f19f14a9c3cbd5df70c9d3 (diff) |
perf stat: clarify unsupported events from uncounted events
perf stat continues running even if the event list contains counters
that are not supported. The resulting output then contains <not counted>
for those events which gets confusing as to which events are supported,
but not counted and which are not supported.
Before:
perf stat -ddd -- sleep 1
Performance counter stats for 'sleep 1':
0.571283 task-clock # 0.001 CPUs utilized
1 context-switches # 0.002 M/sec
0 CPU-migrations # 0.000 M/sec
157 page-faults # 0.275 M/sec
1,037,707 cycles # 1.816 GHz
<not counted> stalled-cycles-frontend
<not counted> stalled-cycles-backend
654,499 instructions # 0.63 insns per cycle
136,129 branches # 238.286 M/sec
<not counted> branch-misses
<not counted> L1-dcache-loads
<not counted> L1-dcache-load-misses
<not counted> LLC-loads
<not counted> LLC-load-misses
<not counted> L1-icache-loads
<not counted> L1-icache-load-misses
<not counted> dTLB-loads
<not counted> dTLB-load-misses
<not counted> iTLB-loads
<not counted> iTLB-load-misses
<not counted> L1-dcache-prefetches
<not counted> L1-dcache-prefetch-misses
1.001004836 seconds time elapsed
After:
perf stat -ddd -- sleep 1
Performance counter stats for 'sleep 1':
1.350326 task-clock # 0.001 CPUs utilized
2 context-switches # 0.001 M/sec
0 CPU-migrations # 0.000 M/sec
157 page-faults # 0.116 M/sec
11,986 cycles # 0.009 GHz
<not supported> stalled-cycles-frontend
<not supported> stalled-cycles-backend
496,986 instructions # 41.46 insns per cycle
138,065 branches # 102.246 M/sec
7,245 branch-misses # 5.25% of all branches
<not counted> L1-dcache-loads
<not counted> L1-dcache-load-misses
<not counted> LLC-loads
<not counted> LLC-load-misses
<not counted> L1-icache-loads
<not counted> L1-icache-load-misses
<not counted> dTLB-loads
<not counted> dTLB-load-misses
<not counted> iTLB-loads
<not counted> iTLB-load-misses
<not counted> L1-dcache-prefetches
<not supported> L1-dcache-prefetch-misses
1.002397333 seconds time elapsed
v1->v2:
changed supported type from int to bool
v2->v3
fixed vertical alignment of new struct element
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1306767359-13221-1-git-send-email-dsahern@gmail.com
Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/builtin-stat.c | 9 | ||||
-rw-r--r-- | tools/perf/util/evsel.h | 1 |
2 files changed, 8 insertions, 2 deletions
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index a9f06715e44d..784ed6d6e0d6 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c | |||
@@ -61,6 +61,8 @@ | |||
61 | #include <locale.h> | 61 | #include <locale.h> |
62 | 62 | ||
63 | #define DEFAULT_SEPARATOR " " | 63 | #define DEFAULT_SEPARATOR " " |
64 | #define CNTR_NOT_SUPPORTED "<not supported>" | ||
65 | #define CNTR_NOT_COUNTED "<not counted>" | ||
64 | 66 | ||
65 | static struct perf_event_attr default_attrs[] = { | 67 | static struct perf_event_attr default_attrs[] = { |
66 | 68 | ||
@@ -448,6 +450,7 @@ static int run_perf_stat(int argc __used, const char **argv) | |||
448 | if (verbose) | 450 | if (verbose) |
449 | ui__warning("%s event is not supported by the kernel.\n", | 451 | ui__warning("%s event is not supported by the kernel.\n", |
450 | event_name(counter)); | 452 | event_name(counter)); |
453 | counter->supported = false; | ||
451 | continue; | 454 | continue; |
452 | } | 455 | } |
453 | 456 | ||
@@ -466,6 +469,7 @@ static int run_perf_stat(int argc __used, const char **argv) | |||
466 | die("Not all events could be opened.\n"); | 469 | die("Not all events could be opened.\n"); |
467 | return -1; | 470 | return -1; |
468 | } | 471 | } |
472 | counter->supported = true; | ||
469 | } | 473 | } |
470 | 474 | ||
471 | if (perf_evlist__set_filters(evsel_list)) { | 475 | if (perf_evlist__set_filters(evsel_list)) { |
@@ -861,7 +865,7 @@ static void print_counter_aggr(struct perf_evsel *counter) | |||
861 | if (scaled == -1) { | 865 | if (scaled == -1) { |
862 | fprintf(stderr, "%*s%s%*s", | 866 | fprintf(stderr, "%*s%s%*s", |
863 | csv_output ? 0 : 18, | 867 | csv_output ? 0 : 18, |
864 | "<not counted>", | 868 | counter->supported ? CNTR_NOT_COUNTED : CNTR_NOT_SUPPORTED, |
865 | csv_sep, | 869 | csv_sep, |
866 | csv_output ? 0 : -24, | 870 | csv_output ? 0 : -24, |
867 | event_name(counter)); | 871 | event_name(counter)); |
@@ -914,7 +918,8 @@ static void print_counter(struct perf_evsel *counter) | |||
914 | csv_output ? 0 : -4, | 918 | csv_output ? 0 : -4, |
915 | evsel_list->cpus->map[cpu], csv_sep, | 919 | evsel_list->cpus->map[cpu], csv_sep, |
916 | csv_output ? 0 : 18, | 920 | csv_output ? 0 : 18, |
917 | "<not counted>", csv_sep, | 921 | counter->supported ? CNTR_NOT_COUNTED : CNTR_NOT_SUPPORTED, |
922 | csv_sep, | ||
918 | csv_output ? 0 : -24, | 923 | csv_output ? 0 : -24, |
919 | event_name(counter)); | 924 | event_name(counter)); |
920 | 925 | ||
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index 7e9366e4490b..e9a31554e265 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h | |||
@@ -61,6 +61,7 @@ struct perf_evsel { | |||
61 | off_t id_offset; | 61 | off_t id_offset; |
62 | }; | 62 | }; |
63 | struct cgroup_sel *cgrp; | 63 | struct cgroup_sel *cgrp; |
64 | bool supported; | ||
64 | }; | 65 | }; |
65 | 66 | ||
66 | struct cpu_map; | 67 | struct cpu_map; |