From: Steven Rostedt <[email protected]>
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.
Signef-off-by: Steven Rostedt <[email protected]>
---
tools/perf/util/trace-event-parse.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c
index 6f851f9..2fee75f 100644
--- a/tools/perf/util/trace-event-parse.c
+++ b/tools/perf/util/trace-event-parse.c
@@ -1734,6 +1734,7 @@ static 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;
@@ -1743,6 +1744,21 @@ static 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, (char *)","))
goto fail;
--
1.6.3.3
Commit-ID: 924a79af2cdee26a034b9bdce8c9c76995b5c901
Gitweb: http://git.kernel.org/tip/924a79af2cdee26a034b9bdce8c9c76995b5c901
Author: Steven Rostedt <[email protected]>
AuthorDate: Wed, 14 Oct 2009 15:43:32 -0400
Committer: Ingo Molnar <[email protected]>
CommitDate: Thu, 15 Oct 2009 10:42:34 +0200
perf tools: Handle print concatenations in event format file
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 concatenation.
Signed-off-by: Steven Rostedt <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
---
tools/perf/util/trace-event-parse.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c
index eef60df..a05c714 100644
--- a/tools/perf/util/trace-event-parse.c
+++ b/tools/perf/util/trace-event-parse.c
@@ -1734,6 +1734,7 @@ static 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;
@@ -1743,6 +1744,21 @@ static 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, (char *)","))
goto fail;