1 /* This file is part of the Linux Trace Toolkit viewer
2 * Copyright (C) 2007 Pierre-Marc Fournier
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 "lttv_plugin_cfv.h"
31 #include "eventhooks.h"
33 #include "resourceview_icon.xpm"
34 #include "hLegendInsert.xpm"
38 /** Array containing instanced objects. Used when module is unloaded */
39 GSList
*g_control_flow_data_list
= NULL
;
41 GSList
*g_legend_list
= NULL
;
43 /*****************************************************************************
44 * Functions for module loading/unloading *
45 *****************************************************************************/
47 * plugin's init function
49 * This function initializes the Control Flow Viewer functionnality through the
54 g_info("Resource usage viewer init()");
56 /* Register the toolbar insert button and menu entry*/
57 lttvwindow_register_constructor("resourceview",
59 "Insert Resource Viewer",
60 resourceview_icon_xpm
,
61 "Insert Resource Viewer",
65 LTT_NAME_CPU
= g_quark_from_string("/cpu");
68 void destroy_walk(gpointer data
, gpointer user_data
)
70 g_info("Walk destroy Resource Viewer");
71 guicontrolflow_destructor_full((LttvPluginCFV
*)data
);
76 * plugin's destroy function
78 * This function releases the memory reserved by the module and unregisters
79 * everything that has been registered in the gtkTraceSet API.
81 static void destroy() {
82 g_info("GUI resource viewer destroy()");
84 g_slist_foreach(g_control_flow_data_list
, destroy_walk
, NULL
);
86 g_slist_free(g_control_flow_data_list
);
88 /* Unregister the toolbar insert button and menu entry */
89 lttvwindow_unregister_constructor(h_resourceview
);
93 LTTV_MODULE("resourceview", "Resource viewer", \
94 "Graphical module to view usage of resources", \
95 init
, destroy
, "lttvwindow")
This page took 0.030594 seconds and 4 git commands to generate.