diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-06-06 07:58:12 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-06-06 08:16:50 -0400 |
commit | 8faf3b547593bf6ea10df631e73204975273c4e0 (patch) | |
tree | e8283794be9872ff9ae002428c0ce84245821dff /Documentation/perf_counter/util/parse-events.c | |
parent | 86847b62f0781ccc97a79936c9ed9dc818cff67b (diff) |
perf_counter tools: Fix cache-event printout
Also standardize the cache printout (so that it can be pasted back
into the command) and sort out the aliases.
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'Documentation/perf_counter/util/parse-events.c')
-rw-r--r-- | Documentation/perf_counter/util/parse-events.c | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/Documentation/perf_counter/util/parse-events.c b/Documentation/perf_counter/util/parse-events.c index 150fbd262714..e0820b4388ae 100644 --- a/Documentation/perf_counter/util/parse-events.c +++ b/Documentation/perf_counter/util/parse-events.c | |||
@@ -53,45 +53,45 @@ static struct event_symbol event_symbols[] = { | |||
53 | #define PERF_COUNTER_ID(config) __PERF_COUNTER_FIELD(config, EVENT) | 53 | #define PERF_COUNTER_ID(config) __PERF_COUNTER_FIELD(config, EVENT) |
54 | 54 | ||
55 | static char *hw_event_names[] = { | 55 | static char *hw_event_names[] = { |
56 | "CPU cycles", | 56 | "cycles", |
57 | "instructions", | 57 | "instructions", |
58 | "cache references", | 58 | "cache-references", |
59 | "cache misses", | 59 | "cache-misses", |
60 | "branches", | 60 | "branches", |
61 | "branch misses", | 61 | "branch-misses", |
62 | "bus cycles", | 62 | "bus-cycles", |
63 | }; | 63 | }; |
64 | 64 | ||
65 | static char *sw_event_names[] = { | 65 | static char *sw_event_names[] = { |
66 | "cpu clock ticks", | 66 | "cpu-clock-ticks", |
67 | "task clock ticks", | 67 | "task-clock-ticks", |
68 | "pagefaults", | 68 | "page-faults", |
69 | "context switches", | 69 | "context-switches", |
70 | "CPU migrations", | 70 | "CPU-migrations", |
71 | "minor faults", | 71 | "minor-faults", |
72 | "major faults", | 72 | "major-faults", |
73 | }; | 73 | }; |
74 | 74 | ||
75 | #define MAX_ALIASES 8 | 75 | #define MAX_ALIASES 8 |
76 | 76 | ||
77 | static char *hw_cache [][MAX_ALIASES] = { | 77 | static char *hw_cache [][MAX_ALIASES] = { |
78 | { "l1-d" , "l1d" , "l1", "l1-data-cache" }, | 78 | { "L1-data" , "l1-d", "l1d", "l1" }, |
79 | { "l1-i" , "l1i" , "l1-instruction-cache" }, | 79 | { "L1-instruction" , "l1-i", "l1i" }, |
80 | { "l2" , }, | 80 | { "L2" , "l2" }, |
81 | { "dtlb", }, | 81 | { "Data-TLB" , "dtlb", "d-tlb" }, |
82 | { "itlb", }, | 82 | { "Instruction-TLB" , "itlb", "i-tlb" }, |
83 | { "bpu" , "btb", "branch-cache", NULL }, | 83 | { "Branch" , "bpu" , "btb", "bpc" }, |
84 | }; | 84 | }; |
85 | 85 | ||
86 | static char *hw_cache_op [][MAX_ALIASES] = { | 86 | static char *hw_cache_op [][MAX_ALIASES] = { |
87 | { "read" , "load" }, | 87 | { "Load" , "read" }, |
88 | { "write" , "store" }, | 88 | { "Store" , "write" }, |
89 | { "prefetch" , "speculative-read", "speculative-load" }, | 89 | { "Prefetch" , "speculative-read", "speculative-load" }, |
90 | }; | 90 | }; |
91 | 91 | ||
92 | static char *hw_cache_result [][MAX_ALIASES] = { | 92 | static char *hw_cache_result [][MAX_ALIASES] = { |
93 | { "access", "ops" }, | 93 | { "Reference" , "ops", "access" }, |
94 | { "miss", }, | 94 | { "Miss" }, |
95 | }; | 95 | }; |
96 | 96 | ||
97 | char *event_name(int counter) | 97 | char *event_name(int counter) |
@@ -120,14 +120,14 @@ char *event_name(int counter) | |||
120 | return "unknown-ext-hardware-cache-type"; | 120 | return "unknown-ext-hardware-cache-type"; |
121 | 121 | ||
122 | cache_op = (config >> 8) & 0xff; | 122 | cache_op = (config >> 8) & 0xff; |
123 | if (cache_type > PERF_COUNT_HW_CACHE_OP_MAX) | 123 | if (cache_op > PERF_COUNT_HW_CACHE_OP_MAX) |
124 | return "unknown-ext-hardware-cache-op-type"; | 124 | return "unknown-ext-hardware-cache-op"; |
125 | 125 | ||
126 | cache_result = (config >> 16) & 0xff; | 126 | cache_result = (config >> 16) & 0xff; |
127 | if (cache_type > PERF_COUNT_HW_CACHE_RESULT_MAX) | 127 | if (cache_result > PERF_COUNT_HW_CACHE_RESULT_MAX) |
128 | return "unknown-ext-hardware-cache-result-type"; | 128 | return "unknown-ext-hardware-cache-result"; |
129 | 129 | ||
130 | sprintf(name, "%s:%s:%s", | 130 | sprintf(name, "%s-Cache-%s-%ses", |
131 | hw_cache[cache_type][0], | 131 | hw_cache[cache_type][0], |
132 | hw_cache_op[cache_op][0], | 132 | hw_cache_op[cache_op][0], |
133 | hw_cache_result[cache_result][0]); | 133 | hw_cache_result[cache_result][0]); |