parse-events: Handle opcode parsing error
authorVaibhav Nagarnaik <vnagarnaik@google.com>
Thu, 5 Apr 2012 22:48:01 +0000 (00:48 +0200)
committerFrederic Weisbecker <fweisbec@gmail.com>
Wed, 25 Apr 2012 11:35:32 +0000 (13:35 +0200)
commit14ffde0e966efab6724e2de3ab470b78d4e01109
tree37ab19cc24cf0b2e17bd6d2ba6218f5eb077ed6f
parentd69afed55be1016c2bcfcb3e00cd5365d2f557f6
parse-events: Handle opcode parsing error

If an invalid opcode is encountered in parsing event print format, the
trace-cmd calls exit() without parsing any other events.

This patch adds handling for such an error where the get_op_prio() is
called. If the return value is -1, then the event print format parsing
is skipped and parsing continues.

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/1311619257-4970-1-git-send-email-vnagarnaik@google.com
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Arun Sharma <asharma@fb.com>
Cc: Namhyung Kim <namhyung.kim@lge.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
tools/lib/traceevent/event-parse.c