1 /* This file is part of the Linux Trace Toolkit viewer
2 * Copyright (C) 2003-2004 XangXiu Yang
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License Version 2 as
6 * published by the Free Software Foundation;
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
29 #include <ltt/event.h>
30 #include <ltt/trace.h>
32 #include <lttv/lttv.h>
33 #include <lttv/module.h>
34 #include <lttv/tracecontext.h>
35 #include <lttv/hook.h>
36 #include <lttv/state.h>
37 #include <lttv/stats.h>
39 #include <lttvwindow/lttvwindow.h>
40 #include <lttvwindow/lttvwindowtraces.h>
41 #include <lttvwindow/lttv_plugin_tab.h>
43 #include "hGuiStatisticInsert.xpm"
45 #define PATH_LENGTH 256 /* CHECK */
46 #define MAX_NUMBER_EVENT "max_number_event"
49 //static GPtrArray * statistic_traceset;
51 /** Array containing instanced objects. Used when module is unloaded */
52 static GSList
*g_statistic_viewer_data_list
= NULL
;
54 typedef struct _StatisticViewerData StatisticViewerData
;
56 static void request_background_data(StatisticViewerData
*svd
);
57 GtkWidget
*guistatistic_get_widget(StatisticViewerData
*svd
);
59 //! Statistic Viewer's constructor hook
60 GtkWidget
*h_gui_statistic(LttvPlugin
*plugin
);
61 //! Statistic Viewer's constructor
62 StatisticViewerData
*gui_statistic(LttvPluginTab
*ptab
);
63 //! Statistic Viewer's destructor
64 void gui_statistic_destructor(StatisticViewerData
*statistic_viewer_data
);
66 static void tree_selection_changed_cb (GtkTreeSelection
*selection
, gpointer data
);
68 void statistic_destroy_hash_key(gpointer key
);
69 void statistic_destroy_hash_data(gpointer data
);
71 void show_traceset_stats(StatisticViewerData
* statistic_viewer_data
);
72 void show_tree(StatisticViewerData
* statistic_viewer_data
,
73 LttvAttribute
* stats
, GtkTreeIter
* parent
);
74 void show_statistic(StatisticViewerData
* statistic_viewer_data
,
75 LttvAttribute
* stats
, GtkTextBuffer
* buf
);
78 gboolean
statistic_traceset_changed(void * hook_data
, void * call_data
);
79 //void statistic_add_context_hooks(StatisticViewerData * statistic_viewer_data,
80 // LttvTracesetContext * tsc);
81 //void statistic_remove_context_hooks(StatisticViewerData *statistic_viewer_data,
82 // LttvTracesetContext * tsc);
84 //gboolean statistic_insert_traceset_stats(void * stats);
92 struct _StatisticViewerData
{
95 //LttvTracesetStats * stats;
98 //gboolean shown; //indicate if the statistic is shown or not
101 GtkWidget
* hpaned_v
;
102 GtkTreeStore
* store_m
;
105 //scroll window containing Tree View
106 GtkWidget
* scroll_win_tree
;
109 //scroll window containing Text View
110 GtkWidget
* scroll_win_text
;
113 GtkTreeSelection
*select_c
;
116 GHashTable
*statistic_hash
;
118 guint background_info_waiting
;
124 /* Action to do when background computation completed.
126 * Eventually, will have to check that every requested traces are finished
127 * before doing the redraw. It will save unnecessary processor usage.
130 static gint
background_ready(void *hook_data
, void *call_data
)
132 StatisticViewerData
*svd
= (StatisticViewerData
*)hook_data
;
135 svd
->background_info_waiting
--;
137 if(svd
->background_info_waiting
== 0) {
138 g_message("statistics viewer : background computation data ready.");
140 gtk_tree_store_clear (svd
->store_m
);
142 lttv_stats_sum_traceset(lttvwindow_get_traceset_stats(tab
),
144 show_traceset_stats(svd
);
150 /* Request background computation. Verify if it is in progress or ready first.
152 * Right now, for all loaded traces.
154 * Later : must be only for each trace in the tab's traceset.
156 static void request_background_data(StatisticViewerData
*svd
)
158 gint num_traces
= lttvwindowtraces_get_number();
163 LttvHooks
*background_ready_hook
=
165 lttv_hooks_add(background_ready_hook
, background_ready
, svd
,
167 svd
->background_info_waiting
= num_traces
;
168 buf
= gtk_text_view_get_buffer((GtkTextView
*)svd
->text_v
);
169 gtk_text_buffer_set_text(buf
,"", -1);
171 for(i
=0;i
<num_traces
;i
++) {
172 trace
= lttvwindowtraces_get_trace(i
);
174 if(lttvwindowtraces_get_ready(g_quark_from_string("stats"),trace
)==FALSE
) {
176 if(lttvwindowtraces_get_in_progress(g_quark_from_string("stats"),
178 /* We first remove requests that could have been done for the same
179 * information. Happens when two viewers ask for it before servicing
182 if(!lttvwindowtraces_background_request_find(trace
, "stats"))
183 lttvwindowtraces_background_request_queue(
184 main_window_get_widget(svd
->tab
), trace
, "stats");
185 lttvwindowtraces_background_notify_queue(svd
,
189 background_ready_hook
);
190 } else { /* in progress */
191 lttvwindowtraces_background_notify_current(svd
,
195 background_ready_hook
);
200 lttv_hooks_call(background_ready_hook
, NULL
);
204 if(num_traces
== 0) {
205 svd
->background_info_waiting
= 1;
206 lttv_hooks_call(background_ready_hook
, NULL
);
208 lttv_hooks_destroy(background_ready_hook
);
212 GtkWidget
*guistatistic_get_widget(StatisticViewerData
*svd
)
214 return svd
->hpaned_v
;
219 gui_statistic_destructor(StatisticViewerData
*statistic_viewer_data
)
221 Tab
*tab
= statistic_viewer_data
->tab
;
223 /* May already been done by GTK window closing */
224 if(GTK_IS_WIDGET(guistatistic_get_widget(statistic_viewer_data
))){
225 g_info("widget still exists");
228 lttvwindow_unregister_traceset_notify(statistic_viewer_data
->tab
,
229 statistic_traceset_changed
,
230 statistic_viewer_data
);
232 lttvwindowtraces_background_notify_remove(statistic_viewer_data
);
234 g_hash_table_destroy(statistic_viewer_data
->statistic_hash
);
235 g_statistic_viewer_data_list
=
236 g_slist_remove(g_statistic_viewer_data_list
, statistic_viewer_data
);
237 g_free(statistic_viewer_data
);
242 * Statistic Viewer's constructor hook
244 * This constructor is given as a parameter to the menuitem and toolbar button
245 * registration. It creates the list.
246 * @param parent_window A pointer to the parent window.
247 * @return The widget created.
250 h_gui_statistic(LttvPlugin
*plugin
)
252 LttvPluginTab
*ptab
= LTTV_PLUGIN_TAB(plugin
);
253 StatisticViewerData
* statistic_viewer_data
= gui_statistic(ptab
) ;
255 if(statistic_viewer_data
)
256 return guistatistic_get_widget(statistic_viewer_data
);
262 gboolean
statistic_insert_traceset_stats(void * stats
)
267 len
= statistic_traceset
->len
;
269 s
= g_ptr_array_index(statistic_traceset
, i
);
270 if(s
== stats
) break;
273 g_ptr_array_add(statistic_traceset
, stats
);
281 * Statistic Viewer's constructor
283 * This constructor is used to create StatisticViewerData data structure.
284 * @return The Statistic viewer data created.
286 StatisticViewerData
*
287 gui_statistic(LttvPluginTab
*ptab
)
289 GtkCellRenderer
*renderer
;
290 GtkTreeViewColumn
*column
;
292 StatisticViewerData
* statistic_viewer_data
= g_new(StatisticViewerData
,1);
293 Tab
*tab
= ptab
->tab
;
294 statistic_viewer_data
->tab
= tab
;
295 statistic_viewer_data
->ptab
= ptab
;
296 // statistic_viewer_data->stats =
297 // lttvwindow_get_traceset_stats(statistic_viewer_data->tab);
298 // statistic_viewer_data->calculate_stats =
299 // statistic_insert_traceset_stats((void *)statistic_viewer_data->stats);
301 lttvwindow_register_traceset_notify(statistic_viewer_data
->tab
,
302 statistic_traceset_changed
,
303 statistic_viewer_data
);
305 statistic_viewer_data
->statistic_hash
= g_hash_table_new_full(g_str_hash
,
307 statistic_destroy_hash_key
,
310 statistic_viewer_data
->hpaned_v
= gtk_hpaned_new();
311 statistic_viewer_data
->store_m
= gtk_tree_store_new (N_COLUMNS
, G_TYPE_STRING
);
312 statistic_viewer_data
->tree_v
=
313 gtk_tree_view_new_with_model (
314 GTK_TREE_MODEL (statistic_viewer_data
->store_m
));
315 g_object_unref (G_OBJECT (statistic_viewer_data
->store_m
));
317 // Setup the selection handler
318 statistic_viewer_data
->select_c
= gtk_tree_view_get_selection (GTK_TREE_VIEW (statistic_viewer_data
->tree_v
));
319 gtk_tree_selection_set_mode (statistic_viewer_data
->select_c
, GTK_SELECTION_SINGLE
);
320 g_signal_connect (G_OBJECT (statistic_viewer_data
->select_c
), "changed",
321 G_CALLBACK (tree_selection_changed_cb
),
322 statistic_viewer_data
);
324 renderer
= gtk_cell_renderer_text_new ();
325 column
= gtk_tree_view_column_new_with_attributes ("Statistic Name",
329 gtk_tree_view_column_set_alignment (column
, 0.0);
330 // gtk_tree_view_column_set_fixed_width (column, 45);
331 gtk_tree_view_append_column (GTK_TREE_VIEW (statistic_viewer_data
->tree_v
), column
);
334 gtk_tree_view_set_headers_visible(GTK_TREE_VIEW (statistic_viewer_data
->tree_v
), FALSE
);
336 statistic_viewer_data
->scroll_win_tree
= gtk_scrolled_window_new (NULL
, NULL
);
337 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(statistic_viewer_data
->scroll_win_tree
),
338 GTK_POLICY_AUTOMATIC
,GTK_POLICY_AUTOMATIC
);
340 gtk_container_add (GTK_CONTAINER (statistic_viewer_data
->scroll_win_tree
), statistic_viewer_data
->tree_v
);
341 gtk_paned_pack1(GTK_PANED(statistic_viewer_data
->hpaned_v
),statistic_viewer_data
->scroll_win_tree
, TRUE
, FALSE
);
342 gtk_paned_set_position(GTK_PANED(statistic_viewer_data
->hpaned_v
), 160);
344 statistic_viewer_data
->scroll_win_text
= gtk_scrolled_window_new (NULL
, NULL
);
345 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(statistic_viewer_data
->scroll_win_text
),
346 GTK_POLICY_AUTOMATIC
,GTK_POLICY_AUTOMATIC
);
348 statistic_viewer_data
->text_v
= gtk_text_view_new ();
350 gtk_text_view_set_editable(GTK_TEXT_VIEW(statistic_viewer_data
->text_v
),FALSE
);
351 gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(statistic_viewer_data
->text_v
),FALSE
);
352 gtk_container_add (GTK_CONTAINER (statistic_viewer_data
->scroll_win_text
), statistic_viewer_data
->text_v
);
353 gtk_paned_pack2(GTK_PANED(statistic_viewer_data
->hpaned_v
), statistic_viewer_data
->scroll_win_text
, TRUE
, FALSE
);
355 gtk_container_set_border_width(
356 GTK_CONTAINER(statistic_viewer_data
->hpaned_v
), 1);
358 gtk_widget_show(statistic_viewer_data
->scroll_win_tree
);
359 gtk_widget_show(statistic_viewer_data
->scroll_win_text
);
360 gtk_widget_show(statistic_viewer_data
->tree_v
);
361 gtk_widget_show(statistic_viewer_data
->text_v
);
362 gtk_widget_show(statistic_viewer_data
->hpaned_v
);
364 g_object_set_data_full(
365 G_OBJECT(guistatistic_get_widget(statistic_viewer_data
)),
366 "statistic_viewer_data",
367 statistic_viewer_data
,
368 (GDestroyNotify
)gui_statistic_destructor
);
370 /* Add the object's information to the module's array */
371 g_statistic_viewer_data_list
= g_slist_append(
372 g_statistic_viewer_data_list
,
373 statistic_viewer_data
);
375 request_background_data(statistic_viewer_data
);
377 return statistic_viewer_data
;
381 tree_selection_changed_cb (GtkTreeSelection
*selection
, gpointer data
)
383 StatisticViewerData
*statistic_viewer_data
= (StatisticViewerData
*)data
;
385 GtkTreeModel
*model
= GTK_TREE_MODEL(statistic_viewer_data
->store_m
);
390 GtkTextIter text_iter
;
391 LttvAttribute
* stats
;
393 if (gtk_tree_selection_get_selected (selection
, &model
, &iter
))
395 gtk_tree_model_get (model
, &iter
, NAME_COLUMN
, &event
, -1);
397 path
= gtk_tree_model_get_path(GTK_TREE_MODEL(model
),&iter
);
398 str
= gtk_tree_path_to_string (path
);
399 stats
= (LttvAttribute
*)g_hash_table_lookup (statistic_viewer_data
->statistic_hash
,str
);
402 buf
= gtk_text_view_get_buffer((GtkTextView
*)statistic_viewer_data
->text_v
);
403 gtk_text_buffer_set_text(buf
,"Statistic for '", -1);
404 gtk_text_buffer_get_end_iter(buf
, &text_iter
);
405 gtk_text_buffer_insert(buf
, &text_iter
, event
, strlen(event
));
406 gtk_text_buffer_get_end_iter(buf
, &text_iter
);
407 gtk_text_buffer_insert(buf
, &text_iter
, "' :\n\n",5);
409 show_statistic(statistic_viewer_data
, stats
, buf
);
415 void statistic_destroy_hash_key(gpointer key
)
427 void show_traceset_stats(StatisticViewerData
* statistic_viewer_data
)
429 Tab
*tab
= statistic_viewer_data
->tab
;
433 LttvTracesetStats
* tscs
= lttvwindow_get_traceset_stats(tab
);
434 gchar
* str
, trace_str
[PATH_LENGTH
];
437 GtkTreeStore
* store
= statistic_viewer_data
->store_m
;
439 if(tscs
->stats
== NULL
) return;
441 lttv_attribute_write_xml(tscs
->stats
, stdout
, 1, 4);
444 ts
= tscs
->parent
.parent
.ts
;
445 nb
= lttv_traceset_number(ts
);
448 gtk_tree_store_append (store
, &iter
, NULL
);
449 gtk_tree_store_set (store
, &iter
,
450 NAME_COLUMN
, "Traceset statistics",
452 path
= gtk_tree_model_get_path(GTK_TREE_MODEL(store
), &iter
);
453 str
= gtk_tree_path_to_string (path
);
454 g_hash_table_insert(statistic_viewer_data
->statistic_hash
,
455 (gpointer
)str
, tscs
->stats
);
456 show_tree(statistic_viewer_data
, tscs
->stats
, &iter
);
458 //show stats for all traces
459 for(i
= 0 ; i
< nb
; i
++) {
460 tcs
= (LttvTraceStats
*)(LTTV_TRACESET_CONTEXT(tscs
)->traces
[i
]);
462 desc
= ltt_trace_system_description(tcs
->parent
.parent
.t
);
463 LttTime start_time
= ltt_trace_system_description_trace_start_time(desc
);
464 sprintf(trace_str
, "Trace on system %s at time %lu.%09lu",
465 ltt_trace_system_description_node_name(desc
),
469 sprintf(trace_str
, "%s", g_quark_to_string(ltt_trace_name(tcs
->parent
.parent
.t
)));
470 gtk_tree_store_append (store
, &iter
, NULL
);
471 gtk_tree_store_set (store
, &iter
,NAME_COLUMN
,trace_str
,-1);
472 path
= gtk_tree_model_get_path(GTK_TREE_MODEL(store
), &iter
);
473 str
= gtk_tree_path_to_string (path
);
474 g_hash_table_insert(statistic_viewer_data
->statistic_hash
,
475 (gpointer
)str
,tcs
->stats
);
476 show_tree(statistic_viewer_data
, tcs
->stats
, &iter
);
478 lttv_attribute_write_xml(tcs
->stats
, stdout
, 3, 4);
483 void show_tree(StatisticViewerData
* statistic_viewer_data
,
484 LttvAttribute
* stats
, GtkTreeIter
* parent
)
487 LttvAttribute
*subtree
;
488 LttvAttributeName name
;
489 LttvAttributeValue value
;
490 LttvAttributeType type
;
492 gchar
* str
, dir_str
[PATH_LENGTH
];
495 GtkTreeStore
* store
= statistic_viewer_data
->store_m
;
497 nb
= lttv_attribute_get_number(stats
);
498 for(i
= 0 ; i
< nb
; i
++) {
499 type
= lttv_attribute_get(stats
, i
, &name
, &value
, &is_named
);
502 if(LTTV_IS_ATTRIBUTE(*(value
.v_gobject
))) {
503 subtree
= (LttvAttribute
*)*(value
.v_gobject
);
505 sprintf(dir_str
, "%s", g_quark_to_string(name
));
507 sprintf(dir_str
, "%u", name
);
508 gtk_tree_store_append (store
, &iter
, parent
);
509 gtk_tree_store_set (store
, &iter
,NAME_COLUMN
,dir_str
,-1);
510 path
= gtk_tree_model_get_path(GTK_TREE_MODEL(store
), &iter
);
511 str
= gtk_tree_path_to_string (path
);
512 g_hash_table_insert(statistic_viewer_data
->statistic_hash
,
513 (gpointer
)str
, subtree
);
514 show_tree(statistic_viewer_data
, subtree
, &iter
);
523 void show_statistic(StatisticViewerData
* statistic_viewer_data
,
524 LttvAttribute
* stats
, GtkTextBuffer
* buf
)
527 LttvAttributeName name
;
528 LttvAttributeValue value
;
529 LttvAttributeType type
;
531 gchar type_name
[PATH_LENGTH
], type_value
[PATH_LENGTH
];
532 GtkTextIter text_iter
;
535 nb
= lttv_attribute_get_number(stats
);
536 for(i
= 0 ; i
< nb
; i
++) {
537 type
= lttv_attribute_get(stats
, i
, &name
, &value
, &is_named
);
539 sprintf(type_name
,"%s", g_quark_to_string(name
));
541 sprintf(type_name
,"%u", name
);
542 type_value
[0] = '\0';
545 sprintf(type_value
, " : %d\n", *value
.v_int
);
548 sprintf(type_value
, " : %u\n", *value
.v_uint
);
551 sprintf(type_value
, " : %ld\n", *value
.v_long
);
554 sprintf(type_value
, " : %lu\n", *value
.v_ulong
);
557 sprintf(type_value
, " : %f\n", (double)*value
.v_float
);
560 sprintf(type_value
, " : %f\n", *value
.v_double
);
563 sprintf(type_value
, " : %10lu.%09lu\n", value
.v_time
->tv_sec
,
564 value
.v_time
->tv_nsec
);
567 sprintf(type_value
, " : POINTER\n");
570 sprintf(type_value
, " : %s\n", *value
.v_string
);
575 if(strlen(type_value
)){
577 strcat(type_name
,type_value
);
578 gtk_text_buffer_get_end_iter(buf
, &text_iter
);
579 gtk_text_buffer_insert(buf
, &text_iter
, type_name
, strlen(type_name
));
584 sprintf(type_value
, "No statistic information in this directory.\nCheck in subdirectories please.\n");
585 gtk_text_buffer_get_end_iter(buf
, &text_iter
);
586 gtk_text_buffer_insert(buf
, &text_iter
, type_value
, strlen(type_value
));
591 gboolean
statistic_traceset_changed(void * hook_data
, void * call_data
)
593 StatisticViewerData
*statistic_viewer_data
= (StatisticViewerData
*) hook_data
;
595 request_background_data(statistic_viewer_data
);
601 void statistic_add_context_hooks(StatisticViewerData
* statistic_viewer_data
,
602 LttvTracesetContext
* tsc
)
604 gint i
, j
, nbi
, nb_tracefile
;
606 LttvTraceContext
*tc
;
607 LttvTracefileContext
*tfc
;
608 LttvTracesetSelector
* ts_s
;
609 LttvTraceSelector
* t_s
;
610 LttvTracefileSelector
* tf_s
;
613 ts_s
= (LttvTracesetSelector
*)g_object_get_data(G_OBJECT(statistic_viewer_data
->hpaned_v
),
614 statistic_viewer_data
->filter_key
);
616 //if there are hooks for traceset, add them here
618 nbi
= lttv_traceset_number(tsc
->ts
);
619 for(i
= 0 ; i
< nbi
; i
++) {
620 t_s
= lttv_traceset_selector_trace_get(ts_s
,i
);
621 selected
= lttv_trace_selector_get_selected(t_s
);
622 if(!selected
) continue;
625 //if there are hooks for trace, add them here
627 nb_tracefile
= ltt_trace_control_tracefile_number(trace
) +
628 ltt_trace_per_cpu_tracefile_number(trace
);
630 for(j
= 0 ; j
< nb_tracefile
; j
++) {
631 tf_s
= lttv_trace_selector_tracefile_get(t_s
,j
);
632 selected
= lttv_tracefile_selector_get_selected(tf_s
);
633 if(!selected
) continue;
634 tfc
= tc
->tracefiles
[j
];
636 //if there are hooks for tracefile, add them here
637 // lttv_tracefile_context_add_hooks(tfc, NULL,NULL,NULL,NULL,
638 // statistic_viewer_data->before_event_hooks,NULL);
642 lttv_stats_add_event_hooks(LTTV_TRACESET_STATS(tsc
));
646 void statistic_remove_context_hooks(StatisticViewerData
* statistic_viewer_data
,
647 LttvTracesetContext
* tsc
)
649 gint i
, j
, nbi
, nb_tracefile
;
651 LttvTraceContext
*tc
;
652 LttvTracefileContext
*tfc
;
653 LttvTracesetSelector
* ts_s
;
654 LttvTraceSelector
* t_s
;
655 LttvTracefileSelector
* tf_s
;
658 ts_s
= (LttvTracesetSelector
*)g_object_get_data(G_OBJECT(statistic_viewer_data
->hpaned_v
),
659 statistic_viewer_data
->filter_key
);
661 //if there are hooks for traceset, remove them here
663 nbi
= lttv_traceset_number(tsc
->ts
);
664 for(i
= 0 ; i
< nbi
; i
++) {
665 t_s
= lttv_traceset_selector_trace_get(ts_s
,i
);
666 selected
= lttv_trace_selector_get_selected(t_s
);
667 if(!selected
) continue;
670 //if there are hooks for trace, remove them here
672 nb_tracefile
= ltt_trace_control_tracefile_number(trace
) +
673 ltt_trace_per_cpu_tracefile_number(trace
);
675 for(j
= 0 ; j
< nb_tracefile
; j
++) {
676 tf_s
= lttv_trace_selector_tracefile_get(t_s
,j
);
677 selected
= lttv_tracefile_selector_get_selected(tf_s
);
678 if(!selected
) continue;
679 tfc
= tc
->tracefiles
[j
];
681 //if there are hooks for tracefile, remove them here
682 // lttv_tracefile_context_remove_hooks(tfc, NULL,NULL,NULL,NULL,
683 // statistic_viewer_data->before_event_hooks,NULL);
687 lttv_stats_remove_event_hooks(LTTV_TRACESET_STATS(tsc
));
692 * plugin's init function
694 * This function initializes the Statistic Viewer functionnality through the
699 lttvwindow_register_constructor("guistatistics",
701 "Insert Statistic Viewer",
702 hGuiStatisticInsert_xpm
,
703 "Insert Statistic Viewer",
707 void statistic_destroy_walk(gpointer data
, gpointer user_data
)
709 StatisticViewerData
*svd
= (StatisticViewerData
*)data
;
711 g_debug("CFV.c : statistic_destroy_walk, %p", svd
);
712 /* May already have been done by GTK window closing */
713 if(GTK_IS_WIDGET(guistatistic_get_widget(svd
)))
714 gtk_widget_destroy(guistatistic_get_widget(svd
));
718 * plugin's destroy function
720 * This function releases the memory reserved by the module and unregisters
721 * everything that has been registered in the gtkTraceSet API.
723 static void destroy() {
725 g_slist_foreach(g_statistic_viewer_data_list
, statistic_destroy_walk
, NULL
);
726 g_slist_free(g_statistic_viewer_data_list
);
728 lttvwindow_unregister_constructor(h_gui_statistic
);
733 LTTV_MODULE("guistatistics", "Statistics viewer", \
734 "Graphical module to view statistics about processes, CPUs and systems", \
735 init
, destroy
, "lttvwindow")