X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Fmodules%2Fgui%2Fstatistics%2Fstatistics.c;h=bec260f06e267bf1ab7f3629479c41138086046e;hb=203eb6f75ad579321e4fc8dc308eb0b2d66d86d9;hp=8c241c641583ab2eaeff4057fac08f5bdaacae74;hpb=cef97e7c926bfe509b0b58d9c38bab60d30c81f8;p=lttv.git diff --git a/ltt/branches/poly/lttv/modules/gui/statistics/statistics.c b/ltt/branches/poly/lttv/modules/gui/statistics/statistics.c index 8c241c64..bec260f0 100644 --- a/ltt/branches/poly/lttv/modules/gui/statistics/statistics.c +++ b/ltt/branches/poly/lttv/modules/gui/statistics/statistics.c @@ -16,50 +16,53 @@ * MA 02111-1307, USA. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include -#include +#include #include #include -#include -#include -#include -#include -#include -#include -#include - #include #include #include #include -#include +#include +#include +#include +#include +#include +#include -#include "../icons/hGuiStatisticInsert.xpm" +#include +#include -#define g_info(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_INFO, format) -#define g_debug(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, format) +#include "hGuiStatisticInsert.xpm" -#define PATH_LENGTH 256 +#define PATH_LENGTH 256 /* CHECK */ +#define MAX_NUMBER_EVENT "max_number_event" -static LttvModule *statistic_main_win_module; -static GPtrArray * statistic_traceset; +//???????????????6 +//static GPtrArray * statistic_traceset; /** Array containing instanced objects. Used when module is unloaded */ static GSList *g_statistic_viewer_data_list = NULL ; typedef struct _StatisticViewerData StatisticViewerData; +static void request_background_data(StatisticViewerData *svd); +GtkWidget *guistatistic_get_widget(StatisticViewerData *svd); + //! Statistic Viewer's constructor hook -GtkWidget *h_gui_statistic(MainWindow *parent_window, LttvTracesetSelector * s, char* key); +GtkWidget *h_gui_statistic(Tab *tab); //! Statistic Viewer's constructor -StatisticViewerData *gui_statistic(MainWindow *parent_window,LttvTracesetSelector * s, char* key); +StatisticViewerData *gui_statistic(Tab *tab); //! Statistic Viewer's destructor void gui_statistic_destructor(StatisticViewerData *statistic_viewer_data); -void gui_statistic_free(StatisticViewerData *statistic_viewer_data); -void grab_focus(GtkWidget *widget, gpointer data); static void tree_selection_changed_cb (GtkTreeSelection *selection, gpointer data); void statistic_destroy_hash_key(gpointer key); @@ -69,19 +72,16 @@ void show_traceset_stats(StatisticViewerData * statistic_viewer_data); void show_tree(StatisticViewerData * statistic_viewer_data, LttvAttribute* stats, GtkTreeIter* parent); void show_statistic(StatisticViewerData * statistic_viewer_data, - LttvAttribute* stats, GtkTextBuffer* buf); + LttvAttribute* stats, GtkTextBuffer* buf); -/** hook functions for update time interval, current time ... */ -gboolean statistic_update_time_window(void * hook_data, void * call_data); -gboolean statistic_show_viewer(void * hook_data, void * call_data); gboolean statistic_traceset_changed(void * hook_data, void * call_data); -void statistic_add_context_hooks(StatisticViewerData * statistic_viewer_data, - LttvTracesetContext * tsc); -void statistic_remove_context_hooks(StatisticViewerData * statistic_viewer_data, - LttvTracesetContext * tsc); +//void statistic_add_context_hooks(StatisticViewerData * statistic_viewer_data, +// LttvTracesetContext * tsc); +//void statistic_remove_context_hooks(StatisticViewerData *statistic_viewer_data, +// LttvTracesetContext * tsc); -gboolean statistic_insert_traceset_stats(void * stats); +//gboolean statistic_insert_traceset_stats(void * stats); enum { @@ -90,14 +90,12 @@ enum }; struct _StatisticViewerData{ - MainWindow * mw; - LttvTracesetStats * stats; - gboolean calculate_stats; + Tab *tab; + //LttvTracesetStats * stats; int size; - TimeInterval time_span; - gboolean shown; //indicate if the statistic is shown or not - char * filter_key; + //gboolean shown; //indicate if the statistic is shown or not + //char * filter_key; GtkWidget * hpaned_v; GtkTreeStore * store_m; @@ -118,83 +116,110 @@ struct _StatisticViewerData{ }; -/** - * plugin's init function + + +/* Action to do when background computation completed. * - * This function initializes the Statistic Viewer functionnality through the - * gtkTraceSet API. + * Eventually, will have to check that every requested traces are finished + * before doing the redraw. It will save unnecessary processor usage. */ -G_MODULE_EXPORT void init(LttvModule *self, int argc, char *argv[]) { - statistic_main_win_module = lttv_module_require(self, "mainwin", argc, argv); - - if(statistic_main_win_module == NULL){ - g_critical("Can't load Statistic Viewer : missing mainwin\n"); - return; - } +static gint background_ready(void *hook_data, void *call_data) +{ + StatisticViewerData *svd = (StatisticViewerData *)hook_data; + Tab *tab = svd->tab; + LttvTrace *trace = (LttvTrace*)call_data; - statistic_traceset = g_ptr_array_new (); + g_debug("statistics viewer : background computation data ready."); - /* Register the toolbar insert button */ - toolbar_item_reg(hGuiStatisticInsert_xpm, "Insert Statistic Viewer", h_gui_statistic); - - /* Register the menu item insert entry */ - menu_item_reg("/", "Insert Statistic Viewer", h_gui_statistic); - -} + gtk_tree_store_clear (svd->store_m); -void statistic_destroy_walk(gpointer data, gpointer user_data) -{ - gui_statistic_destructor((StatisticViewerData*)data); + lttv_stats_sum_traceset(lttvwindow_get_traceset_stats(tab)); + show_traceset_stats(svd); + + return 0; } -/** - * plugin's destroy function +/* Request background computation. Verify if it is in progress or ready first. * - * This function releases the memory reserved by the module and unregisters - * everything that has been registered in the gtkTraceSet API. + * Right now, for all loaded traces. + * + * Later : must be only for each trace in the tab's traceset. */ -G_MODULE_EXPORT void destroy() { - int i; +static void request_background_data(StatisticViewerData *svd) +{ + gint num_traces = lttvwindowtraces_get_number(); + gint i; + LttvTrace *trace; + + LttvHooks *background_ready_hook = + lttv_hooks_new(); + lttv_hooks_add(background_ready_hook, background_ready, svd, + LTTV_PRIO_DEFAULT); - if(g_statistic_viewer_data_list){ - g_slist_foreach(g_statistic_viewer_data_list, statistic_destroy_walk, NULL ); - g_slist_free(g_statistic_viewer_data_list); + for(i=0;imw); - unreg_show_viewer(statistic_show_viewer,statistic_viewer_data, statistic_viewer_data->mw); - unreg_update_traceset(statistic_traceset_changed,statistic_viewer_data, statistic_viewer_data->mw); - - g_hash_table_destroy(statistic_viewer_data->statistic_hash); - g_free(statistic_viewer_data->filter_key); - g_statistic_viewer_data_list = g_slist_remove(g_statistic_viewer_data_list, statistic_viewer_data); - g_free(statistic_viewer_data); - } +GtkWidget *guistatistic_get_widget(StatisticViewerData *svd) +{ + return svd->hpaned_v; } + void gui_statistic_destructor(StatisticViewerData *statistic_viewer_data) { + Tab *tab = statistic_viewer_data->tab; + /* May already been done by GTK window closing */ - if(GTK_IS_WIDGET(statistic_viewer_data->hpaned_v)){ - gtk_widget_destroy(statistic_viewer_data->hpaned_v); - statistic_viewer_data = NULL; + if(GTK_IS_WIDGET(guistatistic_get_widget(statistic_viewer_data))){ + g_info("widget still exists"); + } + if(tab != NULL) { + lttvwindow_unregister_traceset_notify(statistic_viewer_data->tab, + statistic_traceset_changed, + statistic_viewer_data); } - //gui_statistic_free(statistic_viewer_data); + lttvwindowtraces_background_notify_remove(statistic_viewer_data); + + g_hash_table_destroy(statistic_viewer_data->statistic_hash); + g_statistic_viewer_data_list = + g_slist_remove(g_statistic_viewer_data_list, statistic_viewer_data); + g_free(statistic_viewer_data); } @@ -207,16 +232,17 @@ gui_statistic_destructor(StatisticViewerData *statistic_viewer_data) * @return The widget created. */ GtkWidget * -h_gui_statistic(MainWindow * parent_window, LttvTracesetSelector * s, char* key) +h_gui_statistic(Tab *tab) { - StatisticViewerData* statistic_viewer_data = gui_statistic(parent_window, s, key) ; + StatisticViewerData* statistic_viewer_data = gui_statistic(tab) ; if(statistic_viewer_data) - return statistic_viewer_data->hpaned_v; + return guistatistic_get_widget(statistic_viewer_data); else return NULL; } +#if 0 gboolean statistic_insert_traceset_stats(void * stats) { int i, len; @@ -233,6 +259,7 @@ gboolean statistic_insert_traceset_stats(void * stats) } return FALSE; } +#endif //0 /** * Statistic Viewer's constructor @@ -241,34 +268,36 @@ gboolean statistic_insert_traceset_stats(void * stats) * @return The Statistic viewer data created. */ StatisticViewerData * -gui_statistic(MainWindow *parent_window, LttvTracesetSelector * s, char* key) +gui_statistic(Tab *tab) { GtkCellRenderer *renderer; GtkTreeViewColumn *column; StatisticViewerData* statistic_viewer_data = g_new(StatisticViewerData,1); - statistic_viewer_data->mw = parent_window; - statistic_viewer_data->stats = get_traceset_stats_api(statistic_viewer_data->mw); - statistic_viewer_data->calculate_stats = statistic_insert_traceset_stats((void *)statistic_viewer_data->stats); - - reg_update_time_window(statistic_update_time_window,statistic_viewer_data, statistic_viewer_data->mw); - reg_show_viewer(statistic_show_viewer,statistic_viewer_data, statistic_viewer_data->mw); - reg_update_traceset(statistic_traceset_changed,statistic_viewer_data, statistic_viewer_data->mw); + statistic_viewer_data->tab = tab; + // statistic_viewer_data->stats = + // lttvwindow_get_traceset_stats(statistic_viewer_data->tab); + // statistic_viewer_data->calculate_stats = + // statistic_insert_traceset_stats((void *)statistic_viewer_data->stats); - statistic_viewer_data->statistic_hash = g_hash_table_new_full(g_str_hash, g_str_equal, - statistic_destroy_hash_key, - statistic_destroy_hash_data); + lttvwindow_register_traceset_notify(statistic_viewer_data->tab, + statistic_traceset_changed, + statistic_viewer_data); + request_background_data(statistic_viewer_data); + + statistic_viewer_data->statistic_hash = g_hash_table_new_full(g_str_hash, + g_str_equal, + statistic_destroy_hash_key, + NULL); statistic_viewer_data->hpaned_v = gtk_hpaned_new(); statistic_viewer_data->store_m = gtk_tree_store_new (N_COLUMNS, G_TYPE_STRING); - statistic_viewer_data->tree_v = gtk_tree_view_new_with_model (GTK_TREE_MODEL (statistic_viewer_data->store_m)); + statistic_viewer_data->tree_v = + gtk_tree_view_new_with_model ( + GTK_TREE_MODEL (statistic_viewer_data->store_m)); g_object_unref (G_OBJECT (statistic_viewer_data->store_m)); - g_signal_connect (G_OBJECT (statistic_viewer_data->tree_v), "grab-focus", - G_CALLBACK (grab_focus), - statistic_viewer_data); - // Setup the selection handler statistic_viewer_data->select_c = gtk_tree_view_get_selection (GTK_TREE_VIEW (statistic_viewer_data->tree_v)); gtk_tree_selection_set_mode (statistic_viewer_data->select_c, GTK_SELECTION_SINGLE); @@ -301,54 +330,26 @@ gui_statistic(MainWindow *parent_window, LttvTracesetSelector * s, char* key) GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC); statistic_viewer_data->text_v = gtk_text_view_new (); - g_signal_connect (G_OBJECT (statistic_viewer_data->text_v), "grab-focus", - G_CALLBACK (grab_focus), - statistic_viewer_data); gtk_text_view_set_editable(GTK_TEXT_VIEW(statistic_viewer_data->text_v),FALSE); gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(statistic_viewer_data->text_v),FALSE); gtk_container_add (GTK_CONTAINER (statistic_viewer_data->scroll_win_text), statistic_viewer_data->text_v); gtk_paned_pack2(GTK_PANED(statistic_viewer_data->hpaned_v), statistic_viewer_data->scroll_win_text, TRUE, FALSE); + gtk_container_set_border_width( + GTK_CONTAINER(statistic_viewer_data->hpaned_v), 1); + gtk_widget_show(statistic_viewer_data->scroll_win_tree); gtk_widget_show(statistic_viewer_data->scroll_win_text); gtk_widget_show(statistic_viewer_data->tree_v); gtk_widget_show(statistic_viewer_data->text_v); gtk_widget_show(statistic_viewer_data->hpaned_v); - //get the life span of the traceset and set the upper of the scroll bar - get_traceset_time_span(statistic_viewer_data->mw, &statistic_viewer_data->time_span); - - statistic_viewer_data->shown = FALSE; - statistic_viewer_data->filter_key = g_strdup(key); - g_object_set_data( - G_OBJECT(statistic_viewer_data->hpaned_v), - statistic_viewer_data->filter_key, - s); - - g_object_set_data( - G_OBJECT(statistic_viewer_data->hpaned_v), - TRACESET_TIME_SPAN, - &statistic_viewer_data->time_span); - - if(statistic_viewer_data->calculate_stats){ - if(lttv_stats_load_statistics(statistic_viewer_data->stats)) - statistic_viewer_data->calculate_stats = FALSE; - } - - if(statistic_viewer_data->calculate_stats == FALSE){ - statistic_viewer_data->size = 1; - g_object_set_data( - G_OBJECT(statistic_viewer_data->hpaned_v), - MAX_NUMBER_EVENT, - &statistic_viewer_data->size); - } - g_object_set_data_full( - G_OBJECT(statistic_viewer_data->hpaned_v), + G_OBJECT(guistatistic_get_widget(statistic_viewer_data)), "statistic_viewer_data", statistic_viewer_data, - (GDestroyNotify)gui_statistic_free); + (GDestroyNotify)gui_statistic_destructor); /* Add the object's information to the module's array */ g_statistic_viewer_data_list = g_slist_append( @@ -358,13 +359,6 @@ gui_statistic(MainWindow *parent_window, LttvTracesetSelector * s, char* key) return statistic_viewer_data; } -void grab_focus(GtkWidget *widget, gpointer data) -{ - StatisticViewerData *statistic_viewer_data = (StatisticViewerData *)data; - MainWindow * mw = statistic_viewer_data->mw; - set_focused_pane(mw, gtk_widget_get_parent(statistic_viewer_data->hpaned_v)); -} - static void tree_selection_changed_cb (GtkTreeSelection *selection, gpointer data) { @@ -405,24 +399,34 @@ void statistic_destroy_hash_key(gpointer key) g_free(key); } -void statistic_destroy_hash_data(gpointer data) -{ - // g_free(data); -} +#ifdef DEBUG +#include +extern FILE *stdin; +extern FILE *stdout; +extern FILE *stderr; +#endif //DEBUG void show_traceset_stats(StatisticViewerData * statistic_viewer_data) { + Tab *tab = statistic_viewer_data->tab; int i, nb; LttvTraceset *ts; LttvTraceStats *tcs; LttSystemDescription *desc; - LttvTracesetStats * tscs = statistic_viewer_data->stats; + LttvTracesetStats * tscs = lttvwindow_get_traceset_stats(tab); gchar * str, trace_str[PATH_LENGTH]; GtkTreePath * path; GtkTreeIter iter; GtkTreeStore * store = statistic_viewer_data->store_m; if(tscs->stats == NULL) return; +#ifdef DEBUG + lttv_attribute_write_xml(tscs->stats, stdout, 1, 4); +#endif //DEBUG + + ts = tscs->parent.parent.ts; + nb = lttv_traceset_number(ts); + if(nb == 0)return; gtk_tree_store_append (store, &iter, NULL); gtk_tree_store_set (store, &iter, @@ -435,16 +439,16 @@ void show_traceset_stats(StatisticViewerData * statistic_viewer_data) show_tree(statistic_viewer_data, tscs->stats, &iter); //show stats for all traces - ts = tscs->parent.parent.ts; - nb = lttv_traceset_number(ts); - for(i = 0 ; i < nb ; i++) { tcs = (LttvTraceStats *)(LTTV_TRACESET_CONTEXT(tscs)->traces[i]); +#if 0 //FIXME desc = ltt_trace_system_description(tcs->parent.parent.t); - sprintf(trace_str, "Trace on system %s at time %d secs", + LttTime start_time = ltt_trace_system_description_trace_start_time(desc); + sprintf(trace_str, "Trace on system %s at time %lu.%09lu", ltt_trace_system_description_node_name(desc), - (ltt_trace_system_description_trace_start_time(desc)).tv_sec); - + start_time.tv_sec, + start_time.tv_nsec); +#endif //0 gtk_tree_store_append (store, &iter, NULL); gtk_tree_store_set (store, &iter,NAME_COLUMN,trace_str,-1); path = gtk_tree_model_get_path(GTK_TREE_MODEL(store), &iter); @@ -452,6 +456,9 @@ void show_traceset_stats(StatisticViewerData * statistic_viewer_data) g_hash_table_insert(statistic_viewer_data->statistic_hash, (gpointer)str,tcs->stats); show_tree(statistic_viewer_data, tcs->stats, &iter); +#ifdef DEBUG + lttv_attribute_write_xml(tcs->stats, stdout, 3, 4); +#endif //DEBUG } } @@ -495,7 +502,6 @@ void show_statistic(StatisticViewerData * statistic_viewer_data, LttvAttribute* stats, GtkTextBuffer* buf) { int i, nb , flag; - LttvAttribute *subtree; LttvAttributeName name; LttvAttributeValue value; LttvAttributeType type; @@ -528,7 +534,7 @@ void show_statistic(StatisticViewerData * statistic_viewer_data, sprintf(type_value, " : %f\n", *value.v_double); break; case LTTV_TIME: - sprintf(type_value, " : %10u.%09u\n", value.v_time->tv_sec, + sprintf(type_value, " : %10lu.%09lu\n", value.v_time->tv_sec, value.v_time->tv_nsec); break; case LTTV_POINTER: @@ -556,53 +562,20 @@ void show_statistic(StatisticViewerData * statistic_viewer_data, } } -gboolean statistic_update_time_window(void * hook_data, void * call_data) -{ - StatisticViewerData *statistic_viewer_data = (StatisticViewerData*) hook_data; - LttvTracesetContext * tsc = get_traceset_context(statistic_viewer_data->mw); - - //if statistic is already calculated, do nothing - if(!statistic_viewer_data->calculate_stats){ - return FALSE; - } - - if(statistic_viewer_data->shown == FALSE){ - statistic_add_context_hooks(statistic_viewer_data, tsc); - } - return FALSE; -} - -gboolean statistic_show_viewer(void * hook_data, void * call_data) -{ - StatisticViewerData *statistic_viewer_data = (StatisticViewerData*) hook_data; - LttvTracesetContext * tsc = get_traceset_context(statistic_viewer_data->mw); - - if(statistic_viewer_data->shown == FALSE){ - statistic_viewer_data->shown = TRUE; - show_traceset_stats(statistic_viewer_data); - if(statistic_viewer_data->calculate_stats){ - statistic_remove_context_hooks(statistic_viewer_data,tsc); - lttv_stats_save_statistics((LttvTracesetStats*)tsc); - } - } - - return FALSE; -} - gboolean statistic_traceset_changed(void * hook_data, void * call_data) { StatisticViewerData *statistic_viewer_data = (StatisticViewerData*) hook_data; - // gtk_tree_store_clear (statistic_viewer_data->store_m); - // statistic_viewer_data->shown = FALSE; + request_background_data(statistic_viewer_data); return FALSE; } +#if 0 void statistic_add_context_hooks(StatisticViewerData * statistic_viewer_data, LttvTracesetContext * tsc) { - gint i, j, nbi, nb_tracefile, nb_control, nb_per_cpu; + gint i, j, nbi, nb_tracefile; LttTrace *trace; LttvTraceContext *tc; LttvTracefileContext *tfc; @@ -625,19 +598,14 @@ void statistic_add_context_hooks(StatisticViewerData * statistic_viewer_data, trace = tc->t; //if there are hooks for trace, add them here - nb_control = ltt_trace_control_tracefile_number(trace); - nb_per_cpu = ltt_trace_per_cpu_tracefile_number(trace); - nb_tracefile = nb_control + nb_per_cpu; + nb_tracefile = ltt_trace_control_tracefile_number(trace) + + ltt_trace_per_cpu_tracefile_number(trace); for(j = 0 ; j < nb_tracefile ; j++) { tf_s = lttv_trace_selector_tracefile_get(t_s,j); selected = lttv_tracefile_selector_get_selected(tf_s); if(!selected) continue; - - if(j < nb_control) - tfc = tc->control_tracefiles[j]; - else - tfc = tc->per_cpu_tracefiles[j - nb_control]; + tfc = tc->tracefiles[j]; //if there are hooks for tracefile, add them here // lttv_tracefile_context_add_hooks(tfc, NULL,NULL,NULL,NULL, @@ -645,16 +613,14 @@ void statistic_add_context_hooks(StatisticViewerData * statistic_viewer_data, } } - //add state and stats hooks - //state_add_event_hooks_api(statistic_viewer_data->mw); //it will be added in the main window - stats_add_event_hooks_api(statistic_viewer_data->mw); + lttv_stats_add_event_hooks(LTTV_TRACESET_STATS(tsc)); } void statistic_remove_context_hooks(StatisticViewerData * statistic_viewer_data, LttvTracesetContext * tsc) { - gint i, j, nbi, nb_tracefile, nb_control, nb_per_cpu; + gint i, j, nbi, nb_tracefile; LttTrace *trace; LttvTraceContext *tc; LttvTracefileContext *tfc; @@ -677,19 +643,14 @@ void statistic_remove_context_hooks(StatisticViewerData * statistic_viewer_data, trace = tc->t; //if there are hooks for trace, remove them here - nb_control = ltt_trace_control_tracefile_number(trace); - nb_per_cpu = ltt_trace_per_cpu_tracefile_number(trace); - nb_tracefile = nb_control + nb_per_cpu; + nb_tracefile = ltt_trace_control_tracefile_number(trace) + + ltt_trace_per_cpu_tracefile_number(trace); for(j = 0 ; j < nb_tracefile ; j++) { tf_s = lttv_trace_selector_tracefile_get(t_s,j); selected = lttv_tracefile_selector_get_selected(tf_s); if(!selected) continue; - - if(j < nb_control) - tfc = tc->control_tracefiles[j]; - else - tfc = tc->per_cpu_tracefiles[j - nb_control]; + tfc = tc->tracefiles[j]; //if there are hooks for tracefile, remove them here // lttv_tracefile_context_remove_hooks(tfc, NULL,NULL,NULL,NULL, @@ -697,9 +658,53 @@ void statistic_remove_context_hooks(StatisticViewerData * statistic_viewer_data, } } - //remove state and stats hooks - //state_remove_event_hooks_api(statistic_viewer_data->mw); //it will be done in the main window - stats_remove_event_hooks_api(statistic_viewer_data->mw); + lttv_stats_remove_event_hooks(LTTV_TRACESET_STATS(tsc)); } +#endif //0 + +/** + * plugin's init function + * + * This function initializes the Statistic Viewer functionnality through the + * gtkTraceSet API. + */ +static void init() { + + lttvwindow_register_constructor("guistatistics", + "/", + "Insert Statistic Viewer", + hGuiStatisticInsert_xpm, + "Insert Statistic Viewer", + h_gui_statistic); +} + +void statistic_destroy_walk(gpointer data, gpointer user_data) +{ + StatisticViewerData *svd = (StatisticViewerData*)data; + + g_debug("CFV.c : statistic_destroy_walk, %p", svd); + /* May already have been done by GTK window closing */ + if(GTK_IS_WIDGET(guistatistic_get_widget(svd))) + gtk_widget_destroy(guistatistic_get_widget(svd)); +} + +/** + * plugin's destroy function + * + * This function releases the memory reserved by the module and unregisters + * everything that has been registered in the gtkTraceSet API. + */ +static void destroy() { + + g_slist_foreach(g_statistic_viewer_data_list, statistic_destroy_walk, NULL ); + g_slist_free(g_statistic_viewer_data_list); + + lttvwindow_unregister_constructor(h_gui_statistic); + +} + +LTTV_MODULE("guistatistics", "Statistics viewer", \ + "Graphical module to view statistics about processes, CPUs and systems", \ + init, destroy, "lttvwindow")