- ret = BT_COMPONENT_STATUS_ERROR;
- fprintf(writer_component->err, "[error] %s in %s:%d\n", __func__,
- __FILE__, __LINE__);
- goto end_put_writer_stream_class;
+ writer_event_class = ctf_copy_event_class(writer_component->err,
+ event_class);
+ if (!writer_event_class) {
+ ret = BT_COMPONENT_STATUS_ERROR;
+ fprintf(writer_component->err, "[error] %s in %s:%d\n",
+ __func__, __FILE__, __LINE__);
+ goto end_put_writer_stream_class;
+ }
+ int_ret = bt_ctf_stream_class_add_event_class(
+ writer_stream_class, writer_event_class);
+ if (int_ret) {
+ ret = BT_COMPONENT_STATUS_ERROR;
+ fprintf(writer_component->err, "[error] %s in %s:%d\n",
+ __func__, __FILE__, __LINE__);
+ goto end_put_writer_stream_class;
+ }