1 /* This file is part of the Linux Trace Toolkit viewer
2 * Copyright (C) 2005 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,
27 #include <gdk/gdkkeysyms.h>
29 #include <lttv/lttv.h>
30 #include <lttv/module.h>
31 #include <lttv/hook.h>
33 #include <lttvwindow/lttvwindow.h>
34 #include <lttvwindow/lttvwindowtraces.h>
36 #include "hTraceControlInsert.xpm"
37 #include "TraceControlStart.xpm"
38 #include "TraceControlPause.xpm"
39 #include "TraceControlStop.xpm"
41 #include <sys/types.h>
45 #define MAX_ARGS_LEN PATH_MAX * 10
47 GSList
*g_control_list
= NULL
;
49 /*! \file lttv/modules/gui/tracecontrol/tracecontrol.c
50 * \brief Graphic trace start/stop control interface.
52 * This plugin interacts with lttctl to start/stop tracing. It needs to take the
53 * root password to be able to interact with lttctl.
57 typedef struct _ControlData ControlData
;
62 GtkWidget
*guicontrol_get_widget(ControlData
*tcd
);
63 ControlData
*gui_control(Tab
*tab
);
64 void gui_control_destructor(ControlData
*tcd
);
65 GtkWidget
* h_guicontrol(Tab
*tab
);
66 void control_destroy_walk(gpointer data
, gpointer user_data
);
72 static void start_clicked (GtkButton
*button
, gpointer user_data
);
73 static void pause_clicked (GtkButton
*button
, gpointer user_data
);
74 static void stop_clicked (GtkButton
*button
, gpointer user_data
);
77 * @struct _ControlData
79 * @brief Main structure of gui control
82 Tab
*tab
; /**< current tab of module */
84 GtkWidget
*window
; /**< window */
86 GtkWidget
*main_box
; /**< main container */
87 GtkWidget
*start_button
;
88 GtkWidget
*pause_button
;
89 GtkWidget
*stop_button
;
90 GtkWidget
*username_label
;
91 GtkWidget
*username_entry
;
92 GtkWidget
*password_label
;
93 GtkWidget
*password_entry
;
94 GtkWidget
*channel_dir_label
;
95 GtkWidget
*channel_dir_entry
;
96 GtkWidget
*trace_dir_label
;
97 GtkWidget
*trace_dir_entry
;
98 GtkWidget
*trace_name_label
;
99 GtkWidget
*trace_name_entry
;
100 GtkWidget
*trace_mode_label
;
101 GtkWidget
*trace_mode_combo
;
102 GtkWidget
*start_daemon_label
;
103 GtkWidget
*start_daemon_check
;
104 GtkWidget
*optional_label
;
105 GtkWidget
*subbuf_size_label
;
106 GtkWidget
*subbuf_size_entry
;
107 GtkWidget
*subbuf_num_label
;
108 GtkWidget
*subbuf_num_entry
;
109 GtkWidget
*lttctl_path_label
;
110 GtkWidget
*lttctl_path_entry
;
111 GtkWidget
*lttd_path_label
;
112 GtkWidget
*lttd_path_entry
;
113 GtkWidget
*fac_path_label
;
114 GtkWidget
*fac_path_entry
;
118 * @fn GtkWidget* guicontrol_get_widget(ControlData*)
120 * This function returns the current main widget
121 * used by this module
122 * @param tcd the module struct
123 * @return The main widget
126 guicontrol_get_widget(ControlData
*tcd
)
132 * @fn ControlData* gui_control(Tab*)
134 * Constructor is used to create ControlData data structure.
135 * @param tab The tab structure used by the widget
136 * @return The Filter viewer data created.
139 gui_control(Tab
*tab
)
141 g_debug("filter::gui_control()");
144 GtkCellRenderer
*renderer
;
145 GtkTreeViewColumn
*column
;
147 ControlData
* tcd
= g_new(ControlData
,1);
151 tcd
->window
= gtk_window_new(GTK_WINDOW_TOPLEVEL
);
152 gtk_window_set_title(GTK_WINDOW(tcd
->window
), "LTTng Trace Control");
154 * Initiating GtkTable layout
155 * starts with 2 rows and 5 columns and
156 * expands when expressions added
158 tcd
->main_box
= gtk_table_new(14,7,FALSE
);
159 gtk_table_set_row_spacings(GTK_TABLE(tcd
->main_box
),5);
160 gtk_table_set_col_spacings(GTK_TABLE(tcd
->main_box
),5);
162 gtk_container_add(GTK_CONTAINER(tcd
->window
), GTK_WIDGET(tcd
->main_box
));
165 * start/pause/stop buttons
169 pixbuf
= gdk_pixbuf_new_from_xpm_data((const char **)TraceControlStart_xpm
);
170 image
= gtk_image_new_from_pixbuf(pixbuf
);
171 tcd
->start_button
= gtk_button_new_with_label("start");
172 gtk_button_set_image(GTK_BUTTON(tcd
->start_button
), image
);
173 gtk_button_set_alignment(GTK_BUTTON(tcd
->start_button
), 0.0, 0.0);
174 gtk_widget_show (tcd
->start_button
);
175 gtk_table_attach( GTK_TABLE(tcd
->main_box
),tcd
->start_button
,6,7,0,1,GTK_FILL
,GTK_FILL
,2,2);
177 pixbuf
= gdk_pixbuf_new_from_xpm_data((const char **)TraceControlPause_xpm
);
178 image
= gtk_image_new_from_pixbuf(pixbuf
);
179 tcd
->pause_button
= gtk_button_new_with_label("pause");
180 gtk_button_set_image(GTK_BUTTON(tcd
->pause_button
), image
);
181 gtk_button_set_alignment(GTK_BUTTON(tcd
->pause_button
), 0.0, 0.0);
182 gtk_widget_show (tcd
->pause_button
);
183 gtk_table_attach( GTK_TABLE(tcd
->main_box
),tcd
->pause_button
,6,7,1,2,GTK_FILL
,GTK_FILL
,2,2);
185 pixbuf
= gdk_pixbuf_new_from_xpm_data((const char **)TraceControlStop_xpm
);
186 image
= gtk_image_new_from_pixbuf(pixbuf
);
187 tcd
->stop_button
= gtk_button_new_with_label("stop");
188 gtk_button_set_image(GTK_BUTTON(tcd
->stop_button
), image
);
189 gtk_button_set_alignment(GTK_BUTTON(tcd
->stop_button
), 0.0, 0.0);
190 gtk_widget_show (tcd
->stop_button
);
191 gtk_table_attach( GTK_TABLE(tcd
->main_box
),tcd
->stop_button
,6,7,2,3,GTK_FILL
,GTK_FILL
,2,2);
194 * First half of the filter window
195 * - textual entry of filter expression
196 * - processing button
198 tcd
->username_label
= gtk_label_new("Username:");
199 gtk_widget_show (tcd
->username_label
);
200 tcd
->username_entry
= gtk_entry_new();
201 gtk_entry_set_text(GTK_ENTRY(tcd
->username_entry
),"root");
202 gtk_widget_show (tcd
->username_entry
);
203 gtk_table_attach( GTK_TABLE(tcd
->main_box
),tcd
->username_label
,0,2,0,1,GTK_FILL
,GTK_FILL
,2,2);
204 gtk_table_attach( GTK_TABLE(tcd
->main_box
),tcd
->username_entry
,2,6,0,1,GTK_FILL
|GTK_EXPAND
|GTK_SHRINK
,GTK_FILL
,0,0);
208 tcd
->password_label
= gtk_label_new("Password:");
209 gtk_widget_show (tcd
->password_label
);
210 tcd
->password_entry
= gtk_entry_new();
211 gtk_entry_set_visibility(GTK_ENTRY(tcd
->password_entry
), FALSE
);
212 gtk_widget_show (tcd
->password_entry
);
213 gtk_table_attach( GTK_TABLE(tcd
->main_box
),tcd
->password_label
,0,2,1,2,GTK_FILL
,GTK_FILL
,2,2);
214 gtk_table_attach( GTK_TABLE(tcd
->main_box
),tcd
->password_entry
,2,6,1,2,GTK_FILL
|GTK_EXPAND
|GTK_SHRINK
,GTK_FILL
,0,0);
217 tcd
->channel_dir_label
= gtk_label_new("Channel directory:");
218 gtk_widget_show (tcd
->channel_dir_label
);
219 tcd
->channel_dir_entry
= gtk_entry_new();
220 gtk_entry_set_text(GTK_ENTRY(tcd
->channel_dir_entry
),"/mnt/relayfs/ltt");
221 gtk_widget_show (tcd
->channel_dir_entry
);
222 gtk_table_attach( GTK_TABLE(tcd
->main_box
),tcd
->channel_dir_label
,0,2,2,3,GTK_FILL
,GTK_FILL
,2,2);
223 gtk_table_attach( GTK_TABLE(tcd
->main_box
),tcd
->channel_dir_entry
,2,6,2,3,GTK_FILL
|GTK_EXPAND
|GTK_SHRINK
,GTK_FILL
,0,0);
225 tcd
->trace_dir_label
= gtk_label_new("Trace directory:");
226 gtk_widget_show (tcd
->trace_dir_label
);
227 tcd
->trace_dir_entry
= gtk_entry_new();
228 gtk_entry_set_text(GTK_ENTRY(tcd
->trace_dir_entry
),"/tmp/trace1");
229 gtk_widget_show (tcd
->trace_dir_entry
);
230 gtk_table_attach( GTK_TABLE(tcd
->main_box
),tcd
->trace_dir_label
,0,2,3,4,GTK_FILL
,GTK_FILL
,2,2);
231 gtk_table_attach( GTK_TABLE(tcd
->main_box
),tcd
->trace_dir_entry
,2,6,3,4,GTK_FILL
|GTK_EXPAND
|GTK_SHRINK
,GTK_FILL
,0,0);
233 tcd
->trace_name_label
= gtk_label_new("Trace name:");
234 gtk_widget_show (tcd
->trace_name_label
);
235 tcd
->trace_name_entry
= gtk_entry_new();
236 gtk_entry_set_text(GTK_ENTRY(tcd
->trace_name_entry
),"trace");
237 gtk_widget_show (tcd
->trace_name_entry
);
238 gtk_table_attach( GTK_TABLE(tcd
->main_box
),tcd
->trace_name_label
,0,2,4,5,GTK_FILL
,GTK_FILL
,2,2);
239 gtk_table_attach( GTK_TABLE(tcd
->main_box
),tcd
->trace_name_entry
,2,6,4,5,GTK_FILL
|GTK_EXPAND
|GTK_SHRINK
,GTK_FILL
,0,0);
241 tcd
->trace_mode_label
= gtk_label_new("Trace mode ");
242 gtk_widget_show (tcd
->trace_mode_label
);
243 tcd
->trace_mode_combo
= gtk_combo_box_new_text();
244 gtk_combo_box_append_text(GTK_COMBO_BOX(tcd
->trace_mode_combo
),
246 gtk_combo_box_append_text(GTK_COMBO_BOX(tcd
->trace_mode_combo
),
248 gtk_combo_box_set_active(GTK_COMBO_BOX(tcd
->trace_mode_combo
), 0);
249 gtk_widget_show (tcd
->trace_mode_combo
);
250 gtk_table_attach( GTK_TABLE(tcd
->main_box
),tcd
->trace_mode_label
,0,2,5,6,GTK_FILL
,GTK_FILL
,2,2);
251 gtk_table_attach( GTK_TABLE(tcd
->main_box
),tcd
->trace_mode_combo
,2,6,5,6,GTK_FILL
|GTK_EXPAND
|GTK_SHRINK
,GTK_FILL
,0,0);
253 tcd
->start_daemon_label
= gtk_label_new("Start daemon ");
254 gtk_widget_show (tcd
->start_daemon_label
);
255 tcd
->start_daemon_check
= gtk_check_button_new();
256 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(tcd
->start_daemon_check
), TRUE
);
257 gtk_widget_show (tcd
->start_daemon_check
);
258 gtk_table_attach( GTK_TABLE(tcd
->main_box
),tcd
->start_daemon_label
,0,2,6,7,GTK_FILL
,GTK_FILL
,2,2);
259 gtk_table_attach( GTK_TABLE(tcd
->main_box
),tcd
->start_daemon_check
,2,6,6,7,GTK_FILL
,GTK_FILL
,0,0);
261 tcd
->optional_label
= gtk_label_new("Optional fields ");
262 gtk_widget_show (tcd
->optional_label
);
263 gtk_table_attach( GTK_TABLE(tcd
->main_box
),tcd
->optional_label
,0,6,7,8,GTK_FILL
,GTK_FILL
,2,2);
265 tcd
->subbuf_size_label
= gtk_label_new("Subbuffer size:");
266 gtk_widget_show (tcd
->subbuf_size_label
);
267 tcd
->subbuf_size_entry
= gtk_entry_new();
268 gtk_widget_show (tcd
->subbuf_size_entry
);
269 gtk_table_attach( GTK_TABLE(tcd
->main_box
),tcd
->subbuf_size_label
,0,2,8,9,GTK_FILL
,GTK_FILL
,2,2);
270 gtk_table_attach( GTK_TABLE(tcd
->main_box
),tcd
->subbuf_size_entry
,2,6,8,9,GTK_FILL
|GTK_EXPAND
|GTK_SHRINK
,GTK_FILL
,0,0);
272 tcd
->subbuf_num_label
= gtk_label_new("Number of subbuffers:");
273 gtk_widget_show (tcd
->subbuf_num_label
);
274 tcd
->subbuf_num_entry
= gtk_entry_new();
275 gtk_widget_show (tcd
->subbuf_num_entry
);
276 gtk_table_attach( GTK_TABLE(tcd
->main_box
),tcd
->subbuf_num_label
,0,2,9,10,GTK_FILL
,GTK_FILL
,2,2);
277 gtk_table_attach( GTK_TABLE(tcd
->main_box
),tcd
->subbuf_num_entry
,2,6,9,10,GTK_FILL
|GTK_EXPAND
|GTK_SHRINK
,GTK_FILL
,0,0);
279 tcd
->lttctl_path_label
= gtk_label_new("path to lttctl:");
280 gtk_widget_show (tcd
->lttctl_path_label
);
281 tcd
->lttctl_path_entry
= gtk_entry_new();
282 gtk_widget_show (tcd
->lttctl_path_entry
);
283 gtk_table_attach( GTK_TABLE(tcd
->main_box
),tcd
->lttctl_path_label
,0,2,10,11,GTK_FILL
,GTK_FILL
,2,2);
284 gtk_table_attach( GTK_TABLE(tcd
->main_box
),tcd
->lttctl_path_entry
,2,6,10,11,GTK_FILL
|GTK_EXPAND
|GTK_SHRINK
,GTK_FILL
,0,0);
287 tcd
->lttd_path_label
= gtk_label_new("path to lttd:");
288 gtk_widget_show (tcd
->lttd_path_label
);
289 tcd
->lttd_path_entry
= gtk_entry_new();
290 gtk_widget_show (tcd
->lttd_path_entry
);
291 gtk_table_attach( GTK_TABLE(tcd
->main_box
),tcd
->lttd_path_label
,0,2,11,12,GTK_FILL
,GTK_FILL
,2,2);
292 gtk_table_attach( GTK_TABLE(tcd
->main_box
),tcd
->lttd_path_entry
,2,6,11,12,GTK_FILL
|GTK_EXPAND
|GTK_SHRINK
,GTK_FILL
,0,0);
295 tcd
->fac_path_label
= gtk_label_new("path to facilities:");
296 gtk_widget_show (tcd
->fac_path_label
);
297 tcd
->fac_path_entry
= gtk_entry_new();
298 gtk_entry_set_text(GTK_ENTRY(tcd
->fac_path_entry
),PACKAGE_DATA_DIR
"/facilities");
299 gtk_widget_set_size_request(tcd
->fac_path_entry
, 250, -1);
300 gtk_widget_show (tcd
->fac_path_entry
);
301 gtk_table_attach( GTK_TABLE(tcd
->main_box
),tcd
->fac_path_label
,0,2,12,13,GTK_FILL
,GTK_FILL
,2,2);
302 gtk_table_attach( GTK_TABLE(tcd
->main_box
),tcd
->fac_path_entry
,2,6,12,13,GTK_FILL
|GTK_EXPAND
|GTK_SHRINK
,GTK_FILL
,0,0);
304 g_signal_connect(G_OBJECT(tcd
->start_button
), "clicked",
305 (GCallback
)start_clicked
, tcd
);
306 g_signal_connect(G_OBJECT(tcd
->pause_button
), "clicked",
307 (GCallback
)pause_clicked
, tcd
);
308 g_signal_connect(G_OBJECT(tcd
->stop_button
), "clicked",
309 (GCallback
)stop_clicked
, tcd
);
312 * show main container
314 gtk_widget_show(tcd
->main_box
);
315 gtk_widget_show(tcd
->window
);
318 g_object_set_data_full(
319 G_OBJECT(guicontrol_get_widget(tcd
)),
320 "control_viewer_data",
322 (GDestroyNotify
)gui_control_destructor
);
324 g_control_list
= g_slist_append(
333 * @fn void gui_control_destructor(ControlData*)
335 * Destructor for the filter gui module
336 * @param tcd The module structure
339 gui_control_destructor(ControlData
*tcd
)
343 /* May already been done by GTK window closing */
344 if(GTK_IS_WIDGET(guicontrol_get_widget(tcd
))){
345 g_info("widget still exists");
348 // lttvwindow_unregister_traceset_notify(tcd->tab,
349 // filter_traceset_changed,
350 // filter_viewer_data);
352 lttvwindowtraces_background_notify_remove(tcd
);
354 g_control_list
= g_slist_remove(g_control_list
, tcd
);
361 void start_clicked (GtkButton
*button
, gpointer user_data
)
363 ControlData
*tcd
= (ControlData
*)user_data
;
365 const gchar
*username
= gtk_entry_get_text(GTK_ENTRY(tcd
->username_entry
));
366 const gchar
*password
= gtk_entry_get_text(GTK_ENTRY(tcd
->password_entry
));
367 const gchar
*channel_dir
=
368 gtk_entry_get_text(GTK_ENTRY(tcd
->channel_dir_entry
));
369 const gchar
*trace_dir
= gtk_entry_get_text(GTK_ENTRY(tcd
->trace_dir_entry
));
370 const gchar
*trace_name
=
371 gtk_entry_get_text(GTK_ENTRY(tcd
->trace_name_entry
));
373 const gchar
*trace_mode_sel
=
374 gtk_combo_box_get_active_text(GTK_COMBO_BOX(tcd
->trace_mode_combo
));
375 const gchar
*trace_mode
;
376 if(strcmp(trace_mode_sel
, "normal") == 0)
377 trace_mode
= "normal";
379 trace_mode
= "flight";
381 gboolean start_daemon
=
382 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(tcd
->start_daemon_check
));
384 const gchar
*subbuf_size
=
385 gtk_entry_get_text(GTK_ENTRY(tcd
->subbuf_size_entry
));
386 const gchar
*subbuf_num
=
387 gtk_entry_get_text(GTK_ENTRY(tcd
->subbuf_num_entry
));
388 const gchar
*lttctl_path
=
389 gtk_entry_get_text(GTK_ENTRY(tcd
->lttctl_path_entry
));
390 const gchar
*lttd_path
= gtk_entry_get_text(GTK_ENTRY(tcd
->lttd_path_entry
));
391 const gchar
*fac_path
= gtk_entry_get_text(GTK_ENTRY(tcd
->fac_path_entry
));
399 } else if(pid
== 0) {
401 gchar args
[MAX_ARGS_LEN
];
402 gint args_left
= MAX_ARGS_LEN
- 1; /* for \0 */
404 /* Setup environment variables */
405 if(strcmp(lttd_path
, "") != 0)
406 setenv("LTT_DAEMON", lttd_path
, 1);
407 if(strcmp(fac_path
, "") != 0)
408 setenv("LTT_FACILITIES", fac_path
, 1);
410 /* Setup arguments to su */
411 if(strcmp(lttctl_path
, "") == 0) {
412 strncpy(args
, "lttctl", args_left
);
413 args_left
= MAX_ARGS_LEN
- strlen(args
) - 1;
415 strncpy(args
, lttctl_path
, args_left
);
416 args_left
= MAX_ARGS_LEN
- strlen(args
) - 1;
420 strncat(args
, " ", args_left
);
421 args_left
= MAX_ARGS_LEN
- strlen(args
) - 1;
424 strncat(args
, "-l ", args_left
);
425 args_left
= MAX_ARGS_LEN
- strlen(args
) - 1;
426 strncat(args
, channel_dir
, args_left
);
427 args_left
= MAX_ARGS_LEN
- strlen(args
) - 1;
430 strncat(args
, " ", args_left
);
431 args_left
= MAX_ARGS_LEN
- strlen(args
) - 1;
434 strncat(args
, "-t ", args_left
);
435 args_left
= MAX_ARGS_LEN
- strlen(args
) - 1;
436 strncat(args
, trace_dir
, args_left
);
437 args_left
= MAX_ARGS_LEN
- strlen(args
) - 1;
440 strncat(args
, " ", args_left
);
441 args_left
= MAX_ARGS_LEN
- strlen(args
) - 1;
444 strncat(args
, "-n ", args_left
);
445 args_left
= MAX_ARGS_LEN
- strlen(args
) - 1;
446 strncat(args
, trace_name
, args_left
);
447 args_left
= MAX_ARGS_LEN
- strlen(args
) - 1;
450 strncat(args
, " ", args_left
);
451 args_left
= MAX_ARGS_LEN
- strlen(args
) - 1;
454 strncat(args
, "-m ", args_left
);
455 args_left
= MAX_ARGS_LEN
- strlen(args
) - 1;
456 strncat(args
, trace_mode
, args_left
);
457 args_left
= MAX_ARGS_LEN
- strlen(args
) - 1;
460 strncat(args
, " ", args_left
);
461 args_left
= MAX_ARGS_LEN
- strlen(args
) - 1;
465 strncat(args
, "-d", args_left
);
466 args_left
= MAX_ARGS_LEN
- strlen(args
) - 1;
468 /* Simply create the channel and then start tracing */
469 strncat(args
, "-b", args_left
);
470 args_left
= MAX_ARGS_LEN
- strlen(args
) - 1;
474 strncat(args
, " ", args_left
);
475 args_left
= MAX_ARGS_LEN
- strlen(args
) - 1;
477 /* optional arguments */
479 if(strcmp(subbuf_size
, "") != 0) {
480 strncat(args
, "-z ", args_left
);
481 args_left
= MAX_ARGS_LEN
- strlen(args
) - 1;
482 strncat(args
, subbuf_size
, args_left
);
483 args_left
= MAX_ARGS_LEN
- strlen(args
) - 1;
487 strncat(args
, " ", args_left
);
488 args_left
= MAX_ARGS_LEN
- strlen(args
) - 1;
490 /* number of subbuffers */
491 if(strcmp(subbuf_num
, "") != 0) {
492 strncat(args
, "-x ", args_left
);
493 args_left
= MAX_ARGS_LEN
- strlen(args
) - 1;
494 strncat(args
, subbuf_num
, args_left
);
495 args_left
= MAX_ARGS_LEN
- strlen(args
) - 1;
498 g_message("Executing (as %s) : %s", username
, args
);
500 //execlp("su", "-p", );
501 //exit(-1): /* not supposed to happen! */
505 //gint ret = execvp();
515 void pause_clicked (GtkButton
*button
, gpointer user_data
)
517 ControlData
*tcd
= (ControlData
*)user_data
;
522 void stop_clicked (GtkButton
*button
, gpointer user_data
)
524 ControlData
*tcd
= (ControlData
*)user_data
;
531 * @fn GtkWidget* h_guicontrol(Tab*)
533 * Control Module's constructor hook
535 * This constructor is given as a parameter to the menuitem and toolbar button
536 * registration. It creates the list.
537 * @param tab A pointer to the parent window.
538 * @return The widget created.
541 h_guicontrol(Tab
*tab
)
543 ControlData
* f
= gui_control(tab
) ;
549 * @fn static void init()
551 * This function initializes the Filter Viewer functionnality through the
556 lttvwindow_register_constructor("guicontrol",
558 "Insert Tracing Control Module",
559 hTraceControlInsert_xpm
,
560 "Insert Tracing Control Module",
565 * @fn void control_destroy_walk(gpointer,gpointer)
567 * Initiate the destruction of the current gui module
568 * on the GTK Interface
571 control_destroy_walk(gpointer data
, gpointer user_data
)
573 ControlData
*tcd
= (ControlData
*)data
;
575 g_debug("traceontrol.c : control_destroy_walk, %p", tcd
);
577 /* May already have been done by GTK window closing */
578 if(GTK_IS_WIDGET(guicontrol_get_widget(tcd
)))
579 gtk_widget_destroy(guicontrol_get_widget(tcd
));
583 * @fn static void destroy()
584 * @brief plugin's destroy function
586 * This function releases the memory reserved by the module and unregisters
587 * everything that has been registered in the gtkTraceSet API.
589 static void destroy() {
591 g_slist_foreach(g_control_list
, control_destroy_walk
, NULL
);
593 lttvwindow_unregister_constructor(h_guicontrol
);
598 LTTV_MODULE("guitracecontrol", "Trace Control Window", \
599 "Graphical module that let user control kernel tracing", \
600 init
, destroy
, "lttvwindow")
This page took 0.048791 seconds and 5 git commands to generate.