[with_lttv_gui="yes"])
#TODO ybrosseau 2012-03-13: Remove this when babeltrace port is complete
#Force GUI disabling while we port babeltrace
-with_lttv_gui="no"
+#with_lttv_gui="no"
AM_CONDITIONAL([BUILD_LTTV_GUI], [ test "x$with_lttv_gui" = "xyes" ])
#define LTT_TIME_H
#include <glib.h>
-#include <ltt/compiler.h>
+#include <lttv/compiler.h>
#include <math.h>
typedef struct _LttTime {
const LttEvent* event,
const LttTracefile* tracefile,
const LttTrace* trace,
- const LttvTracefileContext* context,
const LttvProcessState* pstate,
- const LttvTraceContext* tc);
+ const LttvTrace* tracev);
gboolean lttv_filter_tree_parse_branch(
const LttvSimpleExpression* se,
const LttEvent* event,
const LttTracefile* tracefile,
const LttTrace* trace,
- const LttvProcessState* state,
- const LttvTracefileContext* context);
+ const LttvProcessState* state);
/*
* Debug functions
#include <lttv/state.h>
#include <lttv/hook.h>
#include <stdio.h>
+#include <babeltrace/babeltrace.h>
#include <babeltrace/context.h>
-#include <babeltrace/iterator.h>
+#include <babeltrace/ctf/iterator.h>
#include <babeltrace/ctf/events.h>
/* To traverse a tree recursively */
#include <fcntl.h>
#include <fts.h>
+/* For the use of realpath*/
+#include <limits.h>
+#include <stdlib.h>
+/* For strcpy*/
+#include <string.h>
/* A trace is a sequence of events gathered in the same tracing session. The
events may be stored in several tracefiles in the same directory.
//TODO remove this when we have really mecanism
//s->tmpState = g_new(LttvTraceState *, 1);
//lttv_trace_state_init(s->tmpState,0);
- begin_pos.type = BT_SEEK_BEGIN;
- //s->iter = bt_ctf_iter_create(lttv_traceset_get_context(s),
- // &begin_pos,
- // NULL);
s->iter = 0;
s->event_hooks = lttv_hooks_new();
+
s->state_trace_handle_index = g_ptr_array_new();
-
-
return s;
}
return new_trace;
}
#endif
+/*
+ * get_absolute_pathname : Return the unique pathname in the system
+ *
+ * pathname is the relative path.
+ *
+ * abs_pathname is being set to the absolute path.
+ *
+ */
+void get_absolute_pathname(const gchar *pathname, gchar * abs_pathname)
+{
+ abs_pathname[0] = '\0';
+
+ if (realpath(pathname, abs_pathname) != NULL)
+ return;
+ else
+ {
+ /* error, return the original path unmodified */
+ strcpy(abs_pathname, pathname);
+ return;
+ }
+ return;
+}
+
+
/*
* lttv_trace_create : Create a trace from a path
g_free(t);
}
-
void lttv_traceset_add(LttvTraceset *s, LttvTrace *t)
{
t->ref_count++;
int lttv_traceset_add_path(LttvTraceset *ts, char *trace_path)
{
+
FTS *tree;
FTSENT *node;
char * const paths[2] = { trace_path, NULL };
int ret = -1;
+ ts->filename = trace_path;
+
tree = fts_open(paths, FTS_NOCHDIR | FTS_LOGICAL, 0);
if (tree == NULL) {
g_warning("Cannot traverse \"%s\" for reading.\n",
return t->a;
}
-#ifdef BABEL_CLEANUP
-LttTrace *lttv_trace(LttvTrace *t)
-{
- return t->t;
-}
-#endif
gint lttv_trace_get_id(LttvTrace *t)
{
return cpu_id;
}
}
+/*
+ * lttv_traceset_get_timestamp_begin : returns the minimum timestamp of
+ * all the traces in the traceset.
+ *
+ */
+
+guint64 lttv_traceset_get_timestamp_begin(LttvTraceset *traceset)
+{
+ struct bt_context *bt_ctx;
+ bt_ctx = lttv_traceset_get_context(traceset);
+ guint64 timestamp_min = G_MAXUINT64, timestamp_cur = 0;
+ int i;
+ int trace_count;
+ LttvTrace *currentTrace;
+ trace_count = traceset->traces->len;
+ if(trace_count == 0)
+ timestamp_min = 0;
+ else{
+ timestamp_min = G_MAXUINT64;
+
+ for(i = 0; i < trace_count;i++)
+ {
+ currentTrace = g_ptr_array_index(traceset->traces,i);
+ timestamp_cur = bt_trace_handle_get_timestamp_begin(bt_ctx, currentTrace->id);
+ if(timestamp_cur < timestamp_min)
+ timestamp_min = timestamp_cur;
+ }
+ }
+ return timestamp_min;
+}
+
+/*
+ * lttv_traceset_get_timestamp_end: returns the maximum timestamp of
+ * all the traces in the traceset.
+ *
+ */
+guint64 lttv_traceset_get_timestamp_end(LttvTraceset *traceset)
+{
+ struct bt_context *bt_ctx;
+ bt_ctx = lttv_traceset_get_context(traceset);
+ guint64 timestamp_max, timestamp_cur = 0;
+ int i;
+ int trace_count;
+ LttvTrace *currentTrace;
+ trace_count = traceset->traces->len;
+
+ if(trace_count == 0)
+ timestamp_max = 1;
+ else
+ {
+ timestamp_max = 0;
+ for(i =0; i < trace_count;i++)
+ {
+ currentTrace = g_ptr_array_index(traceset->traces,i);
+ timestamp_cur = bt_trace_handle_get_timestamp_end(bt_ctx, currentTrace->id);
+ if(timestamp_cur > timestamp_max)
+ timestamp_max = timestamp_cur;
+ }
+ }
+ return timestamp_max;
+
+}
const char *lttv_traceset_get_name_from_event(LttvEvent *event)
{
LttvTrace *lttv_trace_new(LttTrace *t);
#endif
+void get_absolute_pathname(const gchar *pathname, gchar * abs_pathname);
+
LttvTraceset *lttv_traceset_copy(LttvTraceset *s_orig);
LttvTraceset *lttv_traceset_load(const gchar *filename);
/*
* lttv_trace_create : Add all traces recursively to a traceset from a path
*
+ *
* ts is the traceset in which will be contained the traces
*
* trace_path is the path where to find a set of trace.
LttvAttribute *lttv_traceset_attribute(LttvTraceset *s);
-
-#ifdef BABEL_CLEANUP
-LttTrace *lttv_trace(LttvTrace *t);
-#endif
-
/* Take a position snapshot */
LttvTracesetPosition *lttv_traceset_create_position(LttvTraceset *traceset);
void lttv_traceset_seek_to_position(LttvTracesetPosition *traceset_pos);
guint lttv_traceset_get_cpuid_from_event(LttvEvent *event);
+/* Returns the minimum timestamp of the traces in the traceset */
+guint64 lttv_traceset_get_timestamp_begin(LttvTraceset *traceset);
+/* Returns the maximum timestamp of the traces in the traceset */
+guint64 lttv_traceset_get_timestamp_end(LttvTraceset *traceset);
const char *lttv_traceset_get_name_from_event(LttvEvent *event);
# WARNING : subdirs order is important : mainWin depends on API
-SUBDIRS = lttvwindow controlflow detailedevents statistics filter tracecontrol histogram interrupts resourceview
-
+SUBDIRS = lttvwindow
+# controlflow detailedevents statistics filter tracecontrol histogram interrupts resourceview
# TODO: PORT for 0.10
#diskperformance tutorial
#include <lttv/lttv.h>
#include <lttv/module.h>
#include <lttv/iattribute.h>
+#include <lttv/traceset.h>
+#ifdef BABEL_CLEANUP
#include <lttv/stats.h>
-#include <lttv/filter.h>
#include <lttv/sync/sync_chain_lttv.h>
+#endif /* BABEL_CLEANUP */
+#include <lttv/filter.h>
#include <lttvwindow/mainwindow.h>
#include <lttvwindow/mainwindow-private.h>
#include <lttvwindow/menu.h>
#include <lttvwindow/lttvwindowtraces.h>
#include <lttvwindow/lttv_plugin_tab.h>
+#include <babeltrace/babeltrace.h>
+#include <babeltrace/ctf/events.h>
+#include <babeltrace/ctf/iterator.h>
+
static LttTime lttvwindow_default_time_width = { 1, 0 };
#define CLIP_BUF 256 // size of clipboard buffer
int SetTraceset(Tab * tab, LttvTraceset *traceset)
{
+
guint i;
TimeInterval time_span;
TimeWindow new_time_window;
LttTime new_current_time;
- LttvTracesetContext *tsc =
- LTTV_TRACESET_CONTEXT(tab->traceset_info->traceset_context);
+#ifdef BABEL_CLEANUP
// Perform time synchronization on the traces
if (syncTraceset(tsc))
{
tsc = LTTV_TRACESET_CONTEXT(tab->traceset_info->traceset_context);
}
+#endif /*BABEL_CLEANUP*/
- time_span = tsc->time_span;
- new_time_window = tab->time_window;
- new_current_time = tab->current_time;
+ time_span.start_time =ltt_time_from_uint64( lttv_traceset_get_timestamp_begin(traceset));
+ time_span.end_time = ltt_time_from_uint64(lttv_traceset_get_timestamp_end(traceset));
+
+ tab->traceset_info->traceset = traceset;
+
+ new_time_window = tab->time_window;
+ new_current_time = tab->current_time;
+
/* Set the tab's time window and current time if
* out of bounds */
if(ltt_time_compare(tab->time_window.start_time, time_span.start_time) < 0
current_time_change_manager(tab, new_current_time);
return retval;
+
}
/**
gboolean lttvwindow_process_pending_requests(Tab *tab)
{
+ #ifdef BABEL_CLEANUP
LttvTracesetContext *tsc;
LttvTracefileContext *tfc;
GSList *list_in = NULL;
NULL);
return FALSE;
*/
+
+ #endif /* BABEL_CLEANUP */
}
#undef list_out
live_trace_update_handler(Tab *tab)
{
unsigned int updated_count;
-
+#ifdef BABEL_CLEANUP
LttvTracesetContext *tsc = LTTV_TRACESET_CONTEXT(tab->traceset_info->traceset_context);
TimeInterval initial_time_span = tsc->time_span;
TimeInterval updated_time_span;
/* Timer will be recalled as long as there is files to update */
return (updated_count > 0);
+#endif /* BABEL_CLEANUP */
}
static void lttvwindow_add_trace(Tab *tab, LttvTrace *trace_v)
{
+ #ifdef BABEL_CLEANUP
LttvTraceset *traceset = tab->traceset_info->traceset;
guint i;
guint num_traces = lttv_traceset_number(traceset);
(GSourceFunc) live_trace_update_handler,
tab);
}
-
+#endif /* BABEL_CLEANUP */
}
/* add_trace adds a trace into the current traceset. It first displays a
void add_trace(GtkWidget * widget, gpointer user_data)
{
+#ifdef BABEL_CLEANUP
LttTrace *trace;
LttvTrace * trace_v;
LttvTraceset * traceset;
break;
}
gtk_widget_destroy((GtkWidget*)file_chooser);
+
+#endif /* BABEL_CLEANUP */
}
void remove_trace(GtkWidget *widget, gpointer user_data)
{
+ #ifdef BABEL_CLEANUP
LttTrace *trace;
LttvTrace * trace_v;
LttvTraceset * traceset;
SetTraceset(tab, (gpointer)traceset);
}
g_free(name);
+#endif /* BABEL_CLEANUP */
}
#if 0
void zoom(GtkWidget * widget, double size)
{
+ #ifdef BABEL_CLEANUP
TimeInterval time_span;
TimeWindow new_time_window;
LttTime current_time, time_delta;
} else {
time_change_manager(tab, new_time_window);
}
+
+#endif /* BABEL_CLEANUP */
}
void zoom_in(GtkWidget * widget, gpointer user_data)
void time_change_manager (Tab *tab,
TimeWindow new_time_window)
-{
+{
+
/* Only one source of time change */
if(tab->time_manager_lock == TRUE) return;
tab->time_manager_lock = TRUE;
+ TimeInterval time_span;
+
+ LttvTraceset *ts = tab->traceset_info->traceset;
+ time_span.start_time =ltt_time_from_uint64( lttv_traceset_get_timestamp_begin(ts));
+ time_span.end_time = ltt_time_from_uint64(lttv_traceset_get_timestamp_end(ts));
+
- LttvTracesetContext *tsc = LTTV_TRACESET_CONTEXT(tab->traceset_info->traceset_context);
- TimeInterval time_span = tsc->time_span;
LttTime start_time = new_time_window.start_time;
LttTime end_time = new_time_window.end_time;
/* Set scrollbar */
GtkAdjustment *adjustment = gtk_range_get_adjustment(GTK_RANGE(tab->scrollbar));
- LttTime upper = ltt_time_sub(time_span.end_time, time_span.start_time);
+ LttTime upper = ltt_time_sub(time_span.end_time, time_span.start_time);
+
#if 0
gtk_range_set_increments(GTK_RANGE(tab->scrollbar),
ltt_time_to_double(new_time_window.time_width)
set_time_window(tab, &new_time_window);
tab->time_manager_lock = FALSE;
+
+
}
}
void current_position_change_manager(Tab *tab,
- LttvTracesetContextPosition *pos)
+ LttvTracesetPosition *pos)
{
+ #ifdef BABEL_CLEANUP
LttvTracesetContext *tsc =
LTTV_TRACESET_CONTEXT(tab->traceset_info->traceset_context);
int retval;
current_time_change_manager(tab, new_time);
set_current_position(tab, pos);
+ #endif /* BABEL_CLEANUP */
}
static void on_timebar_starttime_changed(Timebar *timebar,
gpointer user_data)
{
+ #ifdef BABEL_CLEANUP
Tab *tab = (Tab *)user_data;
LttvTracesetContext * tsc =
LTTV_TRACESET_CONTEXT(tab->traceset_info->traceset_context);
/* Notify the time_manager */
time_change_manager(tab, new_time_window);
-
+#endif /* BABEL_CLEANUP */
}
static void on_timebar_endtime_changed(Timebar *timebar,
gpointer user_data)
{
+ #ifdef BABEL_CLEANUP
Tab *tab = (Tab *)user_data;
LttvTracesetContext * tsc =
LTTV_TRACESET_CONTEXT(tab->traceset_info->traceset_context);
/* Notify the time_manager */
time_change_manager(tab, new_time_window);
+ #endif /* BABEL_CLEANUP*/
}
static void on_timebar_currenttime_changed(Timebar *timebar,
gpointer user_data)
void scroll_value_changed_cb(GtkWidget *scrollbar,
gpointer user_data)
{
+ #ifdef BABEL_CLEANUP
Tab *tab = (Tab *)user_data;
TimeWindow new_time_window;
LttTime time;
/* call viewer hooks for new time window */
set_time_window(tab, &time_window);
#endif //0
+#endif /* BABEL_CLEANUP */
}
void tab_destructor(LttvPluginTab * ptab)
{
+#ifdef BABEL_CLEANUP
int i, nb, ref_count;
LttvTrace * trace;
Tab *tab = ptab->tab;
g_free(tab->traceset_info);
//g_free(tab);
g_object_unref(ptab);
+#endif /* BABEL_CLEANUP */
}
void init_tab(Tab *tab, MainWindow * mw, Tab *copy_tab,
GtkNotebook * notebook, char * label)
{
+
GList * list;
//Tab * tab;
//LttvFilter *filter = NULL;
/* Copy the previous tab's filter */
/* We can clone the filter, as we copy the trace set also */
/* The filter must always be in sync with the trace set */
+
+#ifdef BABEL_CLEANUP
tab->filter = lttv_filter_clone(copy_tab->filter);
+#endif /* BABEL_CLEANUP */
} else {
tab->traceset_info->traceset = lttv_traceset_new();
+
tab->filter = NULL;
}
#ifdef DEBUG
0, 4);
fflush(stdout);
#endif //DEBUG
-
+//
tab->time_manager_lock = FALSE;
tab->current_time_manager_lock = FALSE;
-
+#ifdef BABEL_CLEANUP
//FIXME copy not implemented in lower level
tab->traceset_info->traceset_context =
g_object_new(LTTV_TRACESET_STATS_TYPE, NULL);
- g_assert(tab->traceset_info->traceset_context != NULL);
- lttv_context_init(
- LTTV_TRACESET_CONTEXT(tab->traceset_info->traceset_context),
- tab->traceset_info->traceset);
//add state update hooks
lttv_state_add_event_hooks(
(LttvTracesetState*)tab->traceset_info->traceset_context);
-
+#endif //BABEL_CLEANUP
//determine the current_time and time_window of the tab
#if 0
if(copy_tab != NULL){
lttvwindow_report_time_window(tab, time_window);
lttvwindow_report_current_time(tab, ltt_time_zero);
}
-
+
LttvTraceset *traceset = tab->traceset_info->traceset;
SetTraceset(tab, traceset);
}
}
-__EXPORT void create_main_window_with_trace_list(GSList *traces, gboolean is_live)
+__EXPORT void create_main_window_with_trace_list(GSList *traces)
{
+
GSList *iter = NULL;
/* Create window */
ptab = (LttvPluginTab *)g_object_get_data(G_OBJECT(page), "Tab_Plugin");
tab = ptab->tab;
}
-
+
+ LttvTraceset * traceset = lttv_traceset_new();
for(iter=traces; iter!=NULL; iter=g_slist_next(iter)) {
gchar *path = (gchar*)iter->data;
/* Add trace */
gchar abs_path[PATH_MAX];
- LttvTrace *trace_v;
- LttTrace *trace;
+
get_absolute_pathname(path, abs_path);
- trace_v = lttvwindowtraces_get_trace_by_name(abs_path);
- if(trace_v == NULL) {
- if(is_live) {
- trace = ltt_trace_open_live(abs_path);
- } else {
- trace = ltt_trace_open(abs_path);
- }
- if(trace == NULL) {
- g_warning("cannot open trace %s", abs_path);
+
+ if(lttv_traceset_add_path(traceset,abs_path) != 0 ){ /*failure*/
+
+ g_warning("cannot open trace %s", abs_path);
GtkWidget *dialogue =
gtk_message_dialog_new(
"to select it ?");
gtk_dialog_run(GTK_DIALOG(dialogue));
gtk_widget_destroy(dialogue);
- } else {
- trace_v = lttv_trace_new(trace);
- lttvwindowtraces_add_trace(trace_v);
- lttvwindow_add_trace(tab, trace_v);
- }
- } else {
- lttvwindow_add_trace(tab, trace_v);
}
- }
-
- LttvTraceset *traceset;
-
- traceset = tab->traceset_info->traceset;
- SetTraceset(tab, traceset);
+ else{
+ SetTraceset(tab, traceset);
+ }
+ }
}
void main_window_free(MainWindow * mw);
void main_window_destructor(MainWindow * mw);
-void create_main_window_with_trace_list(GSList *traces, gboolean is_live);
+void create_main_window_with_trace_list(GSList *traces);
void insert_viewer_wrap(GtkWidget *menuitem, gpointer user_data);
gboolean execute_events_requests(Tab *tab);
#include <lttv/hook.h>
#include <lttv/option.h>
#include <lttv/module.h>
-#include <lttv/tracecontext.h>
+
#include <lttv/state.h>
+#ifdef BABEL_CLEANUP
#include <lttv/stats.h>
+#endif /* BABEL_CLEANUP */
#include <lttvwindow/menu.h>
#include <lttvwindow/toolbar.h>
#include <lttvwindow/lttvwindowtraces.h>
add_pixmap_directory ("../modules/gui/main/pixmaps");
/* First window, use command line trace */
- create_main_window_with_trace_list(g_init_trace, a_live);
+ create_main_window_with_trace_list(g_init_trace);
gtk_main ();
g_assert((main_hooks = *(value.v_pointer)) != NULL);
lttv_hooks_add(main_hooks, window_creation_hook, NULL, LTTV_PRIO_DEFAULT);
-
+#ifdef BABEL_CLEANUP
{
/* Register state calculator */
LttvHooks *hook_adder = lttv_hooks_new();
after_request, NULL, NULL,
hook_adder, hook_remover);
}
+#endif /* BABEL_CLEANUP */
}
void
LTTV_MODULE("lttvwindow", "Viewer main window", \
"Viewer with multiple windows, tabs and panes for graphical modules", \
- init, destroy, "stats", "option", "sync")
+ init, destroy, "option","state")
{
LttvPluginTab *self = LTTV_PLUGIN_TAB(parent);
g_message("In tab update filter.");
+ #ifdef BABEL_CLEANUP
lttv_filter_destroy(self->tab->filter);
+ #endif /* BABEL_CLEANUP */
self->tab->filter = filter;
lttvwindow_report_filter(self->tab, filter);
}
-
static void
lttv_plugin_tab_class_init (LttvPluginTabClass *klass)
{
#include <ltt/ltt.h>
#include <lttv/lttv.h>
#include <lttv/state.h>
+#ifdef BABEL_CLEANUP
#include <lttv/stats.h>
-#include <lttv/tracecontext.h>
+#endif /* BABEL_CLEANUP */
#include <lttvwindow/mainwindow.h>
#include <lttvwindow/mainwindow-private.h>
#include <lttvwindow/lttvwindow.h>
* This is called whenever the current time value changes.
*/
-void set_current_position(Tab *tab, const LttvTracesetContextPosition *pos)
+void set_current_position(Tab *tab, const LttvTracesetPosition *pos)
{
+ #ifdef BABEL_CLEANUP
+
LttvAttributeValue value;
LttvHooks * tmp;
gboolean retval;
if (tmp != NULL) {
lttv_hooks_call(tmp, (void *) pos);
}
+#endif /*BABEL_CLEANUP*/
}
void add_toolbar_constructor(MainWindow *mw, LttvToolbarClosure *toolbar_c)
*/
__EXPORT void lttvwindow_report_current_position(Tab *tab,
- LttvTracesetContextPosition *pos)
+ LttvTracesetPosition *pos)
{
current_position_change_manager(tab, pos);
}
lttv_hooks_call(tmp, filter);
}
-
+#ifdef BABEL_CLEANUP
/**
* Function to get the stats of the traceset
{
return tab->traceset_info->traceset_context;
}
-
-__EXPORT LttvTracesetContext* lttvwindow_get_traceset_context(Tab *tab)
-{
- return (LttvTracesetContext*)tab->traceset_info->traceset_context;
-}
-
+#endif /*BABEL_CLEANUP*/
void events_request_free(EventsRequest *events_request)
{
+ #ifdef BABEL_CLEANUP
if(events_request == NULL) return;
if(events_request->start_position != NULL)
lttv_hooks_destroy(events_request->after_request);
g_free(events_request);
+ #endif /*BABEL_CLEANUP*/
}
-
__EXPORT GtkWidget *main_window_get_widget(Tab *tab)
{
return tab->mw->mwindow;
#include <ltt/ltt.h>
#include <ltt/time.h>
#include <lttv/hook.h>
-#include <lttv/tracecontext.h>
+#ifdef BABEL_CLEANUP
#include <lttv/stats.h>
+
#include <lttv/filter.h>
+#endif /* BABEL_CLEANUP */
#include <lttvwindow/mainwindow.h>
#include <lttvwindow/lttv_plugin.h>
*/
void lttvwindow_report_current_position(Tab *tab,
- LttvTracesetContextPosition *pos);
+ LttvTracesetPosition *pos);
/**
* Function to set the position of the hpane's dividor (viewer).
gpointer viewer_data; /* Unset : NULL */
gboolean servicing; /* service in progress: TRUE*/
LttTime start_time; /* Unset : ltt_time_infinite*/
- LttvTracesetContextPosition *start_position; /* Unset : NULL */
+ LttvTracesetPosition *start_position; /* Unset : NULL */
gboolean stop_flag; /* Continue:TRUE Stop:FALSE */
LttTime end_time; /* Unset : ltt_time_infinite*/
guint num_events; /* Unset : G_MAXUINT */
- LttvTracesetContextPosition *end_position; /* Unset : NULL */
+ LttvTracesetPosition *end_position; /* Unset : NULL */
gint trace; /* unset : -1 */
GArray *hooks; /* Unset : NULL */
LttvHooks *before_chunk_traceset; /* Unset : NULL */
LttvHooks *before_chunk_trace; /* Unset : NULL */
LttvHooks *before_chunk_tracefile;/* Unset : NULL */
LttvHooks *event; /* Unset : NULL */
- LttvHooksByIdChannelArray *event_by_id_channel;/* Unset : NULL */
LttvHooks *after_chunk_tracefile; /* Unset : NULL */
LttvHooks *after_chunk_trace; /* Unset : NULL */
LttvHooks *after_chunk_traceset; /* Unset : NULL */
void lttvwindow_report_filter(Tab *tab, LttvFilter *filter);
-
+#ifdef BABEL_CLEANUP
/**
* Function to get the stats of the traceset
*/
LttvTracesetStats* lttvwindow_get_traceset_stats(Tab *tab);
-
-/**
- * Function to get the context of the traceset
- * It must be non const so the viewer can add and remove hooks from it.
- * @param tab the tab the viewer belongs to.
- * @return Context of the current tab.
- */
-
-
-LttvTracesetContext* lttvwindow_get_traceset_context(Tab *tab);
+#endif /*BABEL_CLEANUP*/
/* set_time_window
GtkWidget *main_window_get_widget(Tab *tab);
-void set_current_position(Tab *tab, const LttvTracesetContextPosition *pos);
+void set_current_position(Tab *tab, const LttvTracesetPosition *pos);
/**
void current_position_change_manager(Tab *tab,
- LttvTracesetContextPosition *pos);
+ LttvTracesetPosition *pos);
#endif //LTTVWINDOW_H
#include <lttv/lttv.h>
#include <lttv/traceset.h>
#include <lttv/attribute.h>
-#include <lttv/tracecontext.h>
#include <lttvwindow/lttvwindowtraces.h>
#include <lttvwindow/lttvwindow.h> // for CHUNK_NUM_EVENTS
#include <lttvwindow/mainwindow-private.h> /* for main window structure */
gpointer owner;
LttvTrace *trace; /* trace */
LttTime notify_time;
- LttvTracesetContextPosition *notify_position;
+ LttvTracesetPosition *notify_position;
LttvHooks *notify; /* Hook to call when the notify is
passed, or at the end of trace */
} BackgroundNotify;
__EXPORT LttvTrace *lttvwindowtraces_get_trace_by_name(gchar *path)
{
+#ifdef BABEL_CLEANUP
guint i;
for(i=0;i<lttvwindowtraces_get_number();i++) {
return trace_v;
}
}
-
+#endif
return NULL;
}
void lttvwindowtraces_add_trace(LttvTrace *trace)
{
+
LttvAttribute *g_attribute = lttv_global_attributes();
LttvAttribute *attribute;
LttvAttributeValue value;
gchar attribute_path[PATH_MAX];
int result;
gboolean result_b;
-
+ #ifdef BABEL_CLEANUP
if(stat(g_quark_to_string(ltt_trace_name(lttv_trace(trace))), &buf)) {
g_warning("lttvwindowtraces_add_trace: Trace %s not found",
g_quark_to_string(ltt_trace_name(lttv_trace(trace))));
*(value.v_pointer) = tss;
lttv_context_init(LTTV_TRACESET_CONTEXT(tss), ts);
+#endif
#if 0
result_b = lttv_iattribute_find(LTTV_IATTRIBUTE(attribute),
LTTV_COMPUTATION_SYNC_POSITION,
/* destroy traceset and tracesetcontext */
LttvTraceset *ts;
- LttvTracesetStats *tss;
//LttvTracesetContextPosition *sync_position;
l_attribute = lttv_trace_attribute(trace);
LTTV_POINTER,
&value);
g_assert(result);
-
+#ifdef BABEL_CLEANUP
tss = (LttvTracesetStats*)*(value.v_pointer);
lttv_context_fini(LTTV_TRACESET_CONTEXT(tss));
g_object_unref(tss);
+#endif /* BABEL_CLEANUP */
lttv_iattribute_remove_by_name(LTTV_IATTRIBUTE(l_attribute),
LTTV_COMPUTATION_TRACESET_CONTEXT);
lttv_iattribute_remove_by_name(LTTV_IATTRIBUTE(l_attribute),
GTK_MESSAGE_INFO, GTK_BUTTONS_OK,
"Background computation for %s started for trace %s",
module_name,
- g_quark_to_string(ltt_trace_name(lttv_trace(trace))));
+ trace->traceset->filename);
gtk_window_set_transient_for(GTK_WINDOW(dialog), GTK_WINDOW(widget));
g_signal_connect_swapped (dialog, "response",
G_CALLBACK (destroy_dialog),
(gpointer owner,
LttvTrace *trace,
LttTime notify_time,
- const LttvTracesetContextPosition *notify_position,
+ const LttvTracesetPosition *notify_position,
const LttvHooks *notify)
{
+ #ifdef BABEL_CLEANUP
BackgroundNotify *bg_notify;
LttvAttribute *attribute = lttv_trace_attribute(trace);
LttvAttributeValue value;
&value);
g_assert(result);
- LttvTracesetContext *tsc = (LttvTracesetContext*)(value.v_pointer);
+ LttvTraceset *ts = (LttvTraceset)(value.v_pointer);
bg_notify = g_new(BackgroundNotify,1);
lttv_hooks_add_list(bg_notify->notify, notify);
*slist = g_slist_append(*slist, bg_notify);
+#endif /* BABEL_CLEANUP*/
}
/**
(gpointer owner,
LttvTrace *trace,
LttTime notify_time,
- const LttvTracesetContextPosition *notify_position,
+ const LttvTracesetPosition *notify_position,
const LttvHooks *notify)
{
+ #ifdef BABEL_CLEANUP
BackgroundNotify *bg_notify;
LttvAttribute *attribute = lttv_trace_attribute(trace);
LttvAttributeValue value;
lttv_hooks_add_list(bg_notify->notify, notify);
*slist = g_slist_append(*slist, bg_notify);
+ #endif /* BABEL_CLEANUP */
}
static void notify_request_free(BackgroundNotify *notify_req)
{
+ #ifdef BABEL_CLEANUP
if(notify_req == NULL) return;
if(notify_req->notify_position != NULL)
if(notify_req->notify != NULL)
lttv_hooks_destroy(notify_req->notify);
g_free(notify_req);
+ #endif /* BABEL_CLEANUP */
}
/**
/* Background processing helper functions */
void lttvwindowtraces_add_computation_hooks(LttvAttributeName module_name,
- LttvTracesetContext *tsc,
+ LttvTraceset *ts,
LttvHooks *hook_adder)
{
+ #ifdef BABEL_CLEANUP
LttvAttribute *g_attribute = lttv_global_attributes();
LttvAttribute *module_attribute;
LttvAttributeType type;
if(hook_adder != NULL)
lttv_hooks_add_list(hook_adder, (LttvHooks*)*(value.v_pointer));
}
+#endif /* BABEL_CLEANUP */
}
void lttvwindowtraces_remove_computation_hooks(LttvAttributeName module_name,
- LttvTracesetContext *tsc,
+ LttvTraceset *ts,
LttvHooks *hook_remover)
{
+ #ifdef BABEL_CLEANUP
LttvAttribute *g_attribute = lttv_global_attributes();
LttvAttribute *module_attribute;
LttvAttributeType type;
if(hook_remover != NULL)
lttv_hooks_add_list(hook_remover, (LttvHooks*)*(value.v_pointer));
}
+ #endif /* BABEL_CLEANUP */
}
void lttvwindowtraces_call_before_chunk(LttvAttributeName module_name,
- LttvTracesetContext *tsc)
+ LttvTraceset *ts)
{
+ #ifdef BABEL_CLEANUP
LttvAttribute *g_attribute = lttv_global_attributes();
LttvAttribute *module_attribute;
LttvAttributeType type;
before_chunk_tracefile,
event_hook,
event_hook_by_id_channel);
+#endif /* BABEL_CLEANUP */
}
void lttvwindowtraces_call_after_chunk(LttvAttributeName module_name,
- LttvTracesetContext *tsc)
+ LttvTraceset *ts)
{
LttvAttribute *g_attribute = lttv_global_attributes();
LttvAttribute *module_attribute;
LttvHooks *after_chunk_trace=NULL;
LttvHooks *after_chunk_tracefile=NULL;
LttvHooks *event_hook=NULL;
- LttvHooksByIdChannelArray *event_hook_by_id_channel=NULL;
module_attribute =
LTTV_ATTRIBUTE(lttv_iattribute_find_subdir(LTTV_IATTRIBUTE(g_attribute),
type = lttv_iattribute_get_by_name(LTTV_IATTRIBUTE(module_attribute),
LTTV_EVENT_HOOK_BY_ID_CHANNEL,
&value);
- if(type == LTTV_POINTER) {
- event_hook_by_id_channel = (LttvHooksByIdChannelArray*)*(value.v_pointer);
- }
-
+ #ifdef BABEL_CLEANUP
lttv_process_traceset_end(tsc,
after_chunk_traceset,
after_chunk_trace,
after_chunk_tracefile,
- event_hook,
- event_hook_by_id_channel);
+ event_hook);
+#endif /* BABEL_CLEANUP*/
}
gboolean lttvwindowtraces_process_pending_requests(LttvTrace *trace)
{
- LttvTracesetContext *tsc;
- LttvTracesetStats *tss;
+ LttvTraceset *tsc;
LttvTraceset *ts;
- //LttvTracesetContextPosition *sync_position;
LttvAttribute *attribute;
LttvAttribute *g_attribute = lttv_global_attributes();
GSList **list_out, **list_in, **notify_in, **notify_out;
g_assert(type == LTTV_POINTER);
ts = (LttvTraceset*)*(value.v_pointer);
- type = lttv_iattribute_get_by_name(LTTV_IATTRIBUTE(attribute),
- LTTV_COMPUTATION_TRACESET_CONTEXT,
- &value);
- g_assert(type == LTTV_POINTER);
- tsc = (LttvTracesetContext*)*(value.v_pointer);
- tss = (LttvTracesetStats*)*(value.v_pointer);
- g_assert(LTTV_IS_TRACESET_CONTEXT(tsc));
- g_assert(LTTV_IS_TRACESET_STATS(tss));
#if 0
type = lttv_iattribute_get_by_name(LTTV_IATTRIBUTE(attribute),
LTTV_COMPUTATION_SYNC_POSITION,
g_assert(type == LTTV_POINTER);
sync_position = (LttvTracesetContextPosition*)*(value.v_pointer);
#endif //0
+#ifdef BABEL_CLEANUP
/* There is no events requests pending : we should never have been called! */
g_assert(g_slist_length(*list_out) != 0 || g_slist_length(*list_in) != 0);
/* 0.1 Lock traces */
guint iter_trace=0;
for(iter_trace=0;
- iter_trace<lttv_traceset_number(tsc->ts);
+ iter_trace<lttv_traceset_number(ts->ts);
iter_trace++) {
- LttvTrace *trace_v = lttv_traceset_get(tsc->ts,iter_trace);
+ LttvTrace *trace_v = lttv_traceset_get(ts->ts,iter_trace);
if(lttvwindowtraces_lock(trace_v) != 0)
return TRUE; /* Cannot get trace lock, try later */
lttvwindowtraces_unlock(trace_v);
}
}
+ #endif /* BABEL_CLEANUP */
return ret_val;
}
LttvHooks *before_request,
LttvHooks *after_request,
LttvHooks *event_hook,
- LttvHooksById *event_hook_by_id_channel,
LttvHooks *hook_adder,
LttvHooks *hook_remover)
{
g_assert(result);
*(value.v_pointer) = event_hook;
- result = lttv_iattribute_find(LTTV_IATTRIBUTE(attribute),
- LTTV_EVENT_HOOK_BY_ID_CHANNEL,
- LTTV_POINTER,
- &value);
- g_assert(result);
- *(value.v_pointer) = event_hook_by_id_channel;
-
result = lttv_iattribute_find(LTTV_IATTRIBUTE(attribute),
LTTV_HOOK_ADDER,
LTTV_POINTER,
&value);
g_assert(result);
- LttvHooksByIdChannelArray *event_hook_by_id_channel = (LttvHooksByIdChannelArray*)*(value.v_pointer);
- if(event_hook_by_id_channel != NULL)
- lttv_hooks_by_id_channel_destroy(event_hook_by_id_channel);
-
result = lttv_iattribute_find(LTTV_IATTRIBUTE(attribute),
LTTV_HOOK_ADDER,
LTTV_POINTER,
(gpointer owner,
LttvTrace *trace,
LttTime notify_time,
- const LttvTracesetContextPosition *notify_position,
+ const LttvTracesetPosition *notify_position,
const LttvHooks *notify);
/**
(gpointer owner,
LttvTrace *trace,
LttTime notify_time,
- const LttvTracesetContextPosition *notify_position,
+ const LttvTracesetPosition *notify_position,
const LttvHooks *notify);
/**
LttvHooks *before_request,
LttvHooks *after_request,
LttvHooks *event_hook,
- LttvHooksById *event_hook_by_id,
LttvHooks *hook_adder,
LttvHooks *hook_remover);
/**
#include <ltt/ltt.h>
#include <lttv/attribute.h>
#include <lttv/traceset.h>
-#include <lttv/tracecontext.h>
+
#include <lttv/hook.h>
+#ifdef BABEL_CLEANUP
+#include <lttv/tracecontext.h>
#include <lttv/stats.h>
+#endif /* BABEL_CLEANUP */
#include <lttv/filter.h>
//#include <lttvwindow/gtkmultivpaned.h>
#include <lttvwindow/mainwindow.h>
#define SCROLL_STEP_PER_PAGE 10.0
struct _TracesetInfo {
- //FIXME? TracesetContext and stats in same or different variable ?
- LttvTracesetStats * traceset_context;
+ //FIXME? Traceset is the unique member of tracesetinfo
LttvTraceset * traceset;
};
#include <gtk/gtk.h>
-#include <ltt/compiler.h>
+#include <lttv/compiler.h>
#include "support.h"
) {
return;
}
-
- if (min_time != NULL) {
- timebar->min_time = *min_time;
- }
-
- if (max_time != NULL) {
- timebar->max_time = *max_time;
- }
-
+ /* null-checked already */
+ timebar->min_time = *min_time;
+ timebar->max_time = *max_time;
if (ltt_time_compare(timebar->min_time, timebar->max_time) == 0) {
#include <lttv/stats.h>
#include <lttv/filter.h>
#endif
+// #include <lttv/traceset.h>
#include <lttv/print.h>
#include <ltt/ltt.h>
#include <ltt/event.h>
RCFILE="$(dirname $0)/.runlttvrc"
TEXTLIBS="-L ${BUILDPATH}/lttv/modules/text/.libs -m textDump"
EVALLIBS="-L ${BUILDPATH}/lttv/modules/text/.libs -m sync_chain_batch"
-GRAPHLIBS="-L ${BUILDPATH}/lttv/modules/gui/lttvwindow/lttvwindow/.libs -m lttvwindow "\
-"-L ${BUILDPATH}/lttv/modules/gui/controlflow/.libs -m guicontrolflow "\
-"-L ${BUILDPATH}/lttv/modules/gui/detailedevents/.libs -m guievents "\
-"-L ${BUILDPATH}/lttv/modules/gui/tracecontrol/.libs -m guitracecontrol "\
-"-L ${BUILDPATH}/lttv/modules/gui/statistics/.libs -m guistatistics "\
-"-L ${BUILDPATH}/lttv/modules/gui/resourceview/.libs -m resourceview "\
-"-L ${BUILDPATH}/lttv/modules/gui/filter/.libs -m guifilter "\
-"-L ${BUILDPATH}/lttv/modules/gui/interrupts/.libs -m interrupts "\
-"-L ${BUILDPATH}/lttv/modules/gui/histogram/.libs -m guihistogram"
+GRAPHLIBS="-L ${BUILDPATH}/lttv/modules/gui/lttvwindow/lttvwindow/.libs -m lttvwindow"
+#"-L ${BUILDPATH}/lttv/modules/gui/controlflow/.libs -m guicontrolflow "\
+#"-L ${BUILDPATH}/lttv/modules/gui/detailedevents/.libs -m guievents "\
+#"-L ${BUILDPATH}/lttv/modules/gui/tracecontrol/.libs -m guitracecontrol "\
+#"-L ${BUILDPATH}/lttv/modules/gui/statistics/.libs -m guistatistics "\
+#"-L ${BUILDPATH}/lttv/modules/gui/resourceview/.libs -m resourceview "\
+#"-L ${BUILDPATH}/lttv/modules/gui/filter/.libs -m guifilter "\
+#"-L ${BUILDPATH}/lttv/modules/gui/interrupts/.libs -m interrupts "\
+#"-L ${BUILDPATH}/lttv/modules/gui/histogram/.libs -m guihistogram"
DEFAULTMODE="gui"
usage () {