diff options
author | Stephane Eranian <eranian@google.com> | 2013-07-05 13:06:45 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-07-08 17:01:46 -0400 |
commit | 582ec0829b3dd74d8c0f58403a3f9df8cbaa9c7d (patch) | |
tree | dfc53409cad09fd7c8eccbf5db02ecbd700f2a36 /tools/perf/builtin-stat.c | |
parent | f9ceffb605be7b3b3b2a6e6d14dd0d7a97eae580 (diff) |
perf stat: Fix per-socket output bug for uncore events
This patch fixes a problem reported by Andi Kleen on perf
stat when measuring uncore events:
# perf stat --per-socket -e uncore_pcu/event=0x0/ -I1000 -a sleep 2
It would not report counts for the second socket. That was due to a
cpu mapping bug in print_aggr().
This patch also fixes the socket numbering bug for <not counted>
events.
Reported-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Stephane Eranian <eranian@google.com>
Tested-by: Andi Kleen <ak@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung.kim@lge.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: zheng.z.yan@intel.com
Link: http://lkml.kernel.org/r/20130705170645.GA32519@quad
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-stat.c')
-rw-r--r-- | tools/perf/builtin-stat.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 95768afaae3e..352fbd7ff4a1 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c | |||
@@ -924,7 +924,7 @@ static void abs_printout(int cpu, int nr, struct perf_evsel *evsel, double avg) | |||
924 | static void print_aggr(char *prefix) | 924 | static void print_aggr(char *prefix) |
925 | { | 925 | { |
926 | struct perf_evsel *counter; | 926 | struct perf_evsel *counter; |
927 | int cpu, s, s2, id, nr; | 927 | int cpu, cpu2, s, s2, id, nr; |
928 | u64 ena, run, val; | 928 | u64 ena, run, val; |
929 | 929 | ||
930 | if (!(aggr_map || aggr_get_id)) | 930 | if (!(aggr_map || aggr_get_id)) |
@@ -936,7 +936,8 @@ static void print_aggr(char *prefix) | |||
936 | val = ena = run = 0; | 936 | val = ena = run = 0; |
937 | nr = 0; | 937 | nr = 0; |
938 | for (cpu = 0; cpu < perf_evsel__nr_cpus(counter); cpu++) { | 938 | for (cpu = 0; cpu < perf_evsel__nr_cpus(counter); cpu++) { |
939 | s2 = aggr_get_id(evsel_list->cpus, cpu); | 939 | cpu2 = perf_evsel__cpus(counter)->map[cpu]; |
940 | s2 = aggr_get_id(evsel_list->cpus, cpu2); | ||
940 | if (s2 != id) | 941 | if (s2 != id) |
941 | continue; | 942 | continue; |
942 | val += counter->counts->cpu[cpu].val; | 943 | val += counter->counts->cpu[cpu].val; |
@@ -948,7 +949,7 @@ static void print_aggr(char *prefix) | |||
948 | fprintf(output, "%s", prefix); | 949 | fprintf(output, "%s", prefix); |
949 | 950 | ||
950 | if (run == 0 || ena == 0) { | 951 | if (run == 0 || ena == 0) { |
951 | aggr_printout(counter, cpu, nr); | 952 | aggr_printout(counter, id, nr); |
952 | 953 | ||
953 | fprintf(output, "%*s%s%*s", | 954 | fprintf(output, "%*s%s%*s", |
954 | csv_output ? 0 : 18, | 955 | csv_output ? 0 : 18, |