Add Debug output on errors
authorYannick Brosseau <yannick.brosseau@gmail.com>
Mon, 5 Nov 2012 22:08:16 +0000 (17:08 -0500)
committerYannick Brosseau <yannick.brosseau@gmail.com>
Mon, 5 Nov 2012 22:08:16 +0000 (17:08 -0500)
Signed-off-by: Yannick Brosseau <yannick.brosseau@gmail.com>
lttv/lttv/event.c

index 2f26274ca83e8f351e7688e1cebdb736a62e6755..c30dcf0b666f00ec8fb338a1356f475656a2c464 100644 (file)
@@ -20,15 +20,18 @@ unsigned long lttv_event_get_long_unsigned(LttvEvent *event, const char* field)
 
        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;
@@ -82,14 +85,17 @@ long lttv_event_get_long(LttvEvent *event, const char* field)
 
        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;
This page took 0.024304 seconds and 4 git commands to generate.