2009-10-14 19:47:04

by Steven Rostedt

[permalink] [raw]
Subject: [PATCH 10/13] [PATCH 10/13] perf tools: handle both versions of ftrace output

From: Steven Rostedt <[email protected]>

The ftrace output events can have either arguments or no arguments.
The parser needs to be able to handle both.

Signed-off-by: Steven Rostedt <[email protected]>
---
tools/perf/util/trace-event-parse.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c
index 5f64644..6c3cb0a 100644
--- a/tools/perf/util/trace-event-parse.c
+++ b/tools/perf/util/trace-event-parse.c
@@ -1819,7 +1819,7 @@ static int event_read_print(struct event *event)
if (ret < 0)
return -1;

- return 0;
+ return ret;

fail:
free_token(token);
@@ -3088,6 +3088,9 @@ int parse_ftrace_file(char *buf, unsigned long size)
if (ret < 0)
die("failed to read ftrace event print fmt");

+ /* New ftrace handles args */
+ if (ret > 0)
+ return 0;
/*
* The arguments for ftrace files are parsed by the fields.
* Set up the fields as their arguments.
--
1.6.3.3


2009-10-15 08:51:49

by Steven Rostedt

[permalink] [raw]
Subject: [tip:perf/core] perf tools: Handle both versions of ftrace output

Commit-ID: 0d1da915c76838c9ee7af7cdefbcb2bae9424161
Gitweb: http://git.kernel.org/tip/0d1da915c76838c9ee7af7cdefbcb2bae9424161
Author: Steven Rostedt <[email protected]>
AuthorDate: Wed, 14 Oct 2009 15:43:41 -0400
Committer: Ingo Molnar <[email protected]>
CommitDate: Thu, 15 Oct 2009 10:42:39 +0200

perf tools: Handle both versions of ftrace output

The ftrace output events can have either arguments or no
arguments. The parser needs to be able to handle both.

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 | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/tools/perf/util/trace-event-parse.c b/tools/perf/util/trace-event-parse.c
index 93a82fe..c174765 100644
--- a/tools/perf/util/trace-event-parse.c
+++ b/tools/perf/util/trace-event-parse.c
@@ -1819,7 +1819,7 @@ static int event_read_print(struct event *event)
if (ret < 0)
return -1;

- return 0;
+ return ret;

fail:
free_token(token);
@@ -3088,6 +3088,9 @@ int parse_ftrace_file(char *buf, unsigned long size)
if (ret < 0)
die("failed to read ftrace event print fmt");

+ /* New ftrace handles args */
+ if (ret > 0)
+ return 0;
/*
* The arguments for ftrace files are parsed by the fields.
* Set up the fields as their arguments.