/* Subtile modification :
* if tracefile has no event at or after the time requested, it is not put in
- * the queue, as the next read would fail. */
+ * the queue, as the next read would fail.
+ *
+ * Don't forget to empty the traceset pqueue before calling this.
+ */
void lttv_process_trace_seek_time(LttvTraceContext *self, LttTime start)
{
guint i, nb_tracefile;
nb_tracefile = self->tracefiles->len;
- g_tree_destroy(self->ts_context->pqueue);
- self->ts_context->pqueue = g_tree_new(compare_tracefile);
-
GTree *pqueue = self->ts_context->pqueue;
for(i = 0 ; i < nb_tracefile ; i++) {
LttvTraceContext *tc;
+ 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++) {
tc = self->traces[i];
{
guint i;
guint num_traces = lttv_traceset_number(self->ts);
-
+
+ pos->tfc = g_array_set_size(pos->tfc, 0);
+ pos->ep = g_array_set_size(pos->ep, 0);
+
for(i=0; i<num_traces;i++) {
GArray * tracefiles = self->traces[i]->tracefiles;
guint j;
int i;
LttEventPosition **src_ep, **dest_ep;
- g_array_set_size(dest->ep, src->ep->len);
- g_array_set_size(dest->tfc, src->tfc->len);
+ dest->ep = g_array_set_size(dest->ep, src->ep->len);
+ dest->tfc = g_array_set_size(dest->tfc, src->tfc->len);
for(i=0;i<src->ep->len;i++) {
src_ep = &g_array_index(src->ep, LttEventPosition*, i);