aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util
diff options
context:
space:
mode:
authorJaswinder Singh Rajput <jaswinder@kernel.org>2009-06-22 07:13:14 -0400
committerIngo Molnar <mingo@elte.hu>2009-06-22 07:29:57 -0400
commit51e268423151fc7bb41945bde7843160b6a14c32 (patch)
tree7efe059fa8fed6d6028ab47e03da61f48fa77fce /tools/perf/util
parentc1f47b454ce759d7b13604137a233cad4617e1e8 (diff)
perf_counter tools: Define separate declarations for H/W and S/W events
Define separate declarations for H/W and S/W events to: 1. Shorten name to save some space so that we can add more members 2. Fix alignment 3. Avoid declaring HARDWARE/SOFTWARE again and again. Removed unused CR(x, y) Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com> Cc: Peter Zijlstra <peterz@infradead.org> LKML-Reference: <1245669194.17153.6.camel@localhost.localdomain> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util')
-rw-r--r--tools/perf/util/parse-events.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 35d04da38d6a..12abab3a0d63 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -18,30 +18,30 @@ struct event_symbol {
18 char *symbol; 18 char *symbol;
19}; 19};
20 20
21#define C(x, y) .type = PERF_TYPE_##x, .config = PERF_COUNT_##y 21#define CHW(x) .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_##x
22#define CR(x, y) .type = PERF_TYPE_##x, .config = y 22#define CSW(x) .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_##x
23 23
24static struct event_symbol event_symbols[] = { 24static struct event_symbol event_symbols[] = {
25 { C(HARDWARE, HW_CPU_CYCLES), "cpu-cycles", }, 25 { CHW(CPU_CYCLES), "cpu-cycles", },
26 { C(HARDWARE, HW_CPU_CYCLES), "cycles", }, 26 { CHW(CPU_CYCLES), "cycles", },
27 { C(HARDWARE, HW_INSTRUCTIONS), "instructions", }, 27 { CHW(INSTRUCTIONS), "instructions", },
28 { C(HARDWARE, HW_CACHE_REFERENCES), "cache-references", }, 28 { CHW(CACHE_REFERENCES), "cache-references", },
29 { C(HARDWARE, HW_CACHE_MISSES), "cache-misses", }, 29 { CHW(CACHE_MISSES), "cache-misses", },
30 { C(HARDWARE, HW_BRANCH_INSTRUCTIONS),"branch-instructions", }, 30 { CHW(BRANCH_INSTRUCTIONS), "branch-instructions", },
31 { C(HARDWARE, HW_BRANCH_INSTRUCTIONS),"branches", }, 31 { CHW(BRANCH_INSTRUCTIONS), "branches", },
32 { C(HARDWARE, HW_BRANCH_MISSES), "branch-misses", }, 32 { CHW(BRANCH_MISSES), "branch-misses", },
33 { C(HARDWARE, HW_BUS_CYCLES), "bus-cycles", }, 33 { CHW(BUS_CYCLES), "bus-cycles", },
34 34
35 { C(SOFTWARE, SW_CPU_CLOCK), "cpu-clock", }, 35 { CSW(CPU_CLOCK), "cpu-clock", },
36 { C(SOFTWARE, SW_TASK_CLOCK), "task-clock", }, 36 { CSW(TASK_CLOCK), "task-clock", },
37 { C(SOFTWARE, SW_PAGE_FAULTS), "page-faults", }, 37 { CSW(PAGE_FAULTS), "page-faults", },
38 { C(SOFTWARE, SW_PAGE_FAULTS), "faults", }, 38 { CSW(PAGE_FAULTS), "faults", },
39 { C(SOFTWARE, SW_PAGE_FAULTS_MIN), "minor-faults", }, 39 { CSW(PAGE_FAULTS_MIN), "minor-faults", },
40 { C(SOFTWARE, SW_PAGE_FAULTS_MAJ), "major-faults", }, 40 { CSW(PAGE_FAULTS_MAJ), "major-faults", },
41 { C(SOFTWARE, SW_CONTEXT_SWITCHES), "context-switches", }, 41 { CSW(CONTEXT_SWITCHES), "context-switches", },
42 { C(SOFTWARE, SW_CONTEXT_SWITCHES), "cs", }, 42 { CSW(CONTEXT_SWITCHES), "cs", },
43 { C(SOFTWARE, SW_CPU_MIGRATIONS), "cpu-migrations", }, 43 { CSW(CPU_MIGRATIONS), "cpu-migrations", },
44 { C(SOFTWARE, SW_CPU_MIGRATIONS), "migrations", }, 44 { CSW(CPU_MIGRATIONS), "migrations", },
45}; 45};
46 46
47#define __PERF_COUNTER_FIELD(config, name) \ 47#define __PERF_COUNTER_FIELD(config, name) \