#include <gtk/gtk.h>
#include <glib.h>
+#include <string.h>
#include <lttv/lttv.h>
#include <lttv/attribute.h>
#include <ltt/trace.h>
-LttvTraceInfo LTTV_TRACES,
+__EXPORT LttvTraceInfo
+ LTTV_TRACES,
LTTV_COMPUTATION,
LTTV_VIEWER_CONSTRUCTORS,
LTTV_REQUESTS_QUEUE,
LTTV_NOTIFY_CURRENT,
LTTV_COMPUTATION_TRACESET,
LTTV_COMPUTATION_TRACESET_CONTEXT,
+ LTTV_COMPUTATION_SYNC_POSITION,
LTTV_BEFORE_CHUNK_TRACESET,
LTTV_BEFORE_CHUNK_TRACE,
LTTV_BEFORE_CHUNK_TRACEFILE,
*main_hooks;
/* Initial trace from command line */
-LttvTrace *g_init_trace = NULL;
+static GSList *g_init_trace = NULL;
static char *a_trace;
+//static char g_init_trace[PATH_MAX] = "";
void lttv_trace_option(void *hook_data)
{
- LttTrace *trace;
- gchar abs_path[PATH_MAX];
-
- get_absolute_pathname(a_trace, abs_path);
- g_init_trace = lttvwindowtraces_get_trace_by_name(abs_path);
- if(g_init_trace == NULL) {
- trace = ltt_trace_open(abs_path);
- if(trace == NULL) {
- g_warning("cannot open trace %s", abs_path);
- } else {
- g_init_trace = lttv_trace_new(trace);
- lttvwindowtraces_add_trace(g_init_trace);
- }
- }
+ //LttTrace *trace;
+
+ //get_absolute_pathname(a_trace, g_init_trace);
+ g_init_trace = g_slist_append(g_init_trace, a_trace);
}
/*****************************************************************************
add_pixmap_directory ("pixmaps");
add_pixmap_directory ("../modules/gui/main/pixmaps");
- construct_main_window(NULL);
+ /* First window, use command line trace */
+ create_main_window_with_trace_list(g_init_trace);
gtk_main ();
LTTV_COMPUTATION_TRACESET = g_quark_from_string("computation_traceset");
LTTV_COMPUTATION_TRACESET_CONTEXT =
g_quark_from_string("computation_traceset_context");
+ LTTV_COMPUTATION_SYNC_POSITION =
+ g_quark_from_string("computation_sync_position");
LTTV_BEFORE_CHUNK_TRACESET = g_quark_from_string("before_chunk_traceset");
LTTV_BEFORE_CHUNK_TRACE = g_quark_from_string("before_chunk_trace");
LTTV_BEFORE_CHUNK_TRACEFILE = g_quark_from_string("before_chunk_tracefile");
gtk_widget_destroy(mw->mwindow);
}
+static void destroy_walk(gpointer data, gpointer user_data)
+{
+ main_window_destructor((MainWindow*)data);
+}
/**
* plugin's destroy function
LttvTrace *trace;
GSList *iter = NULL;
- lttvwindowtraces_unregister_requests(g_quark_from_string("stats"));
- lttvwindowtraces_unregister_requests(g_quark_from_string("state"));
- lttvwindowtraces_unregister_computation_hooks(g_quark_from_string("stats"));
- lttvwindowtraces_unregister_computation_hooks(g_quark_from_string("state"));
-
lttv_option_remove("trace");
lttv_hooks_remove_data(main_hooks, window_creation_hook, NULL);
g_debug("GUI destroy()");
- if(g_main_window_list){
- for(iter=g_main_window_list;iter!=NULL;iter=g_slist_next(iter)) {
- main_window_destructor((MainWindow*)iter->data);
- }
- g_slist_free(g_main_window_list);
- }
+ g_slist_foreach(g_main_window_list, destroy_walk, NULL);
+
+ g_slist_free(g_main_window_list);
+
+ g_slist_free(g_init_trace);
}