lib: create a clock class object from component
[babeltrace.git] / plugins / ctf / common / metadata / ctf-meta-translate.c
index 9a5986228901b0c06c1f45d70beb0e46970b0941..d307094ef12fa643fa693475275fca056a844e85 100644 (file)
@@ -26,6 +26,7 @@
 #include "ctf-meta-visitors.h"
 
 struct ctx {
+       bt_self_component_source *self_comp;
        bt_trace_class *ir_tc;
        bt_stream_class *ir_sc;
        struct ctf_trace_class *tc;
@@ -580,7 +581,9 @@ int ctf_trace_class_to_ir(struct ctx *ctx)
        for (i = 0; i < ctx->tc->clock_classes->len; i++) {
                struct ctf_clock_class *cc = ctx->tc->clock_classes->pdata[i];
 
-               cc->ir_cc = bt_clock_class_create(ctx->ir_tc);
+               cc->ir_cc = bt_clock_class_create(
+                               bt_self_component_source_as_self_component(
+                                       ctx->self_comp));
                ctf_clock_class_to_ir(cc->ir_cc, cc);
        }
 
@@ -594,13 +597,14 @@ end:
 }
 
 BT_HIDDEN
-int ctf_trace_class_translate(bt_trace_class *ir_tc,
-               struct ctf_trace_class *tc)
+int ctf_trace_class_translate(bt_self_component_source *self_comp,
+               bt_trace_class *ir_tc, struct ctf_trace_class *tc)
 {
        int ret = 0;
        uint64_t i;
        struct ctx ctx = { 0 };
 
+       ctx.self_comp = self_comp;
        ctx.tc = tc;
        ctx.ir_tc = ir_tc;
        ret = ctf_trace_class_to_ir(&ctx);
This page took 0.024099 seconds and 4 git commands to generate.