+ return ret;
+}
+
+int bt_ctf_clock_value_get_value_ns_from_epoch(struct bt_ctf_clock_value *value,
+ int64_t *ret_value_ns)
+{
+ int ret = 0;
+ int64_t ns;
+
+ if (!value || !ret_value_ns) {
+ ret = -1;
+ goto end;
+ }
+
+ /* Initialize nanosecond timestamp to clock's offset in seconds. */
+ ns = value->clock_class->offset_s * 1000000000;
+
+ /* Add offset in cycles, converted to nanoseconds. */
+ ns += ns_from_value(value->clock_class->frequency,
+ value->clock_class->offset);
+
+ /* Add given value, converter to nanoseconds. */
+ ns += ns_from_value(value->clock_class->frequency, value->value);
+
+ *ret_value_ns = ns;
+end:
+ return ret;