diff options
| -rw-r--r-- | tools/perf/Documentation/perf-list.txt | 4 | ||||
| -rw-r--r-- | tools/perf/builtin-list.c | 14 | ||||
| -rw-r--r-- | tools/perf/util/parse-events.c | 5 | ||||
| -rw-r--r-- | tools/perf/util/parse-events.h | 2 | ||||
| -rw-r--r-- | tools/perf/util/pmu.c | 4 | ||||
| -rw-r--r-- | tools/perf/util/pmu.h | 2 |
6 files changed, 21 insertions, 10 deletions
diff --git a/tools/perf/Documentation/perf-list.txt b/tools/perf/Documentation/perf-list.txt index 41857cce5e86..143d98df2df9 100644 --- a/tools/perf/Documentation/perf-list.txt +++ b/tools/perf/Documentation/perf-list.txt | |||
| @@ -24,6 +24,10 @@ Don't print descriptions. | |||
| 24 | --long-desc:: | 24 | --long-desc:: |
| 25 | Print longer event descriptions. | 25 | Print longer event descriptions. |
| 26 | 26 | ||
| 27 | --details:: | ||
| 28 | Print how named events are resolved internally into perf events, and also | ||
| 29 | any extra expressions computed by perf stat. | ||
| 30 | |||
| 27 | 31 | ||
| 28 | [[EVENT_MODIFIERS]] | 32 | [[EVENT_MODIFIERS]] |
| 29 | EVENT MODIFIERS | 33 | EVENT MODIFIERS |
diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c index 3b9d98b5feef..be9195e95c78 100644 --- a/tools/perf/builtin-list.c +++ b/tools/perf/builtin-list.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <subcmd/parse-options.h> | 18 | #include <subcmd/parse-options.h> |
| 19 | 19 | ||
| 20 | static bool desc_flag = true; | 20 | static bool desc_flag = true; |
| 21 | static bool details_flag; | ||
| 21 | 22 | ||
| 22 | int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused) | 23 | int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused) |
| 23 | { | 24 | { |
| @@ -30,6 +31,8 @@ int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused) | |||
| 30 | "Print extra event descriptions. --no-desc to not print."), | 31 | "Print extra event descriptions. --no-desc to not print."), |
| 31 | OPT_BOOLEAN('v', "long-desc", &long_desc_flag, | 32 | OPT_BOOLEAN('v', "long-desc", &long_desc_flag, |
| 32 | "Print longer event descriptions."), | 33 | "Print longer event descriptions."), |
| 34 | OPT_BOOLEAN(0, "details", &details_flag, | ||
| 35 | "Print information on the perf event names and expressions used internally by events."), | ||
| 33 | OPT_INCR(0, "debug", &verbose, | 36 | OPT_INCR(0, "debug", &verbose, |
| 34 | "Enable debugging output"), | 37 | "Enable debugging output"), |
| 35 | OPT_END() | 38 | OPT_END() |
| @@ -50,7 +53,8 @@ int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused) | |||
| 50 | printf("\nList of pre-defined events (to be used in -e):\n\n"); | 53 | printf("\nList of pre-defined events (to be used in -e):\n\n"); |
| 51 | 54 | ||
| 52 | if (argc == 0) { | 55 | if (argc == 0) { |
| 53 | print_events(NULL, raw_dump, !desc_flag, long_desc_flag); | 56 | print_events(NULL, raw_dump, !desc_flag, long_desc_flag, |
| 57 | details_flag); | ||
| 54 | return 0; | 58 | return 0; |
| 55 | } | 59 | } |
| 56 | 60 | ||
| @@ -72,7 +76,7 @@ int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused) | |||
| 72 | print_hwcache_events(NULL, raw_dump); | 76 | print_hwcache_events(NULL, raw_dump); |
| 73 | else if (strcmp(argv[i], "pmu") == 0) | 77 | else if (strcmp(argv[i], "pmu") == 0) |
| 74 | print_pmu_events(NULL, raw_dump, !desc_flag, | 78 | print_pmu_events(NULL, raw_dump, !desc_flag, |
| 75 | long_desc_flag); | 79 | long_desc_flag, details_flag); |
| 76 | else if (strcmp(argv[i], "sdt") == 0) | 80 | else if (strcmp(argv[i], "sdt") == 0) |
| 77 | print_sdt_events(NULL, NULL, raw_dump); | 81 | print_sdt_events(NULL, NULL, raw_dump); |
| 78 | else if ((sep = strchr(argv[i], ':')) != NULL) { | 82 | else if ((sep = strchr(argv[i], ':')) != NULL) { |
| @@ -80,7 +84,8 @@ int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused) | |||
| 80 | 84 | ||
| 81 | if (sep == NULL) { | 85 | if (sep == NULL) { |
| 82 | print_events(argv[i], raw_dump, !desc_flag, | 86 | print_events(argv[i], raw_dump, !desc_flag, |
| 83 | long_desc_flag); | 87 | long_desc_flag, |
| 88 | details_flag); | ||
| 84 | continue; | 89 | continue; |
| 85 | } | 90 | } |
| 86 | sep_idx = sep - argv[i]; | 91 | sep_idx = sep - argv[i]; |
| @@ -103,7 +108,8 @@ int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused) | |||
| 103 | event_symbols_sw, PERF_COUNT_SW_MAX, raw_dump); | 108 | event_symbols_sw, PERF_COUNT_SW_MAX, raw_dump); |
| 104 | print_hwcache_events(s, raw_dump); | 109 | print_hwcache_events(s, raw_dump); |
| 105 | print_pmu_events(s, raw_dump, !desc_flag, | 110 | print_pmu_events(s, raw_dump, !desc_flag, |
| 106 | long_desc_flag); | 111 | long_desc_flag, |
| 112 | details_flag); | ||
| 107 | print_tracepoint_events(NULL, s, raw_dump); | 113 | print_tracepoint_events(NULL, s, raw_dump); |
| 108 | print_sdt_events(NULL, s, raw_dump); | 114 | print_sdt_events(NULL, s, raw_dump); |
| 109 | free(s); | 115 | free(s); |
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 119eb0b65876..6b498aea9fde 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c | |||
| @@ -2325,7 +2325,7 @@ out_enomem: | |||
| 2325 | * Print the help text for the event symbols: | 2325 | * Print the help text for the event symbols: |
| 2326 | */ | 2326 | */ |
| 2327 | void print_events(const char *event_glob, bool name_only, bool quiet_flag, | 2327 | void print_events(const char *event_glob, bool name_only, bool quiet_flag, |
| 2328 | bool long_desc) | 2328 | bool long_desc, bool details_flag) |
| 2329 | { | 2329 | { |
| 2330 | print_symbol_events(event_glob, PERF_TYPE_HARDWARE, | 2330 | print_symbol_events(event_glob, PERF_TYPE_HARDWARE, |
| 2331 | event_symbols_hw, PERF_COUNT_HW_MAX, name_only); | 2331 | event_symbols_hw, PERF_COUNT_HW_MAX, name_only); |
| @@ -2335,7 +2335,8 @@ void print_events(const char *event_glob, bool name_only, bool quiet_flag, | |||
| 2335 | 2335 | ||
| 2336 | print_hwcache_events(event_glob, name_only); | 2336 | print_hwcache_events(event_glob, name_only); |
| 2337 | 2337 | ||
| 2338 | print_pmu_events(event_glob, name_only, quiet_flag, long_desc); | 2338 | print_pmu_events(event_glob, name_only, quiet_flag, long_desc, |
| 2339 | details_flag); | ||
| 2339 | 2340 | ||
| 2340 | if (event_glob != NULL) | 2341 | if (event_glob != NULL) |
| 2341 | return; | 2342 | return; |
diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h index f38086b8dbea..a235f4d6d5e5 100644 --- a/tools/perf/util/parse-events.h +++ b/tools/perf/util/parse-events.h | |||
| @@ -184,7 +184,7 @@ void parse_events_evlist_error(struct parse_events_evlist *data, | |||
| 184 | int idx, const char *str); | 184 | int idx, const char *str); |
| 185 | 185 | ||
| 186 | void print_events(const char *event_glob, bool name_only, bool quiet, | 186 | void print_events(const char *event_glob, bool name_only, bool quiet, |
| 187 | bool long_desc); | 187 | bool long_desc, bool details_flag); |
| 188 | 188 | ||
| 189 | struct event_symbol { | 189 | struct event_symbol { |
| 190 | const char *symbol; | 190 | const char *symbol; |
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c index bcf752fa345b..362051ea7f3d 100644 --- a/tools/perf/util/pmu.c +++ b/tools/perf/util/pmu.c | |||
| @@ -1154,7 +1154,7 @@ static void wordwrap(char *s, int start, int max, int corr) | |||
| 1154 | } | 1154 | } |
| 1155 | 1155 | ||
| 1156 | void print_pmu_events(const char *event_glob, bool name_only, bool quiet_flag, | 1156 | void print_pmu_events(const char *event_glob, bool name_only, bool quiet_flag, |
| 1157 | bool long_desc) | 1157 | bool long_desc, bool details_flag) |
| 1158 | { | 1158 | { |
| 1159 | struct perf_pmu *pmu; | 1159 | struct perf_pmu *pmu; |
| 1160 | struct perf_pmu_alias *alias; | 1160 | struct perf_pmu_alias *alias; |
| @@ -1246,7 +1246,7 @@ void print_pmu_events(const char *event_glob, bool name_only, bool quiet_flag, | |||
| 1246 | printf("%*s", 8, "["); | 1246 | printf("%*s", 8, "["); |
| 1247 | wordwrap(aliases[j].desc, 8, columns, 0); | 1247 | wordwrap(aliases[j].desc, 8, columns, 0); |
| 1248 | printf("]\n"); | 1248 | printf("]\n"); |
| 1249 | if (verbose > 0) { | 1249 | if (details_flag) { |
| 1250 | printf("%*s%s/%s/ ", 8, "", aliases[j].pmu, aliases[j].str); | 1250 | printf("%*s%s/%s/ ", 8, "", aliases[j].pmu, aliases[j].str); |
| 1251 | if (aliases[j].metric_name) | 1251 | if (aliases[j].metric_name) |
| 1252 | printf(" MetricName: %s", aliases[j].metric_name); | 1252 | printf(" MetricName: %s", aliases[j].metric_name); |
diff --git a/tools/perf/util/pmu.h b/tools/perf/util/pmu.h index 3d4b703f5d89..ea7f450dc609 100644 --- a/tools/perf/util/pmu.h +++ b/tools/perf/util/pmu.h | |||
| @@ -80,7 +80,7 @@ int perf_pmu__format_parse(char *dir, struct list_head *head); | |||
| 80 | struct perf_pmu *perf_pmu__scan(struct perf_pmu *pmu); | 80 | struct perf_pmu *perf_pmu__scan(struct perf_pmu *pmu); |
| 81 | 81 | ||
| 82 | void print_pmu_events(const char *event_glob, bool name_only, bool quiet, | 82 | void print_pmu_events(const char *event_glob, bool name_only, bool quiet, |
| 83 | bool long_desc); | 83 | bool long_desc, bool details_flag); |
| 84 | bool pmu_have_event(const char *pname, const char *name); | 84 | bool pmu_have_event(const char *pname, const char *name); |
| 85 | 85 | ||
| 86 | int perf_pmu__scan_file(struct perf_pmu *pmu, const char *name, const char *fmt, | 86 | int perf_pmu__scan_file(struct perf_pmu *pmu, const char *name, const char *fmt, |
