From ed5ed8f37c85b91e0bcb89f0c8ec9d5b31bca047 Mon Sep 17 00:00:00 2001 From: Steven Rostedt Date: Mon, 12 Oct 2009 12:57:44 -0400 Subject: handle print concatinations kmem_alloc ftrace event format had a string that was broken up by two tokens. "string 1" "string 2". This patch lets the parser be able to handle the concatination. Signed-off-by: Steven Rostedt --- parse-events.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'parse-events.c') diff --git a/parse-events.c b/parse-events.c index 4389c4e..b22cd71 100644 --- a/parse-events.c +++ b/parse-events.c @@ -1679,6 +1679,7 @@ int event_read_print(struct event *event) if (read_expect_type(EVENT_DQUOTE, &token) < 0) goto fail; + concat: event->print_fmt.format = token; event->print_fmt.args = NULL; @@ -1688,6 +1689,21 @@ int event_read_print(struct event *event) if (type == EVENT_NONE) return 0; + /* Handle concatination of print lines */ + if (type == EVENT_DQUOTE) { + char *cat; + + cat = malloc_or_die(strlen(event->print_fmt.format) + + strlen(token) + 1); + strcpy(cat, event->print_fmt.format); + strcat(cat, token); + free_token(token); + free_token(event->print_fmt.format); + event->print_fmt.format = NULL; + token = cat; + goto concat; + } + if (test_type_token(type, token, EVENT_DELIM, ",")) goto fail; -- cgit v1.2.2