Commit 51e26842 authored by Jaswinder Singh Rajput's avatar Jaswinder Singh Rajput Committed by Ingo Molnar

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: default avatarJaswinder Singh Rajput <jaswinderrajput@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
LKML-Reference: <1245669194.17153.6.camel@localhost.localdomain>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent c1f47b45
...@@ -18,30 +18,30 @@ struct event_symbol { ...@@ -18,30 +18,30 @@ struct event_symbol {
char *symbol; char *symbol;
}; };
#define C(x, y) .type = PERF_TYPE_##x, .config = PERF_COUNT_##y #define CHW(x) .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_##x
#define CR(x, y) .type = PERF_TYPE_##x, .config = y #define CSW(x) .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_##x
static struct event_symbol event_symbols[] = { static struct event_symbol event_symbols[] = {
{ C(HARDWARE, HW_CPU_CYCLES), "cpu-cycles", }, { CHW(CPU_CYCLES), "cpu-cycles", },
{ C(HARDWARE, HW_CPU_CYCLES), "cycles", }, { CHW(CPU_CYCLES), "cycles", },
{ C(HARDWARE, HW_INSTRUCTIONS), "instructions", }, { CHW(INSTRUCTIONS), "instructions", },
{ C(HARDWARE, HW_CACHE_REFERENCES), "cache-references", }, { CHW(CACHE_REFERENCES), "cache-references", },
{ C(HARDWARE, HW_CACHE_MISSES), "cache-misses", }, { CHW(CACHE_MISSES), "cache-misses", },
{ C(HARDWARE, HW_BRANCH_INSTRUCTIONS),"branch-instructions", }, { CHW(BRANCH_INSTRUCTIONS), "branch-instructions", },
{ C(HARDWARE, HW_BRANCH_INSTRUCTIONS),"branches", }, { CHW(BRANCH_INSTRUCTIONS), "branches", },
{ C(HARDWARE, HW_BRANCH_MISSES), "branch-misses", }, { CHW(BRANCH_MISSES), "branch-misses", },
{ C(HARDWARE, HW_BUS_CYCLES), "bus-cycles", }, { CHW(BUS_CYCLES), "bus-cycles", },
{ C(SOFTWARE, SW_CPU_CLOCK), "cpu-clock", }, { CSW(CPU_CLOCK), "cpu-clock", },
{ C(SOFTWARE, SW_TASK_CLOCK), "task-clock", }, { CSW(TASK_CLOCK), "task-clock", },
{ C(SOFTWARE, SW_PAGE_FAULTS), "page-faults", }, { CSW(PAGE_FAULTS), "page-faults", },
{ C(SOFTWARE, SW_PAGE_FAULTS), "faults", }, { CSW(PAGE_FAULTS), "faults", },
{ C(SOFTWARE, SW_PAGE_FAULTS_MIN), "minor-faults", }, { CSW(PAGE_FAULTS_MIN), "minor-faults", },
{ C(SOFTWARE, SW_PAGE_FAULTS_MAJ), "major-faults", }, { CSW(PAGE_FAULTS_MAJ), "major-faults", },
{ C(SOFTWARE, SW_CONTEXT_SWITCHES), "context-switches", }, { CSW(CONTEXT_SWITCHES), "context-switches", },
{ C(SOFTWARE, SW_CONTEXT_SWITCHES), "cs", }, { CSW(CONTEXT_SWITCHES), "cs", },
{ C(SOFTWARE, SW_CPU_MIGRATIONS), "cpu-migrations", }, { CSW(CPU_MIGRATIONS), "cpu-migrations", },
{ C(SOFTWARE, SW_CPU_MIGRATIONS), "migrations", }, { CSW(CPU_MIGRATIONS), "migrations", },
}; };
#define __PERF_COUNTER_FIELD(config, name) \ #define __PERF_COUNTER_FIELD(config, name) \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment