From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754506AbeAQQcm (ORCPT ); Wed, 17 Jan 2018 11:32:42 -0500 Received: from terminus.zytor.com ([65.50.211.136]:41801 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753933AbeAQQch (ORCPT ); Wed, 17 Jan 2018 11:32:37 -0500 Date: Wed, 17 Jan 2018 08:30:15 -0800 From: "tip-bot for Steven Rostedt (VMware)" Message-ID: Cc: mingo@kernel.org, tglx@linutronix.de, acme@redhat.com, akpm@linux-foundation.org, rostedt@goodmis.org, linux-kernel@vger.kernel.org, namhyung@kernel.org, hpa@zytor.com Reply-To: rostedt@goodmis.org, tglx@linutronix.de, acme@redhat.com, akpm@linux-foundation.org, mingo@kernel.org, hpa@zytor.com, namhyung@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20180112004822.542204577@goodmis.org> References: <20180112004822.542204577@goodmis.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] tools lib traceevent: Show contents (in hex) of data of unrecognized type records Git-Commit-ID: e877372880f72399323e433187cce2bfbea40263 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: e877372880f72399323e433187cce2bfbea40263 Gitweb: https://git.kernel.org/tip/e877372880f72399323e433187cce2bfbea40263 Author: Steven Rostedt (VMware) AuthorDate: Thu, 11 Jan 2018 19:47:47 -0500 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 17 Jan 2018 10:22:13 -0300 tools lib traceevent: Show contents (in hex) of data of unrecognized 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 Acked-by: Namhyung Kim Cc: Andrew Morton Link: http://lkml.kernel.org/r/20180112004822.542204577@goodmis.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/lib/traceevent/event-parse.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c index 344a034..e5f2acb 100644 --- a/tools/lib/traceevent/event-parse.c +++ b/tools/lib/traceevent/event-parse.c @@ -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; }