mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* kernelshark: stop segfaults
@ 2010-04-08 22:57 Randy Dunlap
  0 siblings, 0 replies; only message in thread
From: Randy Dunlap @ 2010-04-08 22:57 UTC (permalink / raw)
  To: lkml; +Cc: Steven Rostedt

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,

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-04-08 22:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-08 22:57 kernelshark: stop segfaults Randy Dunlap

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®