mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Randy Dunlap <randy.dunlap@oracle.com>
To: lkml <linux-kernel@vger.kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Subject: kernelshark: stop segfaults
Date: Thu, 8 Apr 2010 15:57:36 -0700	[thread overview]
Message-ID: <20100408155736.3d12af4f.randy.dunlap@oracle.com> (raw)

From: Randy Dunlap <randy.dunlap@oracle.com>

Keep kernelshark from segfaulting when there is no open trace file.
It segfaults in:
  Filter->graph events
  Filter->graph advanced event
  Filter->list CPUs

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 kernel-shark.c |    3 +++
 trace-filter.c |    6 ++++++
 2 files changed, 9 insertions(+)

--- trace-cmd-0.7.0.orig/kernel-shark.c
+++ trace-cmd-0.7.0/kernel-shark.c
@@ -309,6 +309,9 @@ cpus_clicked (gpointer data)
 	gboolean all_cpus;
 	guint64 *cpu_mask;
 
+	if (!info->handle)
+		return;
+
 	store = TRACE_VIEW_STORE(gtk_tree_view_get_model(trace_tree));
 
 	all_cpus = trace_view_store_get_all_cpus(store);
--- trace-cmd-0.7.0.orig/trace-filter.c
+++ trace-cmd-0.7.0/trace-filter.c
@@ -717,6 +717,9 @@ void trace_adv_filter_dialog(struct trac
 	GtkWidget *view;
 	GtkWidget *event_box;
 
+	if (!handle)
+		return;
+
 	helper = g_malloc(sizeof(*helper));
 	g_assert(helper);
 
@@ -1762,6 +1765,9 @@ void trace_filter_event_filter_dialog(st
 	gchar **systems;
 	gint *event_ids;
 
+	if (!handle)
+		return;
+
 	trace_filter_convert_filter_to_names(filter, &systems, &event_ids);
 
 	filter_event_dialog(handle, filter, all_events, systems,

                 reply	other threads:[~2010-04-08 22:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20100408155736.3d12af4f.randy.dunlap@oracle.com \
    --to=randy.dunlap@oracle.com \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®