Skip to content

Commit

Permalink
perf stat: flip around ':k' and ':u' flags
Browse files Browse the repository at this point in the history
This output:

 $ perf stat -e 0:1:k -e 0:1:u ./hello
  Performance counter stats for './hello':
          140131  instructions         (events)
         1906968  instructions         (events)

Is quite confusing - as :k means "user instructions", :u means
"kernel instructions".

Flip them around - as the 'exclude' property is not intuitive in
the flag naming.

Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: John Kacur <jkacur@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Ingo Molnar committed May 25, 2009
1 parent e4cbb4e commit d3f4b38
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Documentation/perf_counter/builtin-stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,9 @@ static __u64 match_event_symbols(char *str)

switch (sscanf(str, "%d:%llu:%2s", &type, &id, mask_str)) {
case 3:
if (strchr(mask_str, 'u'))
event_mask[nr_counters] |= EVENT_MASK_USER;
if (strchr(mask_str, 'k'))
event_mask[nr_counters] |= EVENT_MASK_USER;
if (strchr(mask_str, 'u'))
event_mask[nr_counters] |= EVENT_MASK_KERNEL;
case 2:
return EID(type, id);
Expand Down

0 comments on commit d3f4b38

Please sign in to comment.