lttv_process_traceset_seek_time(tsc, ltt_time_zero);
count = lttv_process_traceset_seek_n_forward(tsc, 200000, NULL);
lttv_traceset_context_position_save(tsc, saved_pos);
+ t0 = get_time();
lttv_process_traceset_seek_n_backward(tsc, 100301,
seek_back_default_offset,
(seek_time_fct)lttv_state_traceset_seek_time_closest, NULL);
+ t1 = get_time();
+ g_message("Seek backward 100301 events (with seek closest) in %g seconds",
+ t1 - t0);
count = lttv_process_traceset_seek_n_forward(tsc, 100301, NULL);
if(lttv_traceset_context_ctx_pos_compare(tsc, saved_pos)) {
nb_tracefile = self->parent.tracefiles->len;
- g_tree_destroy(tsc->pqueue);
- tsc->pqueue = g_tree_new(compare_tracefile);
+ //g_tree_destroy(tsc->pqueue);
+ //tsc->pqueue = g_tree_new(compare_tracefile);
for(i = 0 ; i < nb_tracefile ; i++) {
tfcs =
g_assert(tfcs->parent.t_context != NULL);
LttvTracefileContext *tfc = LTTV_TRACEFILE_CONTEXT(tfcs);
+ g_tree_remove(tsc->pqueue, tfc);
if(ep != NULL) {
g_assert(ltt_tracefile_seek_position(tfc->tf, ep) == 0);
LttvAttribute *saved_states_tree, *saved_state_tree, *closest_tree;
- g_tree_destroy(self->parent.pqueue);
- self->parent.pqueue = g_tree_new(compare_tracefile);
+ //g_tree_destroy(self->parent.pqueue);
+ //self->parent.pqueue = g_tree_new(compare_tracefile);
g_info("Entering seek_time_closest for time %lu.%lu", t.tv_sec, t.tv_nsec);
for(i = 0 ; i < nb_tracefile ; i++) {
tfc = &g_array_index(self->tracefiles, LttvTracefileContext*, i);
- //g_tree_remove(pqueue, *tfc);
+ g_tree_remove(pqueue, *tfc);
ret = ltt_tracefile_seek_time((*tfc)->tf, start);
if(ret == EPERM) g_error("error in lttv_process_trace_seek_time seek");
LttvTraceContext *tc;
- g_tree_destroy(self->pqueue);
- self->pqueue = g_tree_new(compare_tracefile);
+ //g_tree_destroy(self->pqueue);
+ //self->pqueue = g_tree_new(compare_tracefile);
nb_trace = lttv_traceset_number(self->ts);
for(i = 0 ; i < nb_trace ; i++) {
const LttvTracesetContextPosition *pos)
{
guint i;
-
- /* If a position is set, seek the traceset to this position */
+ /* If a position is set, seek the traceset to this position */
if(ltt_time_compare(pos->timestamp, ltt_time_infinite) != 0) {
- g_tree_destroy(self->pqueue);
- self->pqueue = g_tree_new(compare_tracefile);
+
+ /* Test to see if the traces has been added to the trace set :
+ * It should NEVER happen. Clear all positions if a new trace comes in. */
+ /* FIXME I know this test is not optimal : should keep a number of
+ * tracefiles variable in the traceset.. eventually */
+ guint num_traces = lttv_traceset_number(self->ts);
+ guint tf_count = 0;
+ for(i=0; i<num_traces;i++) {
+ GArray * tracefiles = self->traces[i]->tracefiles;
+ guint j;
+ guint num_tracefiles = tracefiles->len;
+ for(j=0;j<num_tracefiles;j++)
+ tf_count++;
+ }
+ g_assert(tf_count == pos->tfcp->len);
+
+
+ //g_tree_destroy(self->pqueue);
+ //self->pqueue = g_tree_new(compare_tracefile);
for(i=0;i<pos->tfcp->len; i++) {
LttvTracefileContextPosition *tfcp =
&g_array_index(pos->tfcp, LttvTracefileContextPosition, i);
-
+
+ g_tree_remove(self->pqueue, tfcp->tfc);
if(tfcp->used == TRUE) {
if(ltt_tracefile_seek_position(tfcp->tfc->tf, tfcp->event) != 0)