kernelshark: stop segfaults
From: Randy Dunlap <[email protected]>
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 <[email protected]>
--- kernel-shark.c | 3 +++ trace-filter.c | 6 ++++++ 2 files changed, 9 insertions(+)
kernel-shark.c +3 -0
@@ -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-filter.c +6 -0
@@ -717,6 +717,9 @@ void trace_adv_filter_dialog(struct tracGtkWidget *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(stgchar **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,