X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=plugins%2Fctf%2Fcommon%2Fmetadata%2Fctf-meta-translate.c;h=ca3069aee13bd1ab8091b6b9f5078247ad2d890a;hb=68b66a256a54d32992dfefeaad11eea88b7df234;hp=d307094ef12fa643fa693475275fca056a844e85;hpb=7fcdb0a96f75d66f5ff4f32d3ca78d7ca6067e4c;p=babeltrace.git diff --git a/plugins/ctf/common/metadata/ctf-meta-translate.c b/plugins/ctf/common/metadata/ctf-meta-translate.c index d307094e..ca3069ae 100644 --- a/plugins/ctf/common/metadata/ctf-meta-translate.c +++ b/plugins/ctf/common/metadata/ctf-meta-translate.c @@ -15,9 +15,9 @@ #define BT_LOG_TAG "PLUGIN-CTF-METADATA-META-TRANSLATE" #include "logging.h" -#include -#include -#include +#include +#include +#include #include #include #include @@ -326,6 +326,16 @@ bool ctf_field_class_struct_has_immediate_member_in_ir( uint64_t i; bool has_immediate_member_in_ir = false; + /* + * If the structure field class has no members at all, then it + * was an empty structure in the beginning, so leave it existing + * and empty. + */ + if (fc->members->len == 0) { + has_immediate_member_in_ir = true; + goto end; + } + for (i = 0; i < fc->members->len; i++) { struct ctf_named_field_class *named_fc = ctf_field_class_struct_borrow_member_by_index(fc, i); @@ -371,33 +381,6 @@ bt_field_class *scope_ctf_field_class_to_ir(struct ctx *ctx) return ir_fc; } -static inline -struct ctf_field_class_int *borrow_named_int_field_class( - struct ctf_field_class_struct *struct_fc, const char *name) -{ - struct ctf_named_field_class *named_fc = NULL; - struct ctf_field_class_int *int_fc = NULL; - - if (!struct_fc) { - goto end; - } - - named_fc = ctf_field_class_struct_borrow_member_by_name(struct_fc, name); - if (!named_fc) { - goto end; - } - - if (named_fc->fc->type != CTF_FIELD_CLASS_TYPE_INT && - named_fc->fc->type != CTF_FIELD_CLASS_TYPE_ENUM) { - goto end; - } - - int_fc = (void *) named_fc->fc; - -end: - return int_fc; -} - static inline void ctf_event_class_to_ir(struct ctx *ctx) { @@ -504,6 +487,16 @@ void ctf_stream_class_to_ir(struct ctx *ctx) BT_ASSERT(ret == 0); } + bt_stream_class_set_packets_have_beginning_default_clock_snapshot( + ctx->ir_sc, ctx->sc->packets_have_ts_begin); + bt_stream_class_set_packets_have_end_default_clock_snapshot( + ctx->ir_sc, ctx->sc->packets_have_ts_end); + bt_stream_class_set_supports_discarded_events(ctx->ir_sc, + ctx->sc->has_discarded_events, + ctx->sc->discarded_events_have_default_cs); + bt_stream_class_set_supports_discarded_packets(ctx->ir_sc, + ctx->sc->has_discarded_packets, + ctx->sc->discarded_packets_have_default_cs); ctx->sc->is_translated = true; ctx->sc->ir_sc = ctx->ir_sc;