linux/tools/perf
Andi Kleen a0aa21e228 perf stat: Fix metrics calculation with event qualifiers
Currently in perf IPC and other metrics cannot be directly shown
separately for both user and kernel in a single run. The problem was
that the metrics matching code did not check event qualifiers.

With this patch the following case works correctly.

% perf stat -e cycles:k,cycles:u,instructions:k,instructions:u true

 Performance counter stats for 'true':

           531,718      cycles:k
           203,895      cycles:u
           338,151      instructions:k            #    0.64  insns per cycle
           105,961      instructions:u            #    0.52  insns per cycle

       0.002989739 seconds time elapsed

Previously it would misreport the ratios because they were matching the
wrong value.

The patch is fairly big, but quite mechanic as it just adds context
indexes everywhere.

Reported-by: William Cohen <wcohen@redhat.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: William Cohen <wcohen@redhat.com>
Link: http://lkml.kernel.org/r/1428441919-23099-3-git-send-email-jolsa@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-04-29 10:38:04 -03:00
..
arch perf build: Add arch sparc objects building 2015-02-12 13:22:01 -03:00
bench Merge 'tip/perf/urgent' into perf/core to pick fixes 2015-03-02 11:45:49 -03:00
config perf build: Disable libbabeltrace check by default 2015-03-30 10:24:27 -03:00
Documentation perf trace: Clarify that -e is about syscalls, not perf events in general 2015-04-29 10:38:04 -03:00
python perf python: Remove duplicate TID bit from mask 2013-08-07 17:35:25 -03:00
scripts perf build: Add scripts objects building 2015-02-12 11:49:53 -03:00
tests perf tools: Add term support for parse_events_error 2015-04-29 10:38:01 -03:00
ui perf hists browser: Indicate which callchain entries are annotated 2015-03-21 14:53:37 -03:00
util perf probe: Remove all probes matches given pattern at once 2015-04-29 10:38:03 -03:00
.gitignore perf build: Use FEATURE-DUMP instead of PERF-FEATURES in the .gitignore file 2015-03-20 17:49:51 -03:00
Build perf tools: Add new 'perf data' command 2015-02-25 12:42:25 -03:00
builtin-annotate.c perf ordered_events: Shorten function signatures 2015-03-11 10:17:09 -03:00
builtin-bench.c perf bench: Add --repeat option 2014-06-19 16:13:15 -03:00
builtin-buildid-cache.c perf buildid-cache: Show usage with incorrect params 2015-02-27 15:52:40 -03:00
builtin-buildid-list.c perf ordered_events: Shorten function signatures 2015-03-11 10:17:09 -03:00
builtin-data.c perf data: Support using -f to override perf.data file ownership for 'convert' 2015-04-02 13:18:52 -03:00
builtin-diff.c perf diff: Add kallsyms option 2015-03-24 13:01:54 -03:00
builtin-evlist.c perf evlist: Support using -f to override perf.data file ownership 2015-04-02 13:18:45 -03:00
builtin-help.c perf tools: Add the bash completion for listing subsubcommands of perf help 2015-03-19 13:49:39 -03:00
builtin-inject.c perf inject: Add Instruction Tracing support 2015-04-29 10:37:57 -03:00
builtin-kmem.c perf kmem: Fix compiles on RHEL6/OL6 2015-04-29 10:37:44 -03:00
builtin-kvm.c perf kvm: Support using -f to override perf.data.guest file ownership 2015-04-02 13:18:47 -03:00
builtin-list.c perf list: Extend raw-dump to certain kind of events 2015-02-27 15:52:24 -03:00
builtin-lock.c perf lock: Support using -f to override perf.data file ownership 2015-04-02 13:18:48 -03:00
builtin-mem.c perf mem: Support using -f to override perf.data file ownership 2015-04-02 13:18:49 -03:00
builtin-probe.c perf probe: Make --funcs option exclusive 2015-04-29 10:38:02 -03:00
builtin-record.c perf record: Extend -m option for AUX area tracing mmap pages 2015-04-29 10:37:52 -03:00
builtin-report.c perf report: Don't call map__kmap if map is NULL. 2015-04-08 11:00:00 -03:00
builtin-sched.c perf sched replay: Use replay_repeat to calculate the runavg of cpu usage instead of the default value 10 2015-04-08 09:07:27 -03:00
builtin-script.c perf script: Add field option 'flags' to print sample flags 2015-04-29 10:37:57 -03:00
builtin-stat.c perf stat: Fix metrics calculation with event qualifiers 2015-04-29 10:38:04 -03:00
builtin-timechart.c perf timechart: Support using -f to override perf.data file ownership 2015-04-02 13:18:50 -03:00
builtin-top.c perf symbols: Save DSO loading errno to better report errors 2015-03-24 12:08:43 -03:00
builtin-trace.c perf trace: Clarify that -e is about syscalls, not perf events in general 2015-04-29 10:38:04 -03:00
builtin.h perf tools: Add new 'perf data' command 2015-02-25 12:42:25 -03:00
command-list.txt perf tools: Add new 'perf data' command 2015-02-25 12:42:25 -03:00
CREDITS
design.txt perf tools: Update some code references in design.txt 2014-03-18 18:17:06 -03:00
Makefile perf tools: Set JOBS based on CPU or processor 2015-03-26 10:52:28 -03:00
Makefile.perf perf build: Disable libbabeltrace check by default 2015-03-30 10:24:27 -03:00
MANIFEST tools build: Add new build support 2015-02-11 18:30:03 -03:00
perf-archive.sh perf archive: Make 'f' the last parameter for tar 2012-09-17 13:10:42 -03:00
perf-completion.sh perf tools: Avoid confusion with preloaded bash function for perf bash completion 2015-03-19 13:53:27 -03:00
perf-read-vdso.c perf tools: Build programs to copy 32-bit compatibility 2014-10-29 10:32:48 -02:00
perf-sys.h perf tools: Avoid build splat for syscall numbers with uclibc 2015-01-16 17:49:29 -03:00
perf-with-kcore.sh perf tools: Add perf-with-kcore script 2014-09-17 17:08:08 -03:00
perf.c perf tools: Fix the bash completion problem of 'perf --*' 2015-02-27 15:52:28 -03:00
perf.h perf auxtrace: Add support for AUX area recording 2015-04-29 10:37:51 -03:00