+ return ret;
+}
+/*
+ * Iterate over the stream classes and returns the first clock class
+ * encountered. This is useful to create message iterator inactivity message as
+ * we don't need a particular clock class.
+ */
+static
+const bt_clock_class *borrow_any_clock_class(bt_trace_class *tc)
+{
+ uint64_t i, sc_count;
+ const bt_clock_class *cc = NULL;
+ const bt_stream_class *sc;
+
+ sc_count = bt_trace_class_get_stream_class_count(tc);
+ for (i = 0; i < sc_count; i++) {
+ sc = bt_trace_class_borrow_stream_class_by_index_const(tc, i);
+ BT_ASSERT(sc);
+
+ cc = bt_stream_class_borrow_default_clock_class_const(sc);
+ if (cc) {
+ goto end;
+ }
+ }
+end:
+ BT_ASSERT(cc);
+ return cc;