public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-trace-users@vger.kernel.org
Subject: Re: [PATCH] trace-view: Handle unknown events more gracefully
Date: Fri, 12 Nov 2010 09:04:16 +0100	[thread overview]
Message-ID: <4CDCF500.8000708@web.de> (raw)
In-Reply-To: <4CB758C1.8090906@web.de>

[-- Attachment #1: Type: text/plain, Size: 1328 bytes --]

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@web.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);



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]

  reply	other threads:[~2010-11-12  8:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-14 19:23 [PATCH] trace-view: Handle unknown events more gracefully Jan Kiszka
2010-11-12  8:04 ` Jan Kiszka [this message]
2010-11-12 11:55   ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CDCF500.8000708@web.de \
    --to=jan.kiszka@web.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-users@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox