klass->find_subdir = (LttvIAttribute* (*) (LttvIAttribute *self,
LttvAttributeName name)) lttv_attribute_find_subdir;
+
}
}
+LttvTracesetContextPosition *ltt_traceset_context_position_new()
+{
+ return g_new(LttvTracesetContextPosition,1);
+}
+
+
void lttv_traceset_context_position_save(const LttvTracesetContext *self,
LttvTracesetContextPosition *pos)
{
}
+void lttv_traceset_context_position_copy(LttvTracesetContextPosition *dest,
+ const LttvTracesetContextPosition *src)
+{
+ guint nb_trace, nb_tracefile;
+ guint iter_trace, iter_tracefile;
+
+ nb_trace = dest->nb_trace = src->nb_trace;
+ dest->t_pos = g_new(LttvTraceContextPosition, nb_trace);
+
+ for(iter_trace = 0 ; iter_trace < nb_trace ; iter_trace++) {
+
+ nb_tracefile = dest->t_pos[iter_trace].nb_tracefile =
+ src->t_pos[iter_trace].nb_tracefile;
+
+ for(iter_tracefile = 0; iter_tracefile < nb_tracefile; iter_tracefile++) {
+ dest->t_pos[iter_trace].tf_pos[iter_tracefile] =
+ ltt_event_position_new();
+ ltt_event_position_copy(
+ dest->t_pos[iter_trace].tf_pos[iter_tracefile],
+ src->t_pos[iter_trace].tf_pos[iter_tracefile]);
+ }
+ }
+
+ dest->timestamp = src->timestamp;
+}
+
gint lttv_traceset_context_ctx_pos_compare(const LttvTracesetContext *self,
const LttvTracesetContextPosition *pos)
{
LttvTracefileContext *lttv_traceset_context_get_current_tfc(
LttvTracesetContext *self);
+LttvTracesetContextPosition *ltt_traceset_context_position_new();
+
void lttv_traceset_context_position_save(const LttvTracesetContext *self,
LttvTracesetContextPosition *pos);
void lttv_traceset_context_position_destroy(LttvTracesetContextPosition *pos);
+void lttv_traceset_context_position_copy(LttvTracesetContextPosition *dest,
+ const LttvTracesetContextPosition *src);
+
gint lttv_traceset_context_pos_pos_compare(
const LttvTracesetContextPosition *pos1,
const LttvTracesetContextPosition *pos2);
trace = g_ptr_array_index(s_orig->traces, i);
trace->ref_count++;
- /*CHECK this used ltt_trace_copy while it may not be needed. Need to
- define how traces and tracesets are shared */
- g_ptr_array_add(
- s->traces,
- g_ptr_array_index(s_orig->traces, i));
+ g_ptr_array_add(s->traces,
+ trace);
}
s->a = LTTV_ATTRIBUTE(lttv_iattribute_deep_copy(LTTV_IATTRIBUTE(s_orig->a)));
return s;
void lttv_traceset_destroy(LttvTraceset *s)
{
+ guint i;
+
+ for(i=0;i<s->traces->len;i++) {
+ LttvTrace *trace = g_ptr_array_index(s->traces, i);
+ lttv_trace_unref(trace);
+ if(lttv_trace_get_ref_number(trace) == 0)
+ lttv_trace_destroy(trace);
+ }
g_ptr_array_free(s->traces, TRUE);
g_object_unref(s->a);
g_free(s);