31
31
#define CSW(x) .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_##x
33
33
static struct event_symbol event_symbols[] = {
34
{ CHW(CPU_CYCLES), "cpu-cycles", "cycles" },
35
{ CHW(INSTRUCTIONS), "instructions", "" },
36
{ CHW(CACHE_REFERENCES), "cache-references", "" },
37
{ CHW(CACHE_MISSES), "cache-misses", "" },
38
{ CHW(BRANCH_INSTRUCTIONS), "branch-instructions", "branches" },
39
{ CHW(BRANCH_MISSES), "branch-misses", "" },
40
{ CHW(BUS_CYCLES), "bus-cycles", "" },
34
{ CHW(CPU_CYCLES), "cpu-cycles", "cycles" },
35
{ CHW(STALLED_CYCLES_FRONTEND), "stalled-cycles-frontend", "idle-cycles-frontend" },
36
{ CHW(STALLED_CYCLES_BACKEND), "stalled-cycles-backend", "idle-cycles-backend" },
37
{ CHW(INSTRUCTIONS), "instructions", "" },
38
{ CHW(CACHE_REFERENCES), "cache-references", "" },
39
{ CHW(CACHE_MISSES), "cache-misses", "" },
40
{ CHW(BRANCH_INSTRUCTIONS), "branch-instructions", "branches" },
41
{ CHW(BRANCH_MISSES), "branch-misses", "" },
42
{ CHW(BUS_CYCLES), "bus-cycles", "" },
42
{ CSW(CPU_CLOCK), "cpu-clock", "" },
43
{ CSW(TASK_CLOCK), "task-clock", "" },
44
{ CSW(PAGE_FAULTS), "page-faults", "faults" },
45
{ CSW(PAGE_FAULTS_MIN), "minor-faults", "" },
46
{ CSW(PAGE_FAULTS_MAJ), "major-faults", "" },
47
{ CSW(CONTEXT_SWITCHES), "context-switches", "cs" },
48
{ CSW(CPU_MIGRATIONS), "cpu-migrations", "migrations" },
49
{ CSW(ALIGNMENT_FAULTS), "alignment-faults", "" },
50
{ CSW(EMULATION_FAULTS), "emulation-faults", "" },
44
{ CSW(CPU_CLOCK), "cpu-clock", "" },
45
{ CSW(TASK_CLOCK), "task-clock", "" },
46
{ CSW(PAGE_FAULTS), "page-faults", "faults" },
47
{ CSW(PAGE_FAULTS_MIN), "minor-faults", "" },
48
{ CSW(PAGE_FAULTS_MAJ), "major-faults", "" },
49
{ CSW(CONTEXT_SWITCHES), "context-switches", "cs" },
50
{ CSW(CPU_MIGRATIONS), "cpu-migrations", "migrations" },
51
{ CSW(ALIGNMENT_FAULTS), "alignment-faults", "" },
52
{ CSW(EMULATION_FAULTS), "emulation-faults", "" },
53
55
#define __PERF_EVENT_FIELD(config, name) \
54
56
((config & PERF_EVENT_##name##_MASK) >> PERF_EVENT_##name##_SHIFT)
56
#define PERF_EVENT_RAW(config) __PERF_EVENT_FIELD(config, RAW)
58
#define PERF_EVENT_RAW(config) __PERF_EVENT_FIELD(config, RAW)
57
59
#define PERF_EVENT_CONFIG(config) __PERF_EVENT_FIELD(config, CONFIG)
58
#define PERF_EVENT_TYPE(config) __PERF_EVENT_FIELD(config, TYPE)
60
#define PERF_EVENT_TYPE(config) __PERF_EVENT_FIELD(config, TYPE)
59
61
#define PERF_EVENT_ID(config) __PERF_EVENT_FIELD(config, EVENT)
61
static const char *hw_event_names[] = {
63
static const char *hw_event_names[PERF_COUNT_HW_MAX] = {
64
66
"cache-references",