1 /* This file is part of the Linux Trace Toolkit viewer
2 * Copyright (C) 2006 Parisa heidari (inspired from CFV by Mathieu Desnoyers)
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,
25 #include <lttv/lttv.h>
26 #include <lttv/module.h>
27 #include <lttvwindow/lttvwindow.h>
30 #include "histoeventhooks.h"
32 #include "hHistogramInsert.xpm"
37 /** Array containing instanced objects. Used when module is unloaded */
38 GSList *g_histo_control_flow_data_list = NULL ;
40 /*****************************************************************************
41 * Functions for module loading/unloading *
42 *****************************************************************************/
44 * plugin's init function
46 * This function initializes the Histogram Control Flow Viewer functionnality through the
49 static void histo_init() {
51 g_info("GUI ControlFlow Viewer init()");
53 /* Register the toolbar insert button and menu entry*/
54 lttvwindow_register_constructor("histogram",
56 "Insert Histogram Viewer",
58 "Insert Histogram Viewer",
59 h_guihistocontrolflow);
61 LTT_NAME_CPU = g_quark_from_string("/cpu");
64 void histo_destroy_walk(gpointer data, gpointer user_data)
66 g_info("Walk destroy GUI Histogram Control Flow Viewer");
67 guihistocontrolflow_destructor_full((HistoControlFlowData*)data);
73 * plugin's destroy function
75 * This function releases the memory reserved by the module and unregisters
76 * everything that has been registered in the gtkTraceSet API.
78 static void histo_destroy() {
79 g_info("GUI Histogram Control Flow Viewer destroy()");
81 g_slist_foreach(g_histo_control_flow_data_list, histo_destroy_walk, NULL );
83 g_slist_free(g_histo_control_flow_data_list);
85 /* Unregister the toolbar insert button and menu entry */
86 lttvwindow_unregister_constructor(h_guihistocontrolflow);
91 LTTV_MODULE("guihistogram", "Event Histogram viewer", \
92 "Graphical module to view events' density histogram", \
93 histo_init, histo_destroy, "lttvwindow")