2 * Copyright (C) 2013 Julien Desfossez <jdesfossez@efficios.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License Version 2 as
6 * published by the Free Software Foundation;
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 #include <lib/babeltrace/ctf/types.h>
22 #include <lib/babeltrace/ctf-ir/metadata.h>
23 #include <lib/babeltrace/clock-internal.h>
24 #include <lib/babeltrace/ctf/ctf-index.h>
26 /* Copied from babeltrace/formats/ctf/events-private.h */
28 uint64_t ctf_get_real_timestamp(struct ctf_stream_definition
*stream
,
32 struct ctf_trace
*trace
= stream
->stream_class
->trace
;
33 struct trace_collection
*tc
= trace
->parent
.collection
;
36 if (tc
->clock_use_offset_avg
)
37 tc_offset
= tc
->single_clock_offset_avg
;
39 tc_offset
= trace
->parent
.single_clock
->offset
;
41 ts_nsec
= clock_cycles_to_ns(stream
->current_clock
, timestamp
);
42 ts_nsec
+= tc_offset
; /* Add offset */
This page took 0.031883 seconds and 4 git commands to generate.