diff options
author | Steven Rostedt <srostedt@redhat.com> | 2010-02-17 20:45:29 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2010-02-17 20:45:29 -0500 |
commit | 229c76d9937917a8a366a2547bf59b8d8842b263 (patch) | |
tree | 695c752dab7aedb6ae0d1f20d4ed8b232364bf2b | |
parent | d1416b81130c27f35bf79e7a84c9d3c2a79d3174 (diff) |
kernelshark: Add advance filters for list and graph
Add the advanced filter menu for list and graph.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | kernel-shark.c | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/kernel-shark.c b/kernel-shark.c index 92eea8e..1f679ad 100644 --- a/kernel-shark.c +++ b/kernel-shark.c | |||
@@ -229,6 +229,39 @@ graph_events_clicked (gpointer data) | |||
229 | ginfo); | 229 | ginfo); |
230 | } | 230 | } |
231 | 231 | ||
232 | /* Callback for the clicked signal of the List advanced filter button */ | ||
233 | static void | ||
234 | adv_list_filter_clicked (gpointer data) | ||
235 | { | ||
236 | struct shark_info *info = data; | ||
237 | struct event_filter *event_filter; | ||
238 | GtkTreeView *trace_tree = GTK_TREE_VIEW(info->treeview); | ||
239 | GtkTreeModel *model; | ||
240 | TraceViewStore *store; | ||
241 | |||
242 | model = gtk_tree_view_get_model(trace_tree); | ||
243 | if (!model) | ||
244 | return; | ||
245 | |||
246 | store = TRACE_VIEW_STORE(model); | ||
247 | |||
248 | event_filter = trace_view_store_get_event_filter(store); | ||
249 | |||
250 | trace_adv_filter_dialog(store->handle, event_filter, | ||
251 | trace_view_adv_filter_callback, trace_tree); | ||
252 | } | ||
253 | |||
254 | /* Callback for the clicked signal of the Graph advanced filter button */ | ||
255 | static void | ||
256 | adv_graph_filter_clicked (gpointer data) | ||
257 | { | ||
258 | struct shark_info *info = data; | ||
259 | struct graph_info *ginfo = info->ginfo; | ||
260 | |||
261 | trace_adv_filter_dialog(ginfo->handle, ginfo->event_filter, | ||
262 | trace_graph_adv_filter_callback, ginfo); | ||
263 | } | ||
264 | |||
232 | static void | 265 | static void |
233 | sync_graph_events_to_list_clicked (gpointer data) | 266 | sync_graph_events_to_list_clicked (gpointer data) |
234 | { | 267 | { |
@@ -772,6 +805,38 @@ void kernel_shark(int argc, char **argv) | |||
772 | gtk_widget_show(sub_item); | 805 | gtk_widget_show(sub_item); |
773 | 806 | ||
774 | 807 | ||
808 | /* --- Filter - List Advanced Events Option --- */ | ||
809 | |||
810 | sub_item = gtk_menu_item_new_with_label("list advanced event"); | ||
811 | |||
812 | /* Add them to the menu */ | ||
813 | gtk_menu_shell_append(GTK_MENU_SHELL (menu), sub_item); | ||
814 | |||
815 | /* We can attach the Quit menu item to our exit function */ | ||
816 | g_signal_connect_swapped (G_OBJECT (sub_item), "activate", | ||
817 | G_CALLBACK (adv_list_filter_clicked), | ||
818 | (gpointer) info); | ||
819 | |||
820 | /* We do need to show menu items */ | ||
821 | gtk_widget_show(sub_item); | ||
822 | |||
823 | |||
824 | /* --- Filter - Graph Advanced Events Option --- */ | ||
825 | |||
826 | sub_item = gtk_menu_item_new_with_label("graph advanced event"); | ||
827 | |||
828 | /* Add them to the menu */ | ||
829 | gtk_menu_shell_append(GTK_MENU_SHELL (menu), sub_item); | ||
830 | |||
831 | /* We can attach the Quit menu item to our exit function */ | ||
832 | g_signal_connect_swapped (G_OBJECT (sub_item), "activate", | ||
833 | G_CALLBACK (adv_graph_filter_clicked), | ||
834 | (gpointer) info); | ||
835 | |||
836 | /* We do need to show menu items */ | ||
837 | gtk_widget_show(sub_item); | ||
838 | |||
839 | |||
775 | /* --- Filter - CPUs Option --- */ | 840 | /* --- Filter - CPUs Option --- */ |
776 | 841 | ||
777 | sub_item = gtk_menu_item_new_with_label("list CPUs"); | 842 | sub_item = gtk_menu_item_new_with_label("list CPUs"); |