aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-list.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-list.c')
-rw-r--r--tools/perf/builtin-list.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c
index b14cb162f841..ba9322ff858b 100644
--- a/tools/perf/builtin-list.c
+++ b/tools/perf/builtin-list.c
@@ -22,14 +22,17 @@ int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused)
22{ 22{
23 int i; 23 int i;
24 bool raw_dump = false; 24 bool raw_dump = false;
25 bool long_desc_flag = false;
25 struct option list_options[] = { 26 struct option list_options[] = {
26 OPT_BOOLEAN(0, "raw-dump", &raw_dump, "Dump raw events"), 27 OPT_BOOLEAN(0, "raw-dump", &raw_dump, "Dump raw events"),
27 OPT_BOOLEAN('d', "desc", &desc_flag, 28 OPT_BOOLEAN('d', "desc", &desc_flag,
28 "Print extra event descriptions. --no-desc to not print."), 29 "Print extra event descriptions. --no-desc to not print."),
30 OPT_BOOLEAN('v', "long-desc", &long_desc_flag,
31 "Print longer event descriptions."),
29 OPT_END() 32 OPT_END()
30 }; 33 };
31 const char * const list_usage[] = { 34 const char * const list_usage[] = {
32 "perf list [--no-desc] [hw|sw|cache|tracepoint|pmu|sdt|event_glob]", 35 "perf list [<options>] [hw|sw|cache|tracepoint|pmu|sdt|event_glob]",
33 NULL 36 NULL
34 }; 37 };
35 38
@@ -44,7 +47,7 @@ int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused)
44 printf("\nList of pre-defined events (to be used in -e):\n\n"); 47 printf("\nList of pre-defined events (to be used in -e):\n\n");
45 48
46 if (argc == 0) { 49 if (argc == 0) {
47 print_events(NULL, raw_dump, !desc_flag); 50 print_events(NULL, raw_dump, !desc_flag, long_desc_flag);
48 return 0; 51 return 0;
49 } 52 }
50 53
@@ -65,14 +68,16 @@ int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused)
65 strcmp(argv[i], "hwcache") == 0) 68 strcmp(argv[i], "hwcache") == 0)
66 print_hwcache_events(NULL, raw_dump); 69 print_hwcache_events(NULL, raw_dump);
67 else if (strcmp(argv[i], "pmu") == 0) 70 else if (strcmp(argv[i], "pmu") == 0)
68 print_pmu_events(NULL, raw_dump, !desc_flag); 71 print_pmu_events(NULL, raw_dump, !desc_flag,
72 long_desc_flag);
69 else if (strcmp(argv[i], "sdt") == 0) 73 else if (strcmp(argv[i], "sdt") == 0)
70 print_sdt_events(NULL, NULL, raw_dump); 74 print_sdt_events(NULL, NULL, raw_dump);
71 else if ((sep = strchr(argv[i], ':')) != NULL) { 75 else if ((sep = strchr(argv[i], ':')) != NULL) {
72 int sep_idx; 76 int sep_idx;
73 77
74 if (sep == NULL) { 78 if (sep == NULL) {
75 print_events(argv[i], raw_dump, !desc_flag); 79 print_events(argv[i], raw_dump, !desc_flag,
80 long_desc_flag);
76 continue; 81 continue;
77 } 82 }
78 sep_idx = sep - argv[i]; 83 sep_idx = sep - argv[i];
@@ -94,7 +99,8 @@ int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused)
94 print_symbol_events(s, PERF_TYPE_SOFTWARE, 99 print_symbol_events(s, PERF_TYPE_SOFTWARE,
95 event_symbols_sw, PERF_COUNT_SW_MAX, raw_dump); 100 event_symbols_sw, PERF_COUNT_SW_MAX, raw_dump);
96 print_hwcache_events(s, raw_dump); 101 print_hwcache_events(s, raw_dump);
97 print_pmu_events(s, raw_dump, !desc_flag); 102 print_pmu_events(s, raw_dump, !desc_flag,
103 long_desc_flag);
98 print_tracepoint_events(NULL, s, raw_dump); 104 print_tracepoint_events(NULL, s, raw_dump);
99 print_sdt_events(NULL, s, raw_dump); 105 print_sdt_events(NULL, s, raw_dump);
100 free(s); 106 free(s);