ctf: index: set `beginning` and `end` clock snapshot
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Fri, 14 Jun 2019 21:14:41 +0000 (17:14 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 16 Aug 2019 15:35:50 +0000 (11:35 -0400)
Currently only the timestamps since origin are set when creating the
index from the stream files.

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Change-Id: I3a0cf2c0004deb4a2663cff91932fa33aea9cbb9
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1438
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/plugins/ctf/fs-src/data-stream-file.c

index 352efa89711facfff163105bb4f601c0d631a217..6ddb8a34d0f861c921cde8fe3c50161e818a0902 100644 (file)
@@ -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);
        }
 
This page took 0.029438 seconds and 4 git commands to generate.