libtraceevent: Return error on event parsing if format parsing fails
PATCH 1/1 libtraceevent: Return error on event parsing if format parsing fails
From: "Steven Rostedt (Google)" <[email protected]>
The event parsing should not fail if the "print fmt" portion fails, as that is just a hint by the kernel on how to display the event. But that portion can contain kernel internal information that is not available to user space and there's no way the library can parse it properly. When that fails, the event printing falls back to simply showing the content of all the fields.
But if the fields themselves fail to parse, then there's no way to parse the event properly. This should end up as a failure of parsing the event.
Reported-by Shiju Jose <[email protected]>
Signed-off-by Steven Rostedt (Google) <[email protected]>
--- src/event-parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
src/event-parse.c +1 -1
@@ -7841,7 +7841,7 @@ static enum tep_errno parse_format(struct tep_event **eventp, ret =event_read_format (event);if (ret <0 ) { ret =TEP_ERRNO__READ_FORMAT_FAILED ; - goto event_parse_failed; + goto event_alloc_failed; }/*
Signature · 1 line
2.45.2