lkml.org 
[lkml]   [2009]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 06/13] [PATCH 06/13] perf tools: handle newlines in trace parsing better
From: Steven Rostedt <srostedt@redhat.com>

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>
---
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 d8c86f1..5dba81d 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));

--
1.6.3.3



\
 
 \ /
  Last update: 2009-10-14 22:15    [from the cache]
©2003-2011 Jasper Spaans