Remove reference to thread brand
[lttv.git] / lttv / lttv / event.c
index 2f26274ca83e8f351e7688e1cebdb736a62e6755..61bdafb8655f9af543ee8ad53c8b39d5eaa9ef85 100644 (file)
@@ -13,22 +13,25 @@ LttTime lttv_event_get_timestamp(LttvEvent *event)
 //TODO ybrosseau find a way to return an error code
 unsigned long lttv_event_get_long_unsigned(LttvEvent *event, const char* field)
 {
-       const struct definition *scope;
+       const struct bt_definition *scope;
        unsigned long timestamp;
        unsigned long data;
        struct bt_ctf_event *ctf_event = event->bt_event;
 
        timestamp = bt_ctf_get_timestamp(ctf_event);
        if (timestamp == -1ULL) {
+               printf("ERROR: lttv_event_get_long_unsigned - invalid event\n");
                return 0;
        }
        //scope = bt_ctf_get_top_level_scope(ctf_event, BT_STREAM_PACKET_CONTEXT);
        scope = bt_ctf_get_top_level_scope(ctf_event, BT_EVENT_FIELDS);
        if (bt_ctf_field_get_error()) {
+               printf("ERROR: lttv_event_get_long_unsigned - cannot get field scope\n");
                return 0;
        }
        data = bt_ctf_get_uint64(bt_ctf_get_field(ctf_event, scope, field));
        if (bt_ctf_field_get_error()) {
+               printf("ERROR: lttv_event_get_long_unsigned - cannot get field data %s \n", field);
                return 0;
        } else {
                return data;
@@ -38,7 +41,7 @@ unsigned long lttv_event_get_long_unsigned(LttvEvent *event, const char* field)
 
 char* lttv_event_get_string(LttvEvent *event, const char* field)
 {
-       const struct definition *scope;
+       const struct bt_definition *scope;
        unsigned long timestamp;
        char* data;
        struct bt_ctf_event *ctf_event = event->bt_event;
@@ -75,21 +78,24 @@ char* lttv_event_get_string(LttvEvent *event, const char* field)
 }
 long lttv_event_get_long(LttvEvent *event, const char* field)
 {
-       const struct definition *scope;
+       const struct bt_definition *scope;
        unsigned long timestamp;
        long data;
        struct bt_ctf_event *ctf_event = event->bt_event;
 
        timestamp = bt_ctf_get_timestamp(ctf_event);
        if (timestamp == -1ULL) {
+               printf("ERROR: lttv_event_get_long - invalid event\n");
                return 0;
        }
        scope = bt_ctf_get_top_level_scope(ctf_event, BT_EVENT_FIELDS);
        if (bt_ctf_field_get_error()) {
+               printf("ERROR: lttv_event_get_long - cannot get field scope\n");
                return 0;
        }
        data = bt_ctf_get_int64(bt_ctf_get_field(ctf_event, scope, field));
        if (bt_ctf_field_get_error()) {
+               printf("ERROR: lttv_event_get_long - cannot get field data %s \n", field);
                return 0;
        } else {
                return data;
@@ -98,7 +104,7 @@ long lttv_event_get_long(LttvEvent *event, const char* field)
 /*
 unsigned int lttv_event_get_int_unsigned(LttvEvent *event, const char* field)
 {
-       struct definition *scope;
+       struct bt_definition *scope;
        unsigned long timestamp;
        char* data;
        struct bt_ctf_event *ctf_event = event->bt_event;
@@ -120,7 +126,7 @@ unsigned int lttv_event_get_int_unsigned(LttvEvent *event, const char* field)
 }
 int lttv_event_get_int(LttvEvent *event, const char* field)
 {
-       struct definition *scope;
+       struct bt_definition *scope;
        unsigned long timestamp;
        char* data;
        struct bt_ctf_event *ctf_event = event->bt_event;
This page took 0.023641 seconds and 4 git commands to generate.