+static
+int sync_event_classes(struct debug_info_iterator *debug_it,
+ struct bt_ctf_stream *stream,
+ struct bt_ctf_stream *writer_stream)
+{
+ int int_ret;
+ struct bt_ctf_stream_class *stream_class = NULL,
+ *writer_stream_class = NULL;
+ enum bt_component_status ret;
+
+ stream_class = bt_ctf_stream_get_class(stream);
+ if (!stream_class) {
+ fprintf(debug_it->err, "[error] %s in %s:%d\n", __func__,
+ __FILE__, __LINE__);
+ goto error;
+ }
+
+ writer_stream_class = bt_ctf_stream_get_class(writer_stream);
+ if (!writer_stream_class) {
+ fprintf(debug_it->err, "[error] %s in %s:%d\n", __func__,
+ __FILE__, __LINE__);
+ goto error;
+ }
+
+ ret = ctf_copy_event_classes(debug_it->err, stream_class,
+ writer_stream_class);
+ if (ret != BT_COMPONENT_STATUS_OK) {
+ goto error;
+ }
+
+ int_ret = 0;
+ goto end;
+
+error:
+ int_ret = -1;
+end:
+ bt_put(stream_class);
+ bt_put(writer_stream_class);
+ return int_ret;
+}
+