X-Git-Url: https://git.efficios.com/?a=blobdiff_plain;f=formats%2Fctf%2Fevents-private.h;h=c47fd7d85deaf5372a7adaf2fc3200e4461ca161;hb=c3c30b08de95f06de6ad2f12001bede5da3f7674;hp=201b2b3692850dd739188a54c148063d3d5a31d2;hpb=c462e188f3e7819c7bc74f671038cdbf36e8c3c0;p=babeltrace.git diff --git a/formats/ctf/events-private.h b/formats/ctf/events-private.h index 201b2b36..c47fd7d8 100644 --- a/formats/ctf/events-private.h +++ b/formats/ctf/events-private.h @@ -35,20 +35,20 @@ #include static inline -uint64_t ctf_get_real_timestamp(struct ctf_stream_definition *stream, - uint64_t timestamp) +int64_t ctf_get_real_timestamp(struct ctf_stream_definition *stream, + uint64_t ts_cycles) { - uint64_t ts_nsec; + int64_t ts_nsec; struct ctf_trace *trace = stream->stream_class->trace; - struct trace_collection *tc = trace->collection; - uint64_t tc_offset; + struct trace_collection *tc = trace->parent.collection; + int64_t tc_offset; if (tc->clock_use_offset_avg) tc_offset = tc->single_clock_offset_avg; else - tc_offset = trace->single_clock->offset; + tc_offset = clock_offset_ns(trace->parent.single_clock); - ts_nsec = clock_cycles_to_ns(stream->current_clock, timestamp); + ts_nsec = clock_cycles_to_ns(stream->current_clock, ts_cycles); ts_nsec += tc_offset; /* Add offset */ return ts_nsec; }