diff options
author | Steven Rostedt <srostedt@redhat.com> | 2009-10-14 15:43:37 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-10-15 10:42:37 +0200 |
commit | f1d1feecf07261d083859ecfef0d4399036f9683 (patch) | |
tree | aebca45d8bc2f4207b52f07ce12d45dd0561e37a | |
parent | b99af874829cba2b30d212bc6fd31b56275ee4d2 (diff) |
perf tools: Handle newlines in trace parsing better
New lines between args in the trace format can break the
parsing. This should not be the case.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
LKML-Reference: <20091014194358.637991808@goodmis.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | tools/perf/util/trace-event-parse.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c index f73ee55b51e..59e4e4db743 100644 --- a/tools/perf/util/trace-event-parse.c +++ b/tools/perf/util/trace-event-parse.c @@ -1716,12 +1716,18 @@ process_arg_token(struct event *event, struct print_arg *arg, static int event_read_print_args(struct event *event, struct print_arg **list) { - enum event_type type; + enum event_type type = EVENT_ERROR; struct print_arg *arg; char *token; int args = 0; do { + if (type == EVENT_NEWLINE) { + free_token(token); + type = read_token_item(&token); + continue; + } + arg = malloc_or_die(sizeof(*arg)); memset(arg, 0, sizeof(*arg)); |