4fc4d8dfa0
With this patch, we can use the 'percore' event qualifier in perf-stat. root@skl:/tmp# perf stat -e cpu/event=0,umask=0x3,percore=1/,cpu/event=0,umask=0x3/ -a -A -I1000 1.000773050 S0-C0 98,352,832 cpu/event=0,umask=0x3,percore=1/ (50.01%) 1.000773050 S0-C1 103,763,057 cpu/event=0,umask=0x3,percore=1/ (50.02%) 1.000773050 S0-C2 196,776,995 cpu/event=0,umask=0x3,percore=1/ (50.02%) 1.000773050 S0-C3 176,493,779 cpu/event=0,umask=0x3,percore=1/ (50.02%) 1.000773050 CPU0 47,699,641 cpu/event=0,umask=0x3/ (50.02%) 1.000773050 CPU1 49,052,451 cpu/event=0,umask=0x3/ (49.98%) 1.000773050 CPU2 102,771,422 cpu/event=0,umask=0x3/ (49.98%) 1.000773050 CPU3 100,784,662 cpu/event=0,umask=0x3/ (49.98%) 1.000773050 CPU4 43,171,342 cpu/event=0,umask=0x3/ (49.98%) 1.000773050 CPU5 54,152,158 cpu/event=0,umask=0x3/ (49.98%) 1.000773050 CPU6 93,618,410 cpu/event=0,umask=0x3/ (49.98%) 1.000773050 CPU7 74,477,589 cpu/event=0,umask=0x3/ (49.99%) In this example, we count the event 'ref-cycles' per-core and per-CPU in one perf stat command-line. From the output, we can see: S0-C0 = CPU0 + CPU4 S0-C1 = CPU1 + CPU5 S0-C2 = CPU2 + CPU6 S0-C3 = CPU3 + CPU7 So the result is expected (tiny difference is ignored). Note that, the 'percore' event qualifier needs to use with option '-A'. Signed-off-by: Jin Yao <yao.jin@linux.intel.com> Tested-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com> Acked-by: Jiri Olsa <jolsa@kernel.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jin Yao <yao.jin@intel.com> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1555077590-27664-4-git-send-email-yao.jin@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> |
||
---|---|---|
.. | ||
arch | ||
bench | ||
Documentation | ||
examples/bpf | ||
include/bpf | ||
jvmti | ||
pmu-events | ||
python | ||
scripts | ||
tests | ||
trace | ||
ui | ||
util | ||
.gitignore | ||
Build | ||
builtin-annotate.c | ||
builtin-bench.c | ||
builtin-buildid-cache.c | ||
builtin-buildid-list.c | ||
builtin-c2c.c | ||
builtin-config.c | ||
builtin-data.c | ||
builtin-diff.c | ||
builtin-evlist.c | ||
builtin-ftrace.c | ||
builtin-help.c | ||
builtin-inject.c | ||
builtin-kallsyms.c | ||
builtin-kmem.c | ||
builtin-kvm.c | ||
builtin-list.c | ||
builtin-lock.c | ||
builtin-mem.c | ||
builtin-probe.c | ||
builtin-record.c | ||
builtin-report.c | ||
builtin-sched.c | ||
builtin-script.c | ||
builtin-stat.c | ||
builtin-timechart.c | ||
builtin-top.c | ||
builtin-trace.c | ||
builtin-version.c | ||
builtin.h | ||
check-headers.sh | ||
command-list.txt | ||
CREDITS | ||
design.txt | ||
Makefile | ||
Makefile.config | ||
Makefile.perf | ||
MANIFEST | ||
perf-archive.sh | ||
perf-completion.sh | ||
perf-read-vdso.c | ||
perf-sys.h | ||
perf-with-kcore.sh | ||
perf.c | ||
perf.h |