Add a temporary single LttvState container
authorYannick Brosseau <yannick.brosseau@gmail.com>
Mon, 2 Apr 2012 18:45:03 +0000 (14:45 -0400)
committerYannick Brosseau <yannick.brosseau@gmail.com>
Mon, 11 Jun 2012 21:34:33 +0000 (17:34 -0400)
Signed-off-by: Yannick Brosseau <yannick.brosseau@gmail.com>
lttv/lttv/tracecontext.c
lttv/lttv/tracecontext.h

index e937789c1e5ac499fd8df0f1e9817aac92f7a44a..596e06f007901418939c6289952aaa4c34164143 100644 (file)
@@ -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) {
index 785f7021984ef081403ac29bcc27569a97f10b1b..764e38a7efb1d5c01ff6071860bb55ea6a960baa 100644 (file)
@@ -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 */
This page took 0.025165 seconds and 4 git commands to generate.