extern "C" {
#endif
-extern bt_clock_class *bt_clock_class_create(bt_trace_class *trace_class);
+extern bt_clock_class *bt_clock_class_create(bt_self_component *self_comp);
extern bt_clock_class_status bt_clock_class_set_name(
bt_clock_class *clock_class, const char *name);
clock_class->frequency, &clock_class->base_offset.value_ns);
}
-struct bt_clock_class *bt_clock_class_create(bt_trace_class *trace_class)
+struct bt_clock_class *bt_clock_class_create(bt_self_component *self_comp)
{
int ret;
struct bt_clock_class *clock_class = NULL;
- BT_ASSERT_PRE_NON_NULL(trace_class, "Trace class");
+ BT_ASSERT_PRE_NON_NULL(self_comp, "Self component");
BT_LOGD_STR("Creating default clock class object");
clock_class = g_new0(struct bt_clock_class, 1);
#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;
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);
}
}
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);
int ctf_trace_class_resolve_field_classes(struct ctf_trace_class *tc);
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);
BT_HIDDEN
int ctf_trace_class_update_default_clock_classes(
* Visitor context (private).
*/
struct ctx {
+ bt_self_component_source *self_comp;
/* Trace IR trace class being filled (owned by this) */
bt_trace_class *trace_class;
BT_LOGE_STR("Cannot create empty trace class.");
goto error;
}
+ ctx->self_comp = self_comp;
}
ctx->ctf_tc = ctf_trace_class_create();
if (ctx->trace_class) {
/* Copy new CTF metadata -> new IR metadata */
- ret = ctf_trace_class_translate(ctx->trace_class, ctx->ctf_tc);
+ ret = ctf_trace_class_translate(ctx->self_comp,
+ ctx->trace_class, ctx->ctf_tc);
if (ret) {
ret = -EINVAL;
goto end;
if (has_ts) {
dmesg_comp->clock_class = bt_clock_class_create(
- dmesg_comp->trace_class);
+ bt_self_component_source_as_self_component(
+ dmesg_comp->self_comp));
if (!dmesg_comp->clock_class) {
BT_LOGE_STR("Cannot create clock class.");
goto error;