diff options
Diffstat (limited to 'tools/perf/util/parse-events.c')
-rw-r--r-- | tools/perf/util/parse-events.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index b5bfef12f399..bbbb735268ef 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c | |||
@@ -32,13 +32,13 @@ char debugfs_path[MAXPATHLEN]; | |||
32 | 32 | ||
33 | static struct event_symbol event_symbols[] = { | 33 | static struct event_symbol event_symbols[] = { |
34 | { CHW(CPU_CYCLES), "cpu-cycles", "cycles" }, | 34 | { CHW(CPU_CYCLES), "cpu-cycles", "cycles" }, |
35 | { CHW(STALLED_CYCLES), "stalled-cycles", "idle-cycles" }, | ||
35 | { CHW(INSTRUCTIONS), "instructions", "" }, | 36 | { CHW(INSTRUCTIONS), "instructions", "" }, |
36 | { CHW(CACHE_REFERENCES), "cache-references", "" }, | 37 | { CHW(CACHE_REFERENCES), "cache-references", "" }, |
37 | { CHW(CACHE_MISSES), "cache-misses", "" }, | 38 | { CHW(CACHE_MISSES), "cache-misses", "" }, |
38 | { CHW(BRANCH_INSTRUCTIONS), "branch-instructions", "branches" }, | 39 | { CHW(BRANCH_INSTRUCTIONS), "branch-instructions", "branches" }, |
39 | { CHW(BRANCH_MISSES), "branch-misses", "" }, | 40 | { CHW(BRANCH_MISSES), "branch-misses", "" }, |
40 | { CHW(BUS_CYCLES), "bus-cycles", "" }, | 41 | { CHW(BUS_CYCLES), "bus-cycles", "" }, |
41 | { CHW(STALLED_CYCLES), "stalled-cycles", "" }, | ||
42 | 42 | ||
43 | { CSW(CPU_CLOCK), "cpu-clock", "" }, | 43 | { CSW(CPU_CLOCK), "cpu-clock", "" }, |
44 | { CSW(TASK_CLOCK), "task-clock", "" }, | 44 | { CSW(TASK_CLOCK), "task-clock", "" }, |
@@ -54,9 +54,9 @@ static struct event_symbol event_symbols[] = { | |||
54 | #define __PERF_EVENT_FIELD(config, name) \ | 54 | #define __PERF_EVENT_FIELD(config, name) \ |
55 | ((config & PERF_EVENT_##name##_MASK) >> PERF_EVENT_##name##_SHIFT) | 55 | ((config & PERF_EVENT_##name##_MASK) >> PERF_EVENT_##name##_SHIFT) |
56 | 56 | ||
57 | #define PERF_EVENT_RAW(config) __PERF_EVENT_FIELD(config, RAW) | 57 | #define PERF_EVENT_RAW(config) __PERF_EVENT_FIELD(config, RAW) |
58 | #define PERF_EVENT_CONFIG(config) __PERF_EVENT_FIELD(config, CONFIG) | 58 | #define PERF_EVENT_CONFIG(config) __PERF_EVENT_FIELD(config, CONFIG) |
59 | #define PERF_EVENT_TYPE(config) __PERF_EVENT_FIELD(config, TYPE) | 59 | #define PERF_EVENT_TYPE(config) __PERF_EVENT_FIELD(config, TYPE) |
60 | #define PERF_EVENT_ID(config) __PERF_EVENT_FIELD(config, EVENT) | 60 | #define PERF_EVENT_ID(config) __PERF_EVENT_FIELD(config, EVENT) |
61 | 61 | ||
62 | static const char *hw_event_names[] = { | 62 | static const char *hw_event_names[] = { |
@@ -67,6 +67,7 @@ static const char *hw_event_names[] = { | |||
67 | "branches", | 67 | "branches", |
68 | "branch-misses", | 68 | "branch-misses", |
69 | "bus-cycles", | 69 | "bus-cycles", |
70 | "stalled-cycles", | ||
70 | }; | 71 | }; |
71 | 72 | ||
72 | static const char *sw_event_names[] = { | 73 | static const char *sw_event_names[] = { |
@@ -308,7 +309,7 @@ const char *__event_name(int type, u64 config) | |||
308 | 309 | ||
309 | switch (type) { | 310 | switch (type) { |
310 | case PERF_TYPE_HARDWARE: | 311 | case PERF_TYPE_HARDWARE: |
311 | if (config < PERF_COUNT_HW_MAX) | 312 | if (config < PERF_COUNT_HW_MAX && hw_event_names[config]) |
312 | return hw_event_names[config]; | 313 | return hw_event_names[config]; |
313 | return "unknown-hardware"; | 314 | return "unknown-hardware"; |
314 | 315 | ||
@@ -334,7 +335,7 @@ const char *__event_name(int type, u64 config) | |||
334 | } | 335 | } |
335 | 336 | ||
336 | case PERF_TYPE_SOFTWARE: | 337 | case PERF_TYPE_SOFTWARE: |
337 | if (config < PERF_COUNT_SW_MAX) | 338 | if (config < PERF_COUNT_SW_MAX && sw_event_names[config]) |
338 | return sw_event_names[config]; | 339 | return sw_event_names[config]; |
339 | return "unknown-software"; | 340 | return "unknown-software"; |
340 | 341 | ||