diff options
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/util/trace-event-parse.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c index 4b61b497040e..eae560503086 100644 --- a/tools/perf/util/trace-event-parse.c +++ b/tools/perf/util/trace-event-parse.c | |||
@@ -286,16 +286,19 @@ void parse_ftrace_printk(char *file, unsigned int size __unused) | |||
286 | char *line; | 286 | char *line; |
287 | char *next = NULL; | 287 | char *next = NULL; |
288 | char *addr_str; | 288 | char *addr_str; |
289 | char *fmt; | ||
290 | int i; | 289 | int i; |
291 | 290 | ||
292 | line = strtok_r(file, "\n", &next); | 291 | line = strtok_r(file, "\n", &next); |
293 | while (line) { | 292 | while (line) { |
293 | addr_str = strsep(&line, ":"); | ||
294 | if (!line) { | ||
295 | warning("error parsing print strings"); | ||
296 | break; | ||
297 | } | ||
294 | item = malloc_or_die(sizeof(*item)); | 298 | item = malloc_or_die(sizeof(*item)); |
295 | addr_str = strtok_r(line, ":", &fmt); | ||
296 | item->addr = strtoull(addr_str, NULL, 16); | 299 | item->addr = strtoull(addr_str, NULL, 16); |
297 | /* fmt still has a space, skip it */ | 300 | /* fmt still has a space, skip it */ |
298 | item->printk = strdup(fmt+1); | 301 | item->printk = strdup(line+1); |
299 | item->next = list; | 302 | item->next = list; |
300 | list = item; | 303 | list = item; |
301 | line = strtok_r(NULL, "\n", &next); | 304 | line = strtok_r(NULL, "\n", &next); |