X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=formats%2Fctf%2Fevents.c;h=a8b08f657680ec4ddfffe282726ff8ac2de7a988;hp=27a5fe7bff89bc40e7efdbad21b3f18d23cafb4b;hb=63dd3817d2f75681ece99d683e4944e66e4153a2;hpb=64c2c2496913d64ddd77343b9651f1f233cda5cf diff --git a/formats/ctf/events.c b/formats/ctf/events.c index 27a5fe7b..a8b08f65 100644 --- a/formats/ctf/events.c +++ b/formats/ctf/events.c @@ -281,22 +281,20 @@ int bt_ctf_event_get_handle_id(const struct bt_ctf_event *ctf_event) return ret; } -uint64_t bt_ctf_get_timestamp_raw(const struct bt_ctf_event *ctf_event) +uint64_t bt_ctf_get_timestamp(const struct bt_ctf_event *ctf_event) { struct ctf_event_definition *event = ctf_event->parent; if (event && event->stream->has_timestamp) - return ctf_get_timestamp_raw(event->stream, - event->stream->timestamp); + return event->stream->real_timestamp; else return -1ULL; } -uint64_t bt_ctf_get_timestamp(const struct bt_ctf_event *ctf_event) +uint64_t bt_ctf_get_cycles(const struct bt_ctf_event *ctf_event) { struct ctf_event_definition *event = ctf_event->parent; if (event && event->stream->has_timestamp) - return ctf_get_timestamp(event->stream, - event->stream->timestamp); + return event->stream->cycles_timestamp; else return -1ULL; } @@ -357,6 +355,20 @@ int bt_ctf_get_int_byte_order(const struct definition *field) return ret; } +ssize_t bt_ctf_get_int_len(const struct definition *field) +{ + ssize_t ret; + + if (field && bt_ctf_field_type(field) == CTF_TYPE_INTEGER) { + ret = (ssize_t) get_int_len(field); + } else { + ret = -1; + bt_ctf_field_set_error(-EINVAL); + } + + return ret; +} + enum ctf_string_encoding bt_ctf_get_encoding(const struct definition *field) { enum ctf_string_encoding ret = 0; @@ -395,7 +407,7 @@ int bt_ctf_get_array_len(const struct definition *field) uint64_t bt_ctf_get_uint64(const struct definition *field) { - unsigned int ret = 0; + uint64_t ret = 0; if (field && bt_ctf_field_type(field) == CTF_TYPE_INTEGER) ret = get_unsigned_int(field); @@ -407,7 +419,7 @@ uint64_t bt_ctf_get_uint64(const struct definition *field) int64_t bt_ctf_get_int64(const struct definition *field) { - int ret = 0; + int64_t ret = 0; if (field && bt_ctf_field_type(field) == CTF_TYPE_INTEGER) ret = get_signed_int(field);