Add clock offset support
[babeltrace.git] / formats / ctf-text / ctf-text.c
index 35b26235714b236c31625b2797d41815561c739b..e4d7682c0ee27d0d6bac6381c52933f1a9911807 100644 (file)
@@ -162,15 +162,16 @@ void ctf_text_print_timestamp(struct ctf_text_stream_pos *pos,
                        struct ctf_stream *stream)
 {
        uint64_t ts_sec = 0, ts_nsec;
-       //need to get the clock offset at trace collection level. TODO
-       //struct ctf_trace *trace = stream->stream_class->trace;
+       struct ctf_trace *trace = stream->stream_class->trace;
+       struct trace_collection *tc = trace->collection;
+       struct ctf_clock *clock = tc->single_clock;
 
        ts_nsec = stream->timestamp;
 
        /* Add offsets */
-       if (!opt_clock_raw) {
-               //ts_sec += pos->clock_offset_s;
-               //ts_nsec += pos->clock_offset;
+       if (!opt_clock_raw && clock) {
+               ts_sec += clock->offset_s;
+               ts_nsec += clock->offset;
        }
        ts_sec += opt_clock_offset;
 
This page took 0.023121 seconds and 4 git commands to generate.