Skip to content

Commit

Permalink
perf tools: Handle both versions of ftrace output
Browse files Browse the repository at this point in the history
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 <srostedt@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
LKML-Reference: <20091014194359.790221427@goodmis.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Steven Rostedt authored and Ingo Molnar committed Oct 15, 2009
1 parent ffa1895 commit 0d1da91
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tools/perf/util/trace-event-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 0d1da91

Please sign in to comment.