- if (bt_ctf_trace_get_clock_count(ctx->trace) != 0) {
- _PERROR("%s", "only CTF traces with a single clock declaration are supported as of this version");
- ret = -EINVAL;
+ clock_class_name = bt_ctf_clock_class_get_name(clock);
+ assert(clock_class_name);
+ if (ctx->is_lttng && strcmp(clock_class_name, "monotonic") == 0) {
+ /*
+ * Old versions of LTTng forgot to set its clock class
+ * as absolute, even if it is. This is important because
+ * it's a condition to be able to sort notifications
+ * from different sources.
+ */
+ ret = bt_ctf_clock_class_set_is_absolute(clock, 1);
+ if (ret) {
+ _PERROR("%s", "cannot set clock class's absolute option");
+ goto error;
+ }
+ }
+
+ ret = apply_clock_class_offset(ctx, clock);
+ if (ret) {
+ _PERROR("%s", "cannot apply clock class offset ");