aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/util/parse-events.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 8a407f3e286f..ffa493a24333 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -929,7 +929,7 @@ void print_tracepoint_events(const char *subsys_glob, const char *event_glob)
929 929
930 snprintf(evt_path, MAXPATHLEN, "%s:%s", 930 snprintf(evt_path, MAXPATHLEN, "%s:%s",
931 sys_dirent.d_name, evt_dirent.d_name); 931 sys_dirent.d_name, evt_dirent.d_name);
932 printf(" %-42s [%s]\n", evt_path, 932 printf(" %-50s [%s]\n", evt_path,
933 event_type_descriptors[PERF_TYPE_TRACEPOINT]); 933 event_type_descriptors[PERF_TYPE_TRACEPOINT]);
934 } 934 }
935 closedir(evt_dir); 935 closedir(evt_dir);
@@ -994,7 +994,7 @@ void print_events_type(u8 type)
994 else 994 else
995 snprintf(name, sizeof(name), "%s", syms->symbol); 995 snprintf(name, sizeof(name), "%s", syms->symbol);
996 996
997 printf(" %-42s [%s]\n", name, 997 printf(" %-50s [%s]\n", name,
998 event_type_descriptors[type]); 998 event_type_descriptors[type]);
999 } 999 }
1000} 1000}
@@ -1012,11 +1012,10 @@ int print_hwcache_events(const char *event_glob)
1012 for (i = 0; i < PERF_COUNT_HW_CACHE_RESULT_MAX; i++) { 1012 for (i = 0; i < PERF_COUNT_HW_CACHE_RESULT_MAX; i++) {
1013 char *name = event_cache_name(type, op, i); 1013 char *name = event_cache_name(type, op, i);
1014 1014
1015 if (event_glob != NULL && 1015 if (event_glob != NULL && !strglobmatch(name, event_glob))
1016 !strglobmatch(name, event_glob))
1017 continue; 1016 continue;
1018 1017
1019 printf(" %-42s [%s]\n", name, 1018 printf(" %-50s [%s]\n", name,
1020 event_type_descriptors[PERF_TYPE_HW_CACHE]); 1019 event_type_descriptors[PERF_TYPE_HW_CACHE]);
1021 ++printed; 1020 ++printed;
1022 } 1021 }
@@ -1026,14 +1025,16 @@ int print_hwcache_events(const char *event_glob)
1026 return printed; 1025 return printed;
1027} 1026}
1028 1027
1028#define MAX_NAME_LEN 100
1029
1029/* 1030/*
1030 * Print the help text for the event symbols: 1031 * Print the help text for the event symbols:
1031 */ 1032 */
1032void print_events(const char *event_glob) 1033void print_events(const char *event_glob)
1033{ 1034{
1034 struct event_symbol *syms = event_symbols;
1035 unsigned int i, type, prev_type = -1, printed = 0, ntypes_printed = 0; 1035 unsigned int i, type, prev_type = -1, printed = 0, ntypes_printed = 0;
1036 char name[40]; 1036 struct event_symbol *syms = event_symbols;
1037 char name[MAX_NAME_LEN];
1037 1038
1038 printf("\n"); 1039 printf("\n");
1039 printf("List of pre-defined events (to be used in -e):\n"); 1040 printf("List of pre-defined events (to be used in -e):\n");
@@ -1053,10 +1054,10 @@ void print_events(const char *event_glob)
1053 continue; 1054 continue;
1054 1055
1055 if (strlen(syms->alias)) 1056 if (strlen(syms->alias))
1056 sprintf(name, "%s OR %s", syms->symbol, syms->alias); 1057 snprintf(name, MAX_NAME_LEN, "%s OR %s", syms->symbol, syms->alias);
1057 else 1058 else
1058 strcpy(name, syms->symbol); 1059 strncpy(name, syms->symbol, MAX_NAME_LEN);
1059 printf(" %-42s [%s]\n", name, 1060 printf(" %-50s [%s]\n", name,
1060 event_type_descriptors[type]); 1061 event_type_descriptors[type]);
1061 1062
1062 prev_type = type; 1063 prev_type = type;
@@ -1073,12 +1074,12 @@ void print_events(const char *event_glob)
1073 return; 1074 return;
1074 1075
1075 printf("\n"); 1076 printf("\n");
1076 printf(" %-42s [%s]\n", 1077 printf(" %-50s [%s]\n",
1077 "rNNN (see 'perf list --help' on how to encode it)", 1078 "rNNN (see 'perf list --help' on how to encode it)",
1078 event_type_descriptors[PERF_TYPE_RAW]); 1079 event_type_descriptors[PERF_TYPE_RAW]);
1079 printf("\n"); 1080 printf("\n");
1080 1081
1081 printf(" %-42s [%s]\n", 1082 printf(" %-50s [%s]\n",
1082 "mem:<addr>[:access]", 1083 "mem:<addr>[:access]",
1083 event_type_descriptors[PERF_TYPE_BREAKPOINT]); 1084 event_type_descriptors[PERF_TYPE_BREAKPOINT]);
1084 printf("\n"); 1085 printf("\n");