X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=formats%2Fctf%2Fevents.c;h=d8e8d5dd1ffb1e38cbac6d90badec8f49e3fa2cb;hb=40af9f9fb5d827c8c58e32efd6fca204da1194c8;hp=eff707239af3dbc124ca7b81a6d4aa85eb031ea0;hpb=61bb790910e315bfd61fa34ecf31f79b86cbb14e;p=babeltrace.git diff --git a/formats/ctf/events.c b/formats/ctf/events.c index eff70723..d8e8d5dd 100644 --- a/formats/ctf/events.c +++ b/formats/ctf/events.c @@ -47,7 +47,7 @@ __thread int bt_ctf_last_field_error = 0; const struct bt_definition *bt_ctf_get_top_level_scope(const struct bt_ctf_event *ctf_event, - enum bt_ctf_scope scope) + enum ctf_scope scope) { const struct bt_definition *tmp = NULL; const struct ctf_event_definition *event; @@ -315,18 +315,19 @@ int bt_ctf_event_get_handle_id(const struct bt_ctf_event *ctf_event) return ret; } -uint64_t bt_ctf_get_timestamp(const struct bt_ctf_event *ctf_event) +int bt_ctf_get_timestamp(const struct bt_ctf_event *ctf_event, int64_t *timestamp) { const struct ctf_event_definition *event; - if (!ctf_event) - return -1ULL; + if (!ctf_event || !timestamp) + return -1; event = ctf_event->parent; if (event && event->stream->has_timestamp) - return event->stream->real_timestamp; + *timestamp = event->stream->real_timestamp; else - return -1ULL; + return -1; + return 0; } uint64_t bt_ctf_get_cycles(const struct bt_ctf_event *ctf_event) @@ -478,7 +479,7 @@ const char *bt_ctf_get_enum_str(const struct bt_definition *field) g_array_unref(array); bt_ctf_field_set_error(-ENOENT); return NULL; - } + } /* Return first string. Arbitrary choice. */ ret = g_quark_to_string(g_array_index(array, GQuark, 0)); g_array_unref(array); @@ -721,7 +722,7 @@ uint64_t bt_ctf_get_decl_event_id(const struct bt_ctf_event_decl *event) } int bt_ctf_get_decl_fields(struct bt_ctf_event_decl *event_decl, - enum bt_ctf_scope scope, + enum ctf_scope scope, struct bt_ctf_field_decl const * const **list, unsigned int *count) {