aboutsummaryrefslogtreecommitdiffstats
path: root/trace-input.c
diff options
context:
space:
mode:
authorVaibhav Nagarnaik <vnagarnaik@google.com>2011-08-11 15:37:38 -0400
committerSteven Rostedt <rostedt@goodmis.org>2011-08-18 21:37:56 -0400
commit2f9502685d7938128e51b13154fc8a84b80d3fb6 (patch)
tree4464c4362ab010f7a140a6aae9670aab56d083bf /trace-input.c
parent72a8ce0acbe2c51b2a7e9f04f1b47057ba01d62b (diff)
trace-cmd: Add --check-events to report
Add a new option --check-events to the report target which makes sure that the event formats in the trace data file can be parsed correctly on the machine that trace-cmd is running on. It returns EINVAL(22) for parsing failures and 0 for success. Cc: Michael Rubin <mrubin@google.com> Cc: David Sharp <dhsharp@google.com> Signed-off-by: Vaibhav Nagarnaik <vnagarnaik@google.com> Link: http://lkml.kernel.org/r/1313091459-12049-4-git-send-email-vnagarnaik@google.com Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'trace-input.c')
-rw-r--r--trace-input.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/trace-input.c b/trace-input.c
index 723d47f..8c2b858 100644
--- a/trace-input.c
+++ b/trace-input.c
@@ -342,10 +342,12 @@ static int read_ftrace_file(struct tracecmd_input *handle,
342 return -1; 342 return -1;
343 } 343 }
344 344
345 if (print) 345 if (print) {
346 printf("%.*s\n", (int)size, buf); 346 printf("%.*s\n", (int)size, buf);
347 else 347 } else {
348 pevent_parse_event(pevent, buf, size, "ftrace"); 348 if (pevent_parse_event(pevent, buf, size, "ftrace"))
349 pevent->parsing_failures = 1;
350 }
349 free(buf); 351 free(buf);
350 352
351 return 0; 353 return 0;
@@ -367,10 +369,12 @@ static int read_event_file(struct tracecmd_input *handle,
367 return -1; 369 return -1;
368 } 370 }
369 371
370 if (print) 372 if (print) {
371 printf("%.*s\n", (int)size, buf); 373 printf("%.*s\n", (int)size, buf);
372 else 374 } else {
373 pevent_parse_event(pevent, buf, size, system); 375 if (pevent_parse_event(pevent, buf, size, system))
376 pevent->parsing_failures = 1;
377 }
374 free(buf); 378 free(buf);
375 379
376 return 0; 380 return 0;