self->traces = g_new(LttvTraceContext *, nb_trace);
self->a = g_object_new(LTTV_ATTRIBUTE_TYPE, NULL);
self->ts_a = lttv_traceset_attribute(ts);
- self->sync_position = lttv_traceset_context_position_new();
+ // self->sync_position = lttv_traceset_context_position_new();
for(i = 0 ; i < nb_trace ; i++) {
tc = LTTV_TRACESET_CONTEXT_GET_CLASS(self)->new_trace_context(self);
self->traces[i] = tc;
g_tree_destroy(self->pqueue);
g_object_unref(self->a);
- lttv_traceset_context_position_destroy(self->sync_position);
+ // lttv_traceset_context_position_destroy(self->sync_position);
nb_trace = lttv_traceset_number(ts);
return tfc;
}
-
+#if 0
/* lttv_process_traceset_synchronize_tracefiles
*
* Use the sync_position field of the trace set context to synchronize each
lttv_traceset_context_position_save(tsc, tsc->sync_position);
}
-
+#endif //0
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,
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");
/* create new traceset and tracesetcontext */
LttvTraceset *ts;
LttvTracesetStats *tss;
+ LttvTracesetContextPosition *sync_position;
attribute = lttv_trace_attribute(trace);
g_assert(lttv_iattribute_find(LTTV_IATTRIBUTE(attribute),
lttv_context_init(LTTV_TRACESET_CONTEXT(tss), ts);
+ g_assert(lttv_iattribute_find(LTTV_IATTRIBUTE(attribute),
+ LTTV_COMPUTATION_SYNC_POSITION,
+ LTTV_POINTER,
+ &value));
+
+ sync_position = lttv_traceset_context_position_new();
+ *(value.v_pointer) = sync_position;
+
value = lttv_attribute_add(attribute,
LTTV_REQUESTS_QUEUE,
LTTV_POINTER);
/* destroy traceset and tracesetcontext */
LttvTraceset *ts;
LttvTracesetStats *tss;
+ LttvTracesetContextPosition *sync_position;
l_attribute = lttv_trace_attribute(trace);
&value));
ts = (LttvTraceset*)*(value.v_pointer);
+ g_assert(lttv_iattribute_find(LTTV_IATTRIBUTE(l_attribute),
+ LTTV_COMPUTATION_SYNC_POSITION,
+ LTTV_POINTER,
+ &value));
+ sync_position = (LttvTracesetContextPosition*)*(value.v_pointer);
+
+ lttv_traceset_context_position_destroy(sync_position);
+
+ lttv_iattribute_remove_by_name(LTTV_IATTRIBUTE(l_attribute),
+ LTTV_COMPUTATION_SYNC_POSITION);
+
g_assert(lttv_iattribute_find(LTTV_IATTRIBUTE(l_attribute),
LTTV_COMPUTATION_TRACESET_CONTEXT,
LTTV_POINTER,
LttvTracesetContext *tsc;
LttvTracesetStats *tss;
LttvTraceset *ts;
+ LttvTracesetContextPosition *sync_position;
LttvAttribute *attribute;
LttvAttribute *g_attribute = lttv_global_attributes();
GSList **list_out, **list_in, **notify_in, **notify_out;
tss = (LttvTracesetStats*)*(value.v_pointer);
g_assert(LTTV_IS_TRACESET_CONTEXT(tsc));
g_assert(LTTV_IS_TRACESET_STATS(tss));
+
+ type = lttv_iattribute_get_by_name(LTTV_IATTRIBUTE(attribute),
+ LTTV_COMPUTATION_SYNC_POSITION,
+ &value);
+ g_assert(type == LTTV_POINTER);
+ sync_position = (LttvTracesetContextPosition*)*(value.v_pointer);
/* 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.2 Sync tracefiles */
- lttv_process_traceset_synchronize_tracefiles(tsc);
+ g_assert(lttv_process_traceset_seek_position(tsc, sync_position) == 0);
+ // lttv_process_traceset_synchronize_tracefiles(tsc);
/* 1. Before processing */
{
/* if list_in is empty */
}
/* 4. Unlock traces */
{
- lttv_process_traceset_get_sync_data(tsc);
+ // lttv_process_traceset_get_sync_data(tsc);
+ lttv_traceset_context_position_save(tsc, sync_position);
guint iter_trace;
for(iter_trace=0;