From: Francis Deslauriers Date: Fri, 14 Jun 2019 21:14:41 +0000 (-0400) Subject: ctf: index: set `beginning` and `end` clock snapshot X-Git-Tag: v2.0.0-rc1~243 X-Git-Url: https://git.efficios.com/?a=commitdiff_plain;h=c2f376997bb70c7c4261f3c416cd76f97864989d;p=babeltrace.git ctf: index: set `beginning` and `end` clock snapshot Currently only the timestamps since origin are set when creating the index from the stream files. Signed-off-by: Francis Deslauriers Change-Id: I3a0cf2c0004deb4a2663cff91932fa33aea9cbb9 Reviewed-on: https://review.lttng.org/c/babeltrace/+/1438 Tested-by: jenkins Reviewed-by: Philippe Proulx --- diff --git a/src/plugins/ctf/fs-src/data-stream-file.c b/src/plugins/ctf/fs-src/data-stream-file.c index 352efa89..6ddb8a34 100644 --- a/src/plugins/ctf/fs-src/data-stream-file.c +++ b/src/plugins/ctf/fs-src/data-stream-file.c @@ -495,6 +495,8 @@ int init_index_entry(struct ctf_fs_ds_index_entry *entry, entry->packet_size = packet_size; if (props->snapshots.beginning_clock != UINT64_C(-1)) { + entry->timestamp_begin = props->snapshots.beginning_clock; + /* Convert the packet's bound to nanoseconds since Epoch. */ ret = convert_cycles_to_ns(sc->default_clock_class, props->snapshots.beginning_clock, @@ -504,10 +506,14 @@ int init_index_entry(struct ctf_fs_ds_index_entry *entry, goto end; } } else { + entry->timestamp_begin = UINT64_C(-1); entry->timestamp_begin_ns = UINT64_C(-1); } if (props->snapshots.end_clock != UINT64_C(-1)) { + entry->timestamp_end = props->snapshots.end_clock; + + /* Convert the packet's bound to nanoseconds since Epoch. */ ret = convert_cycles_to_ns(sc->default_clock_class, props->snapshots.end_clock, &entry->timestamp_end_ns); @@ -516,6 +522,7 @@ int init_index_entry(struct ctf_fs_ds_index_entry *entry, goto end; } } else { + entry->timestamp_end = UINT64_C(-1); entry->timestamp_end_ns = UINT64_C(-1); }