aboutsummaryrefslogtreecommitdiffstats
path: root/parse-events.c
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-10-12 12:57:44 -0400
committerSteven Rostedt <rostedt@goodmis.org>2009-10-12 13:48:38 -0400
commited5ed8f37c85b91e0bcb89f0c8ec9d5b31bca047 (patch)
tree6cd8cea45c7a515e4fc452dbbd20f3e3982b4232 /parse-events.c
parente83791453f4461527d8fb4ffedb5bbe87d6ebfe1 (diff)
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 <rostedt@goodmis.org>
Diffstat (limited to 'parse-events.c')
-rw-r--r--parse-events.c16
1 files changed, 16 insertions, 0 deletions
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)
1679 if (read_expect_type(EVENT_DQUOTE, &token) < 0) 1679 if (read_expect_type(EVENT_DQUOTE, &token) < 0)
1680 goto fail; 1680 goto fail;
1681 1681
1682 concat:
1682 event->print_fmt.format = token; 1683 event->print_fmt.format = token;
1683 event->print_fmt.args = NULL; 1684 event->print_fmt.args = NULL;
1684 1685
@@ -1688,6 +1689,21 @@ int event_read_print(struct event *event)
1688 if (type == EVENT_NONE) 1689 if (type == EVENT_NONE)
1689 return 0; 1690 return 0;
1690 1691
1692 /* Handle concatination of print lines */
1693 if (type == EVENT_DQUOTE) {
1694 char *cat;
1695
1696 cat = malloc_or_die(strlen(event->print_fmt.format) +
1697 strlen(token) + 1);
1698 strcpy(cat, event->print_fmt.format);
1699 strcat(cat, token);
1700 free_token(token);
1701 free_token(event->print_fmt.format);
1702 event->print_fmt.format = NULL;
1703 token = cat;
1704 goto concat;
1705 }
1706
1691 if (test_type_token(type, token, EVENT_DELIM, ",")) 1707 if (test_type_token(type, token, EVENT_DELIM, ","))
1692 goto fail; 1708 goto fail;
1693 1709