perf stat: Fix --per-core on multi socket systems
authorAndi Kleen <ak@linux.intel.com>
Wed, 24 Sep 2014 20:50:46 +0000 (13:50 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 26 Sep 2014 13:17:13 +0000 (10:17 -0300)
commitda88c7f78d842a6938d9adde6af87a2ce262051d
tree9a5cb01c15a56d7ca6a309ae5f570cbf593fb6e7
parentcf8102f64c8d23f0bd4af0659bbd94d0c1d8d1c7
perf stat: Fix --per-core on multi socket systems

On systems with more than one socket perf stat --per-core would either
segfault or stop before outputting all cores.

The problem was that the output code referenced the id including the
socket number in the higher bits, which is far beyond any per cpu array.

Mask out the socket number before referencing cpus in abs_printout.

I also renamed the variable in nsec_printout to be clear what it is,
even though it doesn't reference cpus.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Stephane Eranian <eranian@google.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1411591846-32736-1-git-send-email-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-stat.c