aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-list.c
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2016-09-15 18:24:45 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2016-10-03 20:35:45 -0400
commit1c5f01fe8660fc48625a94a5ed10e4dbaea95d5f (patch)
tree8eb39e4fdca4c54be11a0f38edcb17de820f8a93 /tools/perf/builtin-list.c
parent61eb2eb434b3430c6ef70536eb3d16b616b5ee52 (diff)
perf list: Add a --no-desc flag
Add a --no-desc flag to 'perf list' to not print the event descriptions that were earlier added for JSON events. This may be useful to get a less crowded listing. It's still default to print descriptions as that is the more useful default for most users. Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> Acked-by: Ingo Molnar <mingo@kernel.org> Acked-by: Jiri Olsa <jolsa@redhat.com> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: linuxppc-dev@lists.ozlabs.org Cc: Madhavan Srinivasan <maddy@linux.vnet.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1473978296-20712-9-git-send-email-sukadev@linux.vnet.ibm.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-list.c')
-rw-r--r--tools/perf/builtin-list.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c
index 88ee419e5189..b14cb162f841 100644
--- a/tools/perf/builtin-list.c
+++ b/tools/perf/builtin-list.c
@@ -16,16 +16,20 @@
16#include "util/pmu.h" 16#include "util/pmu.h"
17#include <subcmd/parse-options.h> 17#include <subcmd/parse-options.h>
18 18
19static bool desc_flag = true;
20
19int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused) 21int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused)
20{ 22{
21 int i; 23 int i;
22 bool raw_dump = false; 24 bool raw_dump = false;
23 struct option list_options[] = { 25 struct option list_options[] = {
24 OPT_BOOLEAN(0, "raw-dump", &raw_dump, "Dump raw events"), 26 OPT_BOOLEAN(0, "raw-dump", &raw_dump, "Dump raw events"),
27 OPT_BOOLEAN('d', "desc", &desc_flag,
28 "Print extra event descriptions. --no-desc to not print."),
25 OPT_END() 29 OPT_END()
26 }; 30 };
27 const char * const list_usage[] = { 31 const char * const list_usage[] = {
28 "perf list [hw|sw|cache|tracepoint|pmu|sdt|event_glob]", 32 "perf list [--no-desc] [hw|sw|cache|tracepoint|pmu|sdt|event_glob]",
29 NULL 33 NULL
30 }; 34 };
31 35
@@ -40,7 +44,7 @@ int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused)
40 printf("\nList of pre-defined events (to be used in -e):\n\n"); 44 printf("\nList of pre-defined events (to be used in -e):\n\n");
41 45
42 if (argc == 0) { 46 if (argc == 0) {
43 print_events(NULL, raw_dump); 47 print_events(NULL, raw_dump, !desc_flag);
44 return 0; 48 return 0;
45 } 49 }
46 50
@@ -61,14 +65,14 @@ int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused)
61 strcmp(argv[i], "hwcache") == 0) 65 strcmp(argv[i], "hwcache") == 0)
62 print_hwcache_events(NULL, raw_dump); 66 print_hwcache_events(NULL, raw_dump);
63 else if (strcmp(argv[i], "pmu") == 0) 67 else if (strcmp(argv[i], "pmu") == 0)
64 print_pmu_events(NULL, raw_dump); 68 print_pmu_events(NULL, raw_dump, !desc_flag);
65 else if (strcmp(argv[i], "sdt") == 0) 69 else if (strcmp(argv[i], "sdt") == 0)
66 print_sdt_events(NULL, NULL, raw_dump); 70 print_sdt_events(NULL, NULL, raw_dump);
67 else if ((sep = strchr(argv[i], ':')) != NULL) { 71 else if ((sep = strchr(argv[i], ':')) != NULL) {
68 int sep_idx; 72 int sep_idx;
69 73
70 if (sep == NULL) { 74 if (sep == NULL) {
71 print_events(argv[i], raw_dump); 75 print_events(argv[i], raw_dump, !desc_flag);
72 continue; 76 continue;
73 } 77 }
74 sep_idx = sep - argv[i]; 78 sep_idx = sep - argv[i];
@@ -90,7 +94,7 @@ int cmd_list(int argc, const char **argv, const char *prefix __maybe_unused)
90 print_symbol_events(s, PERF_TYPE_SOFTWARE, 94 print_symbol_events(s, PERF_TYPE_SOFTWARE,
91 event_symbols_sw, PERF_COUNT_SW_MAX, raw_dump); 95 event_symbols_sw, PERF_COUNT_SW_MAX, raw_dump);
92 print_hwcache_events(s, raw_dump); 96 print_hwcache_events(s, raw_dump);
93 print_pmu_events(s, raw_dump); 97 print_pmu_events(s, raw_dump, !desc_flag);
94 print_tracepoint_events(NULL, s, raw_dump); 98 print_tracepoint_events(NULL, s, raw_dump);
95 print_sdt_events(NULL, s, raw_dump); 99 print_sdt_events(NULL, s, raw_dump);
96 free(s); 100 free(s);