X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=plugins%2Fctf%2Flttng-live%2Fmetadata.c;h=4cfd88301572e7de05cc1f8b7177443040e642f1;hb=40f4ba76dd6f9508ca51b6220eaed57632281a07;hp=7fec74add2bdb2e2bba8a63c222512a503081d4e;hpb=a2a545450763347fd1c1e5c089a296238e1cbc11;p=babeltrace.git diff --git a/plugins/ctf/lttng-live/metadata.c b/plugins/ctf/lttng-live/metadata.c index 7fec74ad..4cfd8830 100644 --- a/plugins/ctf/lttng-live/metadata.c +++ b/plugins/ctf/lttng-live/metadata.c @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include "metadata.h" #include "../common/metadata/decoder.h" @@ -54,31 +54,31 @@ struct packet_header { } __attribute__((__packed__)); static -enum bt_ctf_lttng_live_iterator_status lttng_live_update_clock_map( +enum bt_lttng_live_iterator_status lttng_live_update_clock_map( struct lttng_live_trace *trace) { - enum bt_ctf_lttng_live_iterator_status status = - BT_CTF_LTTNG_LIVE_ITERATOR_STATUS_OK; + enum bt_lttng_live_iterator_status status = + BT_LTTNG_LIVE_ITERATOR_STATUS_OK; size_t i; int count, ret; - BT_PUT(trace->cc_prio_map); + BT_OBJECT_PUT_REF_AND_RESET(trace->cc_prio_map); trace->cc_prio_map = bt_clock_class_priority_map_create(); if (!trace->cc_prio_map) { goto error; } - count = bt_ctf_trace_get_clock_class_count(trace->trace); - assert(count >= 0); + count = bt_trace_get_clock_class_count(trace->trace); + BT_ASSERT(count >= 0); for (i = 0; i < count; i++) { - struct bt_ctf_clock_class *clock_class = - bt_ctf_trace_get_clock_class_by_index(trace->trace, i); + const struct bt_clock_class *clock_class = + bt_trace_get_clock_class_by_index(trace->trace, i); - assert(clock_class); + BT_ASSERT(clock_class); ret = bt_clock_class_priority_map_add_clock_class( trace->cc_prio_map, clock_class, 0); - BT_PUT(clock_class); + BT_OBJECT_PUT_REF_AND_RESET(clock_class); if (ret) { goto error; @@ -87,13 +87,13 @@ enum bt_ctf_lttng_live_iterator_status lttng_live_update_clock_map( goto end; error: - status = BT_CTF_LTTNG_LIVE_ITERATOR_STATUS_ERROR; + status = BT_LTTNG_LIVE_ITERATOR_STATUS_ERROR; end: return status; } BT_HIDDEN -enum bt_ctf_lttng_live_iterator_status lttng_live_metadata_update( +enum bt_lttng_live_iterator_status lttng_live_metadata_update( struct lttng_live_trace *trace) { struct lttng_live_session *session = trace->session; @@ -103,16 +103,16 @@ enum bt_ctf_lttng_live_iterator_status lttng_live_metadata_update( char *metadata_buf = NULL; FILE *fp = NULL; enum ctf_metadata_decoder_status decoder_status; - enum bt_ctf_lttng_live_iterator_status status = - BT_CTF_LTTNG_LIVE_ITERATOR_STATUS_OK; + enum bt_lttng_live_iterator_status status = + BT_LTTNG_LIVE_ITERATOR_STATUS_OK; /* No metadata stream yet. */ if (!metadata) { if (session->new_streams_needed) { - status = BT_CTF_LTTNG_LIVE_ITERATOR_STATUS_AGAIN; + status = BT_LTTNG_LIVE_ITERATOR_STATUS_AGAIN; } else { session->new_streams_needed = true; - status = BT_CTF_LTTNG_LIVE_ITERATOR_STATUS_CONTINUE; + status = BT_LTTNG_LIVE_ITERATOR_STATUS_CONTINUE; } goto end; } @@ -164,7 +164,7 @@ enum bt_ctf_lttng_live_iterator_status lttng_live_metadata_update( } if (errno == EINTR) { if (lttng_live_is_canceled(session->lttng_live)) { - status = BT_CTF_LTTNG_LIVE_ITERATOR_STATUS_AGAIN; + status = BT_LTTNG_LIVE_ITERATOR_STATUS_AGAIN; goto end; } } @@ -178,7 +178,7 @@ enum bt_ctf_lttng_live_iterator_status lttng_live_metadata_update( if (len_read == 0) { if (!trace->trace) { - status = BT_CTF_LTTNG_LIVE_ITERATOR_STATUS_AGAIN; + status = BT_LTTNG_LIVE_ITERATOR_STATUS_AGAIN; goto end; } trace->new_metadata_needed = false; @@ -195,16 +195,16 @@ enum bt_ctf_lttng_live_iterator_status lttng_live_metadata_update( decoder_status = ctf_metadata_decoder_decode(metadata->decoder, fp); switch (decoder_status) { case CTF_METADATA_DECODER_STATUS_OK: - BT_PUT(trace->trace); + BT_OBJECT_PUT_REF_AND_RESET(trace->trace); trace->trace = ctf_metadata_decoder_get_trace(metadata->decoder); trace->new_metadata_needed = false; status = lttng_live_update_clock_map(trace); - if (status != BT_CTF_LTTNG_LIVE_ITERATOR_STATUS_OK) { + if (status != BT_LTTNG_LIVE_ITERATOR_STATUS_OK) { goto end; } break; case CTF_METADATA_DECODER_STATUS_INCOMPLETE: - status = BT_CTF_LTTNG_LIVE_ITERATOR_STATUS_AGAIN; + status = BT_LTTNG_LIVE_ITERATOR_STATUS_AGAIN; break; case CTF_METADATA_DECODER_STATUS_ERROR: case CTF_METADATA_DECODER_STATUS_INVAL_VERSION: @@ -214,7 +214,7 @@ enum bt_ctf_lttng_live_iterator_status lttng_live_metadata_update( goto end; error: - status = BT_CTF_LTTNG_LIVE_ITERATOR_STATUS_ERROR; + status = BT_LTTNG_LIVE_ITERATOR_STATUS_ERROR; end: if (fp) { int closeret;