[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <4CB758C1.8090906@web.de>
Date: Thu, 14 Oct 2010 21:23:45 +0200
From: Jan Kiszka <jan.kiszka@....de>
To: Steven Rostedt <rostedt@...dmis.org>
CC: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-trace-users@...r.kernel.org
Subject: [PATCH] trace-view: Handle unknown events more gracefully
Kernel 2.6.35.7 generates invalid trace files due to
/sys/kernel/debug/tracing/events/scsi/scsi_dispatch_cmd_timeout/format
returning "FORMAT TOO BIG" (seems to be fixed in 2.6.36). This makes
pevent_data_event_from_type return NULL, and dereferencing of event
crashes the viewer.
Catch and report the error properly.
Signed-off-by: Jan Kiszka <jan.kiszka@....de>
---
trace-view-store.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/trace-view-store.c b/trace-view-store.c
index 0834df7..34f8155 100644
--- a/trace-view-store.c
+++ b/trace-view-store.c
@@ -507,12 +507,17 @@ trace_view_store_get_value (GtkTreeModel *tree_model,
case TRACE_VIEW_STORE_COL_INFO:
val = pevent_data_type(pevent, data);
event = pevent_data_event_from_type(pevent, val);
+ if (!event) {
+ if (column == TRACE_VIEW_STORE_COL_EVENT)
+ g_value_set_string(value, "[UNKNOWN EVENT]");
+ break;
+ }
+
if (column == TRACE_VIEW_STORE_COL_EVENT) {
g_value_set_string(value, event->name);
break;
}
-
trace_seq_init(&s);
pevent_event_info(&s, event, data);
g_value_set_string(value, s.buffer);
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists