From: Yannick Brosseau Date: Mon, 2 Apr 2012 18:45:03 +0000 (-0400) Subject: Add a temporary single LttvState container X-Git-Tag: v1.5-beta1~77 X-Git-Url: http://git.lttng.org/?p=lttv.git;a=commitdiff_plain;h=f826ad80ef4be944bdda493bf0ce8b7706d4131c Add a temporary single LttvState container Signed-off-by: Yannick Brosseau --- diff --git a/lttv/lttv/tracecontext.c b/lttv/lttv/tracecontext.c index e937789c..596e06f0 100644 --- a/lttv/lttv/tracecontext.c +++ b/lttv/lttv/tracecontext.c @@ -206,6 +206,8 @@ init(LttvTracesetContext *self, LttvTraceset *ts) &begin_pos, NULL); self->event_hooks = lttv_hooks_new(); + self->tmpState = g_new(LttvTraceState *, 1); + for(i = 0 ; i < nb_trace ; i++) { tc = LTTV_TRACESET_CONTEXT_GET_CLASS(self)->new_trace_context(self); self->traces[i] = tc; @@ -688,8 +690,6 @@ guint lttv_process_traceset_middle(LttvTracesetContext *self, struct bt_ctf_event *bt_event; LttvEvent event; - /* TODO ybrosseau 2012-03-16: Put in really in the traceset */ - LttvTraceState state; while(TRUE) { @@ -702,8 +702,10 @@ guint lttv_process_traceset_middle(LttvTracesetContext *self, count++; event.bt_event = bt_event; - event.state = &state; - + /* TODO ybrosseau 2012-04-01: use bt_ctf_get_trace_handle + to retrieve the right state container */ + event.state = self->tmpState; + lttv_hooks_call(self->event_hooks, &event); if(bt_iter_next(bt_ctf_get_iter(self->iter)) < 0) { diff --git a/lttv/lttv/tracecontext.h b/lttv/lttv/tracecontext.h index 785f7021..764e38a7 100644 --- a/lttv/lttv/tracecontext.h +++ b/lttv/lttv/tracecontext.h @@ -84,6 +84,9 @@ typedef struct _LttvFilter LttvFilter; #define LTTVFILTER_TYPE_DEFINED #endif +typedef struct _LttvTraceState LttvTraceState; + + #define LTTV_TRACESET_CONTEXT_TYPE (lttv_traceset_context_get_type ()) #define LTTV_TRACESET_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), LTTV_TRACESET_CONTEXT_TYPE, LttvTracesetContext)) #define LTTV_TRACESET_CONTEXT_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), LTTV_TRACESET_CONTEXT_TYPE, LttvTracesetContextClass)) @@ -103,6 +106,7 @@ struct _LttvTracesetContext { struct bt_ctf_iter *iter; /* TODO ybrosseau: Added for babeltrace proto */ LttvHooks *event_hooks; + LttvTraceState *tmpState; /* Remove when we have the state in LttvTrace */ LttvTracesetContextPosition *sync_position; /* position at which to sync the trace context */