+static
+struct bt_ctf_trace *event_class_get_trace(FILE *err,
+ struct bt_ctf_event_class *event_class)
+{
+ struct bt_ctf_trace *trace = NULL;
+ struct bt_ctf_stream_class *stream_class = NULL;
+
+ stream_class = bt_ctf_event_class_get_stream_class(event_class);
+ if (!stream_class) {
+ fprintf(err, "[error] %s in %s:%d\n", __func__, __FILE__,
+ __LINE__);
+ goto error;
+ }
+
+ trace = bt_ctf_stream_class_get_trace(stream_class);
+ if (!trace) {
+ fprintf(err, "[error] %s in %s:%d\n", __func__, __FILE__,
+ __LINE__);
+ goto error;
+ }
+
+ goto end;
+
+error:
+ BT_PUT(trace);
+end:
+ bt_put(stream_class);
+ return trace;
+}
+