20 #include <subcmd/parse-options.h> 28 bool raw_dump =
false;
29 bool long_desc_flag =
false;
30 struct option list_options[] = {
31 OPT_BOOLEAN(0,
"raw-dump", &raw_dump,
"Dump raw events"),
33 "Print extra event descriptions. --no-desc to not print."),
34 OPT_BOOLEAN(
'v',
"long-desc", &long_desc_flag,
35 "Print longer event descriptions."),
37 "Print information on the perf event names and expressions used internally by events."),
39 "Enable debugging output"),
42 const char *
const list_usage[] = {
43 "perf list [<options>] [hw|sw|cache|tracepoint|pmu|sdt|event_glob]",
47 set_option_flag(list_options, 0,
"raw-dump", PARSE_OPT_HIDDEN);
49 argc = parse_options(argc, argv, list_options, list_usage,
50 PARSE_OPT_STOP_AT_NON_OPTION);
54 if (!raw_dump && pager_in_use())
55 printf(
"\nList of pre-defined events (to be used in -e):\n\n");
63 for (i = 0; i <
argc; ++i) {
66 if (strcmp(argv[i],
"tracepoint") == 0)
68 else if (strcmp(argv[i],
"hw") == 0 ||
69 strcmp(argv[i],
"hardware") == 0)
72 else if (strcmp(argv[i],
"sw") == 0 ||
73 strcmp(argv[i],
"software") == 0)
76 else if (strcmp(argv[i],
"cache") == 0 ||
77 strcmp(argv[i],
"hwcache") == 0)
79 else if (strcmp(argv[i],
"pmu") == 0)
82 else if (strcmp(argv[i],
"sdt") == 0)
84 else if (strcmp(argv[i],
"metric") == 0)
86 else if (strcmp(argv[i],
"metricgroup") == 0)
88 else if ((sep = strchr(argv[i],
':')) != NULL) {
97 sep_idx = sep - argv[i];
108 if (asprintf(&s,
"*%s*", argv[i]) < 0) {
109 printf(
"Critical: Not enough memory! Trying to continue...\n");
void print_sdt_events(const char *subsys_glob, const char *event_glob, bool name_only)
void print_pmu_events(const char *event_glob, bool name_only, bool quiet_flag, bool long_desc, bool details_flag)
void print_events(const char *event_glob, bool name_only, bool quiet_flag, bool long_desc, bool details_flag)
void print_tracepoint_events(const char *subsys_glob, const char *event_glob, bool name_only)
struct event_symbol event_symbols_hw[PERF_COUNT_HW_MAX]
int cmd_list(int argc, const char **argv)
struct event_symbol event_symbols_sw[PERF_COUNT_SW_MAX]
int print_hwcache_events(const char *event_glob, bool name_only)
void print_symbol_events(const char *event_glob, unsigned type, struct event_symbol *syms, unsigned max, bool name_only)
void metricgroup__print(bool metrics, bool metricgroups, char *filter, bool raw)