Skip to content

Commit

Permalink
tools lib traceevent: Show contents (in hex) of data of unrecognized …
Browse files Browse the repository at this point in the history
…type records

When a record has an unrecognized type, an error message is reported,
but it would also be helpful to see the contents of that record. At
least show what it is in hex, instead of just showing a blank line.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Link: http://lkml.kernel.org/r/20180112004822.542204577@goodmis.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Steven Rostedt (VMware) authored and Arnaldo Carvalho de Melo committed Jan 17, 2018
1 parent 37db96b commit e877372
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tools/lib/traceevent/event-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -5566,8 +5566,14 @@ void pevent_print_event(struct pevent *pevent, struct trace_seq *s,

event = pevent_find_event_by_record(pevent, record);
if (!event) {
do_warning("ug! no event found for type %d",
trace_parse_common_type(pevent, record->data));
int i;
int type = trace_parse_common_type(pevent, record->data);

do_warning("ug! no event found for type %d", type);
trace_seq_printf(s, "[UNKNOWN TYPE %d]", type);
for (i = 0; i < record->size; i++)
trace_seq_printf(s, " %02x",
((unsigned char *)record->data)[i]);
return;
}

Expand Down

0 comments on commit e877372

Please sign in to comment.