- LttvTracesetContextPosition *pos = g_new(LttvTracesetContextPosition,1);
- pos->ep = g_array_sized_new(FALSE, TRUE, sizeof(LttEventPosition*),
- 10);
- pos->tfc = g_array_sized_new(FALSE, TRUE, sizeof(LttvTracefileContext*),
- 10);
+ guint num_traces = lttv_traceset_number(self->ts);
+ guint tf_count = 0;
+ guint i;
+
+ 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++;
+ }
+ LttvTracesetContextPosition *pos =
+ g_new(LttvTracesetContextPosition, 1);
+ pos->tfcp = g_array_sized_new(FALSE, TRUE,
+ sizeof(LttvTracefileContextPosition),
+ tf_count);
+ g_array_set_size(pos->tfcp, tf_count);
+ for(i=0;i<pos->tfcp->len;i++) {
+ LttvTracefileContextPosition *tfcp =
+ &g_array_index(pos->tfcp, LttvTracefileContextPosition, i);
+ tfcp->event = ltt_event_position_new();
+ }
+