* 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();
* Only read "stream_id" if get_unary_unsigned()
* succeeded.
*/
- if (ret || (!ret && *stream_id < 0)) {
+ if (ret) {
_BT_LOGE_NODE(node,
"Unexpected unary expression for event class's `stream_id` attribute.");
ret = -EINVAL;
stream_class->id = stream_id;
g_ptr_array_add(ctx->ctf_tc->stream_classes,
stream_class);
- stream_class = stream_class;
break;
case 1:
/* Single stream class: get its ID */
goto end;
}
+ /*
+ * If there are fields which are not related to the CTF format
+ * itself in the packet header and in event header field
+ * classes, warn about it because they are never translated.
+ */
+ ctf_trace_class_warn_meaningless_header_fields(ctx->ctf_tc);
+
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;