[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4CDCF500.8000708@web.de>
Date: Fri, 12 Nov 2010 09:04:16 +0100
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: Re: [PATCH] trace-view: Handle unknown events more gracefully
Am 14.10.2010 21:23, Jan Kiszka wrote:
> 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.
Ping...
Jan
>
> 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);
Download attachment "signature.asc" of type "application/pgp-signature" (260 bytes)
Powered by blists - more mailing lists