Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 245489
b: refs/heads/master
c: 947b4ad
h: refs/heads/master
i:
  245487: 525d8c8
v: v3
  • Loading branch information
Ingo Molnar committed Apr 29, 2011
1 parent 0228ef8 commit b0e1a3d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 301120396b766ae4480e52ece220516a1707822b
refs/heads/master: 947b4ad1d198b7303ecc961f4939a331be0c48f0
25 changes: 13 additions & 12 deletions trunk/tools/perf/util/parse-events.c
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ void print_tracepoint_events(const char *subsys_glob, const char *event_glob)

snprintf(evt_path, MAXPATHLEN, "%s:%s",
sys_dirent.d_name, evt_dirent.d_name);
printf(" %-42s [%s]\n", evt_path,
printf(" %-50s [%s]\n", evt_path,
event_type_descriptors[PERF_TYPE_TRACEPOINT]);
}
closedir(evt_dir);
Expand Down Expand Up @@ -994,7 +994,7 @@ void print_events_type(u8 type)
else
snprintf(name, sizeof(name), "%s", syms->symbol);

printf(" %-42s [%s]\n", name,
printf(" %-50s [%s]\n", name,
event_type_descriptors[type]);
}
}
Expand All @@ -1012,11 +1012,10 @@ int print_hwcache_events(const char *event_glob)
for (i = 0; i < PERF_COUNT_HW_CACHE_RESULT_MAX; i++) {
char *name = event_cache_name(type, op, i);

if (event_glob != NULL &&
!strglobmatch(name, event_glob))
if (event_glob != NULL && !strglobmatch(name, event_glob))
continue;

printf(" %-42s [%s]\n", name,
printf(" %-50s [%s]\n", name,
event_type_descriptors[PERF_TYPE_HW_CACHE]);
++printed;
}
Expand All @@ -1026,14 +1025,16 @@ int print_hwcache_events(const char *event_glob)
return printed;
}

#define MAX_NAME_LEN 100

/*
* Print the help text for the event symbols:
*/
void print_events(const char *event_glob)
{
struct event_symbol *syms = event_symbols;
unsigned int i, type, prev_type = -1, printed = 0, ntypes_printed = 0;
char name[40];
struct event_symbol *syms = event_symbols;
char name[MAX_NAME_LEN];

printf("\n");
printf("List of pre-defined events (to be used in -e):\n");
Expand All @@ -1053,10 +1054,10 @@ void print_events(const char *event_glob)
continue;

if (strlen(syms->alias))
sprintf(name, "%s OR %s", syms->symbol, syms->alias);
snprintf(name, MAX_NAME_LEN, "%s OR %s", syms->symbol, syms->alias);
else
strcpy(name, syms->symbol);
printf(" %-42s [%s]\n", name,
strncpy(name, syms->symbol, MAX_NAME_LEN);
printf(" %-50s [%s]\n", name,
event_type_descriptors[type]);

prev_type = type;
Expand All @@ -1073,12 +1074,12 @@ void print_events(const char *event_glob)
return;

printf("\n");
printf(" %-42s [%s]\n",
printf(" %-50s [%s]\n",
"rNNN (see 'perf list --help' on how to encode it)",
event_type_descriptors[PERF_TYPE_RAW]);
printf("\n");

printf(" %-42s [%s]\n",
printf(" %-50s [%s]\n",
"mem:<addr>[:access]",
event_type_descriptors[PERF_TYPE_BREAKPOINT]);
printf("\n");
Expand Down

0 comments on commit b0e1a3d

Please sign in to comment.