Skip to content

Commit

Permalink
perf tools: Handle newlines in trace parsing better
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Steven Rostedt authored and Ingo Molnar committed Oct 15, 2009
1 parent b99af87 commit f1d1fee
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tools/perf/util/trace-event-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down

0 comments on commit f1d1fee

Please sign in to comment.