kernel-hacking-2024-linux-s.../tools
Kan Liang 601083cffb perf stat: Get correct cpu id for print_aggr
print_aggr() fails to print per-core/per-socket statistics after commit
582ec0829b ("perf stat: Fix per-socket output bug for uncore events")
if events have differnt cpus. Because in print_aggr(), aggr_get_id needs
index (not cpu id) to find core/pkg id. Also, evsel cpu maps should be
used to get aggregated id.

Here is an example:

Counting events cycles,uncore_imc_0/cas_count_read/. (Uncore event has
cpumask 0,18)

  $ perf stat -e cycles,uncore_imc_0/cas_count_read/ -C0,18 --per-core sleep 2

Without this patch, it failes to get CPU 18 result.

   Performance counter stats for 'CPU(s) 0,18':

  S0-C0           1            7526851      cycles
  S0-C0           1               1.05 MiB  uncore_imc_0/cas_count_read/
  S1-C0           0      <not counted>      cycles
  S1-C0           0      <not counted> MiB  uncore_imc_0/cas_count_read/

With this patch, it can get both CPU0 and CPU18 result.

   Performance counter stats for 'CPU(s) 0,18':

  S0-C0           1            6327768      cycles
  S0-C0           1               0.47 MiB  uncore_imc_0/cas_count_read/
  S1-C0           1             330228      cycles
  S1-C0           1               0.29 MiB  uncore_imc_0/cas_count_read/

Signed-off-by: Kan Liang <kan.liang@intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Stephane Eranian <eranian@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Fixes: 582ec0829b ("perf stat: Fix per-socket output bug for uncore events")
Link: http://lkml.kernel.org/r/1435820925-51091-1-git-send-email-kan.liang@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-08-28 11:49:52 -03:00
..
arch
build perf tools: Create config.detected into OUTPUT directory 2015-07-01 17:53:49 -03:00
cgroup
firewire
hv
iio
include tools: Copy rbtree_augmented.h from the kernel 2015-07-05 22:59:05 -03:00
laptop/freefall
lguest
lib tools: Copy lib/hweight.c from the kernel sources 2015-07-09 16:29:56 -03:00
net
nfsd
perf perf stat: Get correct cpu id for print_aggr 2015-08-28 11:49:52 -03:00
power Additional ACPICA material for v4.2-rc1 2015-07-02 17:11:28 -07:00
scripts
testing linux-kselftest-4.2-rc5 2015-07-28 10:09:53 -07:00
thermal/tmon
time
usb
virtio
vm
Makefile Staging driver patches for 4.2-rc1 2015-06-26 15:46:08 -07:00