linux/tools
Stephane Eranian 02d8dabc50 perf stat: Fix per-pkg event reporting bug
Per-pkg events need to be captured once per processor socket. The code
in check_per_pkg() ensures only one value per processor package is used.
However there is a problem with this function in case the first CPU of
the package does not measure anything for the per-pkg event, but other
CPUs do.

Consider the following:

  $ create cgroup FOO; echo $$ >FOO/tasks; taskset -c 1 noploop &
  $ perf stat -a -I 1000 -e intel_cqm/llc_occupancy/ -G FOO sleep 100
    1.00000 <not counted> Bytes intel_cqm/llc_occupancy/  FOO

The reason for this is that CPU0 in the cgroup has nothing running on it.
Yet check_per_plg() will mark socket0 as processed and no other event
value will be considered for the socket.

This patch fixes the problem by having check_per_pkg() only consider
events which actually ran.

Signed-off-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: Jiri Olsa <jolsa@redhat.com>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1441286620-10117-1-git-send-email-eranian@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-09-16 18:01:03 -03:00
..
arch tools include: Add basic atomic.h implementation from the kernel sources 2015-05-08 16:11:05 -03:00
build tools build: Allow duplicate objects in the object list 2015-08-26 10:34:58 -03:00
cgroup
firewire
hv tools: hv: add a python script lsvmbus to list VMBus devices 2015-08-05 11:44:29 -07:00
iio iio: lsiio: fix error code handling error 2015-08-12 19:26:22 +01:00
include tools: Restore export.h 2015-08-25 09:44:22 +02:00
laptop/freefall Move freefall program from Documentation/ to tools/ 2015-06-08 16:42:07 -06:00
lguest tools/lguest: don't use legacy definitions for net device in example launcher. 2015-02-13 17:15:55 +10:30
lib perf/core improvements and fixes: 2015-09-01 10:25:57 +02:00
net tools: bpf_jit_disasm: fix segfault on disabled debugging log output 2015-05-27 00:24:10 -04:00
nfsd
perf perf stat: Fix per-pkg event reporting bug 2015-09-16 18:01:03 -03:00
power Additional ACPICA material for v4.2-rc1 2015-07-02 17:11:28 -07:00
scripts
testing Merge branch 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-08-31 18:12:07 -07:00
thermal/tmon tools/thermal: tmon: fixed the 'make install' command 2015-05-09 13:36:58 +08:00
time tools: add script to test udelay 2014-07-23 10:16:38 -07:00
usb tools: ffs-aio-example: use endpoint addresses from descriptors 2015-01-15 09:41:49 -06:00
virtio tools/virtio: add virtio 1.0 in vringh_test 2014-12-15 23:49:22 +02:00
vm tools: Fix tools/vm build 2015-05-12 18:11:06 -03:00
Makefile Staging driver patches for 4.2-rc1 2015-06-26 15:46:08 -07:00