src.ctf.fs: remove ctf_fs_ds_index::UP
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 26 Jul 2022 21:25:48 +0000 (17:25 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Tue, 23 Aug 2022 16:06:16 +0000 (12:06 -0400)
We don't need to dynamically allocate ctf_fs_ds_index objects, we can
store / return / pass objects directly.  Remove ctf_fs_ds_index::UP and
update all users.

Change-Id: I7ce9de83b111c782299a1caebea3ead0fd945cb5
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8401
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/plugins/ctf/fs-src/data-stream-file.cpp
src/plugins/ctf/fs-src/data-stream-file.hpp
src/plugins/ctf/fs-src/fs.cpp
src/plugins/ctf/fs-src/query.cpp

index 27a5ce91f389a1b590e23ffb84f19e850255f3d9..c7536d8692d6d444366bcc747ebe3d3aa3668ae6 100644 (file)
@@ -326,7 +326,7 @@ static enum ctf_msg_iter_medium_status medop_group_switch_packet(void *void_data
     struct ctf_fs_ds_group_medops_data *data = (struct ctf_fs_ds_group_medops_data *) void_data;
 
     /* If we have gone through all index entries, we are done. */
-    if (data->next_index_entry_index >= data->ds_file_group->index->entries.size()) {
+    if (data->next_index_entry_index >= data->ds_file_group->index.entries.size()) {
         return CTF_MSG_ITER_MEDIUM_STATUS_EOF;
     }
 
@@ -335,7 +335,7 @@ static enum ctf_msg_iter_medium_status medop_group_switch_packet(void *void_data
      *  for reading.
      */
     ctf_fs_ds_index_entry& index_entry =
-        data->ds_file_group->index->entries[data->next_index_entry_index];
+        data->ds_file_group->index.entries[data->next_index_entry_index];
 
     ctf_msg_iter_medium_status status = ctf_fs_ds_group_medops_set_file(data, &index_entry);
     if (status != CTF_MSG_ITER_MEDIUM_STATUS_OK) {
@@ -358,8 +358,7 @@ enum ctf_msg_iter_medium_status ctf_fs_ds_group_medops_data_create(
 {
     BT_ASSERT(self_msg_iter);
     BT_ASSERT(ds_file_group);
-    BT_ASSERT(ds_file_group->index);
-    BT_ASSERT(!ds_file_group->index->entries.empty());
+    BT_ASSERT(!ds_file_group->index.entries.empty());
 
     out.reset(new ctf_fs_ds_group_medops_data {logCfg});
 
@@ -400,9 +399,9 @@ static int convert_cycles_to_ns(struct ctf_clock_class *clock_class, uint64_t cy
                                                   clock_class->offset_cycles, ns);
 }
 
-static ctf_fs_ds_index::UP build_index_from_idx_file(struct ctf_fs_ds_file *ds_file,
-                                                     struct ctf_fs_ds_file_info *file_info,
-                                                     struct ctf_msg_iter *msg_iter)
+static nonstd::optional<ctf_fs_ds_index>
+build_index_from_idx_file(struct ctf_fs_ds_file *ds_file, struct ctf_fs_ds_file_info *file_info,
+                          struct ctf_msg_iter *msg_iter)
 {
     bt2_common::GCharUP directory;
     bt2_common::GCharUP basename;
@@ -412,7 +411,6 @@ static ctf_fs_ds_index::UP build_index_from_idx_file(struct ctf_fs_ds_file *ds_f
     gsize filesize;
     const char *mmap_begin = NULL, *file_pos = NULL;
     const struct ctf_packet_index_file_hdr *header = NULL;
-    ctf_fs_ds_index::UP index;
     ctf_fs_ds_index_entry *prev_index_entry = NULL;
     bt2_common::DataLen totalPacketsSize = bt2_common::DataLen::fromBytes(0);
     size_t file_index_entry_size;
@@ -427,27 +425,27 @@ static ctf_fs_ds_index::UP build_index_from_idx_file(struct ctf_fs_ds_file *ds_f
     int ret = ctf_msg_iter_get_packet_properties(msg_iter, &props);
     if (ret) {
         BT_CLOGI_STR("Cannot read first packet's header and context fields.");
-        return nullptr;
+        return nonstd::nullopt;
     }
 
     sc = ctf_trace_class_borrow_stream_class_by_id(ds_file->metadata->tc, props.stream_class_id);
     BT_ASSERT(sc);
     if (!sc->default_clock_class) {
         BT_CLOGI_STR("Cannot find stream class's default clock class.");
-        return nullptr;
+        return nonstd::nullopt;
     }
 
     /* Look for index file in relative path index/name.idx. */
     basename.reset(g_path_get_basename(ds_file->file->path.c_str()));
     if (!basename) {
         BT_CLOGE("Cannot get the basename of datastream file %s", ds_file->file->path.c_str());
-        return nullptr;
+        return nonstd::nullopt;
     }
 
     directory.reset(g_path_get_dirname(ds_file->file->path.c_str()));
     if (!directory) {
         BT_CLOGE("Cannot get dirname of datastream file %s", ds_file->file->path.c_str());
-        return nullptr;
+        return nonstd::nullopt;
     }
 
     index_basename = basename.get();
@@ -457,7 +455,7 @@ static ctf_fs_ds_index::UP build_index_from_idx_file(struct ctf_fs_ds_file *ds_f
     mapped_file.reset(g_mapped_file_new(index_file_path.get(), FALSE, NULL));
     if (!mapped_file) {
         BT_CLOGD("Cannot create new mapped file %s", index_file_path.get());
-        return nullptr;
+        return nonstd::nullopt;
     }
 
     /*
@@ -470,7 +468,7 @@ static ctf_fs_ds_index::UP build_index_from_idx_file(struct ctf_fs_ds_file *ds_f
         BT_CLOGW("Invalid LTTng trace index file: "
                  "file size (%zu bytes) < header size (%zu bytes)",
                  filesize, sizeof(*header));
-        return nullptr;
+        return nonstd::nullopt;
     }
 
     mmap_begin = g_mapped_file_get_contents(mapped_file.get());
@@ -479,7 +477,7 @@ static ctf_fs_ds_index::UP build_index_from_idx_file(struct ctf_fs_ds_file *ds_f
     file_pos = g_mapped_file_get_contents(mapped_file.get()) + sizeof(*header);
     if (be32toh(header->magic) != CTF_INDEX_MAGIC) {
         BT_CLOGW_STR("Invalid LTTng trace index: \"magic\" field validation failed");
-        return nullptr;
+        return nonstd::nullopt;
     }
 
     version_major = be32toh(header->index_major);
@@ -488,7 +486,7 @@ static ctf_fs_ds_index::UP build_index_from_idx_file(struct ctf_fs_ds_file *ds_f
         BT_CLOGW("Unknown LTTng trace index version: "
                  "major=%" PRIu32 ", minor=%" PRIu32,
                  version_major, version_minor);
-        return nullptr;
+        return nonstd::nullopt;
     }
 
     file_index_entry_size = be32toh(header->packet_index_len);
@@ -497,7 +495,7 @@ static ctf_fs_ds_index::UP build_index_from_idx_file(struct ctf_fs_ds_file *ds_f
             "Invalid `packet_index_len` in LTTng trace index file (`packet_index_len` < CTF index 1.0 index entry size): "
             "packet_index_len=%zu, CTF_INDEX_1_0_SIZE=%zu",
             file_index_entry_size, CTF_INDEX_1_0_SIZE);
-        return nullptr;
+        return nonstd::nullopt;
     }
 
     file_entry_count = (filesize - sizeof(*header)) / file_index_entry_size;
@@ -506,10 +504,10 @@ static ctf_fs_ds_index::UP build_index_from_idx_file(struct ctf_fs_ds_file *ds_f
                  "(%zu bytes) is not a multiple of the index entry size "
                  "(%zu bytes)",
                  (filesize - sizeof(*header)), sizeof(*header));
-        return nullptr;
+        return nonstd::nullopt;
     }
 
-    index = bt2_common::makeUnique<ctf_fs_ds_index>();
+    ctf_fs_ds_index index;
 
     for (i = 0; i < file_entry_count; i++) {
         struct ctf_packet_index *file_index = (struct ctf_packet_index *) file_pos;
@@ -518,7 +516,7 @@ static ctf_fs_ds_index::UP build_index_from_idx_file(struct ctf_fs_ds_file *ds_f
 
         if (packetSize.hasExtraBits()) {
             BT_CLOGW("Invalid packet size encountered in LTTng trace index file");
-            return nullptr;
+            return nonstd::nullopt;
         }
 
         bt2_common::DataLen offset = bt2_common::DataLen::fromBytes(be64toh(file_index->offset));
@@ -526,7 +524,7 @@ static ctf_fs_ds_index::UP build_index_from_idx_file(struct ctf_fs_ds_file *ds_f
             BT_CLOGW("Invalid, non-monotonic, packet offset encountered in LTTng trace index file: "
                      "previous offset=%llu bytes, current offset=%llu bytes",
                      prev_index_entry->offset.bytes(), offset.bytes());
-            return nullptr;
+            return nonstd::nullopt;
         }
 
         ctf_fs_ds_index_entry index_entry {offset, packetSize};
@@ -541,7 +539,7 @@ static ctf_fs_ds_index::UP build_index_from_idx_file(struct ctf_fs_ds_file *ds_f
                 "Invalid packet time bounds encountered in LTTng trace index file (begin > end): "
                 "timestamp_begin=%" PRIu64 "timestamp_end=%" PRIu64,
                 index_entry.timestamp_begin, index_entry.timestamp_end);
-            return nullptr;
+            return nonstd::nullopt;
         }
 
         /* Convert the packet's bound to nanoseconds since Epoch. */
@@ -550,14 +548,14 @@ static ctf_fs_ds_index::UP build_index_from_idx_file(struct ctf_fs_ds_file *ds_f
         if (ret) {
             BT_CLOGI_STR(
                 "Failed to convert raw timestamp to nanoseconds since Epoch during index parsing");
-            return nullptr;
+            return nonstd::nullopt;
         }
         ret = convert_cycles_to_ns(sc->default_clock_class, index_entry.timestamp_end,
                                    &index_entry.timestamp_end_ns);
         if (ret) {
             BT_CLOGI_STR(
                 "Failed to convert raw timestamp to nanoseconds since Epoch during LTTng trace index parsing");
-            return nullptr;
+            return nonstd::nullopt;
         }
 
         if (version_minor >= 1) {
@@ -567,9 +565,9 @@ static ctf_fs_ds_index::UP build_index_from_idx_file(struct ctf_fs_ds_file *ds_f
         totalPacketsSize += packetSize;
         file_pos += file_index_entry_size;
 
-        index->entries.emplace_back(index_entry);
+        index.entries.emplace_back(index_entry);
 
-        prev_index_entry = &index->entries.back();
+        prev_index_entry = &index.entries.back();
     }
 
     /* Validate that the index addresses the complete stream. */
@@ -577,7 +575,7 @@ static ctf_fs_ds_index::UP build_index_from_idx_file(struct ctf_fs_ds_file *ds_f
         BT_CLOGW("Invalid LTTng trace index file; indexed size != stream file size: "
                  "file-size=%" PRIu64 " bytes, total-packets-size=%llu bytes",
                  ds_file->file->size, totalPacketsSize.bytes());
-        return nullptr;
+        return nonstd::nullopt;
     }
 
     return index;
@@ -625,9 +623,9 @@ static int init_index_entry(ctf_fs_ds_index_entry& entry, struct ctf_fs_ds_file
     return 0;
 }
 
-static ctf_fs_ds_index::UP build_index_from_stream_file(struct ctf_fs_ds_file *ds_file,
-                                                        struct ctf_fs_ds_file_info *file_info,
-                                                        struct ctf_msg_iter *msg_iter)
+static nonstd::optional<ctf_fs_ds_index>
+build_index_from_stream_file(struct ctf_fs_ds_file *ds_file, struct ctf_fs_ds_file_info *file_info,
+                             struct ctf_msg_iter *msg_iter)
 {
     int ret;
     enum ctf_msg_iter_status iter_status = CTF_MSG_ITER_STATUS_OK;
@@ -636,14 +634,14 @@ static ctf_fs_ds_index::UP build_index_from_stream_file(struct ctf_fs_ds_file *d
 
     BT_CLOGI("Indexing stream file %s", ds_file->file->path.c_str());
 
-    ctf_fs_ds_index::UP index = bt2_common::makeUnique<ctf_fs_ds_index>();
+    ctf_fs_ds_index index;
 
     while (true) {
         struct ctf_msg_iter_packet_properties props;
 
         if (currentPacketOffset.bytes() > ds_file->file->size) {
             BT_CLOGE_STR("Unexpected current packet's offset (larger than file).");
-            return nullptr;
+            return nonstd::nullopt;
         } else if (currentPacketOffset.bytes() == ds_file->file->size) {
             /* No more data */
             break;
@@ -651,12 +649,12 @@ static ctf_fs_ds_index::UP build_index_from_stream_file(struct ctf_fs_ds_file *d
 
         iter_status = ctf_msg_iter_seek(msg_iter, currentPacketOffset.bytes());
         if (iter_status != CTF_MSG_ITER_STATUS_OK) {
-            return nullptr;
+            return nonstd::nullopt;
         }
 
         iter_status = ctf_msg_iter_get_packet_properties(msg_iter, &props);
         if (iter_status != CTF_MSG_ITER_STATUS_OK) {
-            return nullptr;
+            return nonstd::nullopt;
         }
 
         /*
@@ -675,7 +673,7 @@ static ctf_fs_ds_index::UP build_index_from_stream_file(struct ctf_fs_ds_file *d
                      "file-size-bytes=%jd",
                      ds_file->file->path.c_str(), currentPacketOffset.bytes(),
                      currentPacketSize.bytes(), (intmax_t) ds_file->file->size);
-            return nullptr;
+            return nonstd::nullopt;
         }
 
         ctf_fs_ds_index_entry index_entry {currentPacketOffset, currentPacketSize};
@@ -685,10 +683,10 @@ static ctf_fs_ds_index::UP build_index_from_stream_file(struct ctf_fs_ds_file *d
 
         ret = init_index_entry(index_entry, ds_file, &props);
         if (ret) {
-            return nullptr;
+            return nonstd::nullopt;
         }
 
-        index->entries.emplace_back(std::move(index_entry));
+        index.entries.emplace_back(std::move(index_entry));
 
         currentPacketOffset += currentPacketSize;
         BT_CLOGD("Seeking to next packet: current-packet-offset-bytes=%llu, "
@@ -723,14 +721,14 @@ ctf_fs_ds_file::UP ctf_fs_ds_file_create(struct ctf_fs_trace *ctf_fs_trace,
 }
 
 BT_HIDDEN
-ctf_fs_ds_index::UP ctf_fs_ds_file_build_index(struct ctf_fs_ds_file *ds_file,
-                                               struct ctf_fs_ds_file_info *file_info,
-                                               struct ctf_msg_iter *msg_iter)
+nonstd::optional<ctf_fs_ds_index> ctf_fs_ds_file_build_index(struct ctf_fs_ds_file *ds_file,
+                                                             struct ctf_fs_ds_file_info *file_info,
+                                                             struct ctf_msg_iter *msg_iter)
 {
-    ctf_fs_ds_index::UP index;
     const bt2_common::LogCfg& logCfg = ds_file->logCfg;
 
-    index = build_index_from_idx_file(ds_file, file_info, msg_iter);
+    nonstd::optional<ctf_fs_ds_index> index =
+        build_index_from_idx_file(ds_file, file_info, msg_iter);
     if (index) {
         return index;
     }
@@ -758,7 +756,7 @@ BT_HIDDEN ctf_fs_ds_file_info::UP ctf_fs_ds_file_info_create(const char *path, i
 BT_HIDDEN ctf_fs_ds_file_group::UP ctf_fs_ds_file_group_create(struct ctf_fs_trace *ctf_fs_trace,
                                                                struct ctf_stream_class *sc,
                                                                uint64_t stream_instance_id,
-                                                               ctf_fs_ds_index::UP index)
+                                                               ctf_fs_ds_index index)
 {
     ctf_fs_ds_file_group::UP ds_file_group {new ctf_fs_ds_file_group};
 
index cdb31c39cd561bbc7f2fd8f5aeaabf2437e754de..200f2693be5ff2e70b476ab58a0da3aad915b194 100644 (file)
@@ -117,8 +117,6 @@ struct ctf_fs_ds_index_entry
 
 struct ctf_fs_ds_index
 {
-    using UP = std::unique_ptr<ctf_fs_ds_index>;
-
     std::vector<ctf_fs_ds_index_entry> entries;
 };
 
@@ -147,7 +145,7 @@ struct ctf_fs_ds_file_group
     /* Weak, belongs to component */
     struct ctf_fs_trace *ctf_fs_trace = nullptr;
 
-    ctf_fs_ds_index::UP index;
+    ctf_fs_ds_index index;
 };
 
 BT_HIDDEN
@@ -156,16 +154,16 @@ ctf_fs_ds_file::UP ctf_fs_ds_file_create(struct ctf_fs_trace *ctf_fs_trace,
                                          const char *path, const bt2_common::LogCfg& logCfg);
 
 BT_HIDDEN
-ctf_fs_ds_index::UP ctf_fs_ds_file_build_index(struct ctf_fs_ds_file *ds_file,
-                                               struct ctf_fs_ds_file_info *ds_file_info,
-                                               struct ctf_msg_iter *msg_iter);
+nonstd::optional<ctf_fs_ds_index>
+ctf_fs_ds_file_build_index(struct ctf_fs_ds_file *ds_file, struct ctf_fs_ds_file_info *ds_file_info,
+                           struct ctf_msg_iter *msg_iter);
 
 BT_HIDDEN ctf_fs_ds_file_info::UP ctf_fs_ds_file_info_create(const char *path, int64_t begin_ns);
 
 BT_HIDDEN ctf_fs_ds_file_group::UP ctf_fs_ds_file_group_create(struct ctf_fs_trace *ctf_fs_trace,
                                                                struct ctf_stream_class *sc,
                                                                uint64_t stream_instance_id,
-                                                               ctf_fs_ds_index::UP index);
+                                                               ctf_fs_ds_index index);
 
 /*
  * Medium operations to iterate on a single ctf_fs_ds_file.
index c28c2ae10302eb4982691b2ef5136500e3611779..7f44acb9b5a832387376784df1ce2ab60cc30a1f 100644 (file)
@@ -431,9 +431,9 @@ static void ds_index_insert_ds_index_entry_sorted(struct ctf_fs_ds_index *index,
     }
 }
 
-static void merge_ctf_fs_ds_indexes(struct ctf_fs_ds_index *dest, ctf_fs_ds_index::UP src)
+static void merge_ctf_fs_ds_indexes(struct ctf_fs_ds_index *dest, ctf_fs_ds_index src)
 {
-    for (const ctf_fs_ds_index_entry& entry : src->entries) {
+    for (const ctf_fs_ds_index_entry& entry : src.entries) {
         ds_index_insert_ds_index_entry_sorted(dest, entry);
     }
 }
@@ -445,7 +445,6 @@ static int add_ds_file_to_ds_file_group(struct ctf_fs_trace *ctf_fs_trace, const
     struct ctf_fs_ds_file_group *ds_file_group = NULL;
     ctf_fs_ds_file_group::UP new_ds_file_group;
     ctf_fs_ds_file_info::UP ds_file_info;
-    ctf_fs_ds_index::UP index;
     ctf_msg_iter_up msg_iter;
     struct ctf_stream_class *sc = NULL;
     struct ctf_msg_iter_packet_properties props;
@@ -500,7 +499,8 @@ static int add_ds_file_to_ds_file_group(struct ctf_fs_trace *ctf_fs_trace, const
         return -1;
     }
 
-    index = ctf_fs_ds_file_build_index(ds_file.get(), ds_file_info.get(), msg_iter.get());
+    nonstd::optional<ctf_fs_ds_index> index =
+        ctf_fs_ds_file_build_index(ds_file.get(), ds_file_info.get(), msg_iter.get());
     if (!index) {
         BT_CLOGE_APPEND_CAUSE("Failed to index CTF stream file \'%s\'",
                               ds_file->file->path.c_str());
@@ -525,7 +525,7 @@ static int add_ds_file_to_ds_file_group(struct ctf_fs_trace *ctf_fs_trace, const
          * group.
          */
         new_ds_file_group =
-            ctf_fs_ds_file_group_create(ctf_fs_trace, sc, UINT64_C(-1), std::move(index));
+            ctf_fs_ds_file_group_create(ctf_fs_trace, sc, UINT64_C(-1), std::move(*index));
 
         if (!new_ds_file_group) {
             return -1;
@@ -549,7 +549,7 @@ static int add_ds_file_to_ds_file_group(struct ctf_fs_trace *ctf_fs_trace, const
 
     if (!ds_file_group) {
         new_ds_file_group =
-            ctf_fs_ds_file_group_create(ctf_fs_trace, sc, stream_instance_id, std::move(index));
+            ctf_fs_ds_file_group_create(ctf_fs_trace, sc, stream_instance_id, std::move(*index));
         if (!new_ds_file_group) {
             return -1;
         }
@@ -557,7 +557,7 @@ static int add_ds_file_to_ds_file_group(struct ctf_fs_trace *ctf_fs_trace, const
         ds_file_group = new_ds_file_group.get();
         ctf_fs_trace->ds_file_groups.emplace_back(std::move(new_ds_file_group));
     } else {
-        merge_ctf_fs_ds_indexes(ds_file_group->index.get(), std::move(index));
+        merge_ctf_fs_ds_indexes(&ds_file_group->index, std::move(*index));
     }
 
     ds_file_group_insert_ds_file_info_sorted(ds_file_group, std::move(ds_file_info));
@@ -792,7 +792,7 @@ static void merge_ctf_fs_ds_file_groups(struct ctf_fs_ds_file_group *dest,
     }
 
     /* Merge both indexes. */
-    merge_ctf_fs_ds_indexes(dest->index.get(), std::move(src->index));
+    merge_ctf_fs_ds_indexes(&dest->index, std::move(src->index));
 }
 
 /* Merge src_trace's data stream file groups into dest_trace's. */
@@ -852,11 +852,9 @@ static int merge_matching_ctf_fs_ds_file_groups(struct ctf_fs_trace *dest_trace,
                                                            src_group->sc->id);
             BT_ASSERT(sc);
 
-            ctf_fs_ds_index::UP index = bt2_common::makeUnique<ctf_fs_ds_index>();
             ctf_fs_ds_file_group::UP new_dest_group =
-                ctf_fs_ds_file_group_create(dest_trace, sc, src_group->stream_id, std::move(index));
+                ctf_fs_ds_file_group_create(dest_trace, sc, src_group->stream_id, {});
             /* Ownership of index is transferred. */
-            index = NULL;
             if (!new_dest_group) {
                 return -1;
             }
@@ -1056,10 +1054,9 @@ static int fix_index_lttng_event_after_packet_bug(struct ctf_fs_trace *trace)
 
     for (ctf_fs_ds_file_group::UP& ds_file_group : trace->ds_file_groups) {
         struct ctf_clock_class *default_cc;
-        struct ctf_fs_ds_index *index;
 
         BT_ASSERT(ds_file_group);
-        index = ds_file_group->index.get();
+        ctf_fs_ds_index *index = &ds_file_group->index;
 
         BT_ASSERT(index);
         BT_ASSERT(!index->entries.empty());
@@ -1125,7 +1122,7 @@ static int fix_index_barectf_event_before_packet_bug(struct ctf_fs_trace *trace)
 
     for (ctf_fs_ds_file_group::UP& ds_file_group : trace->ds_file_groups) {
         struct ctf_clock_class *default_cc;
-        struct ctf_fs_ds_index *index = ds_file_group->index.get();
+        ctf_fs_ds_index *index = &ds_file_group->index;
 
         BT_ASSERT(index);
         BT_ASSERT(!index->entries.empty());
@@ -1187,10 +1184,9 @@ static int fix_index_lttng_crash_quirk(struct ctf_fs_trace *trace)
 
     for (ctf_fs_ds_file_group::UP& ds_file_group : trace->ds_file_groups) {
         struct ctf_clock_class *default_cc;
-        struct ctf_fs_ds_index *index;
 
         BT_ASSERT(ds_file_group);
-        index = ds_file_group->index.get();
+        ctf_fs_ds_index *index = &ds_file_group->index;
 
         BT_ASSERT(ds_file_group->sc->default_clock_class);
         default_cc = ds_file_group->sc->default_clock_class;
index bb5079433b4b0a232e05a2b7d0cc6dd6b70b0faf..7d662e38589439da7113ee0fc0e3561306227705 100644 (file)
@@ -112,14 +112,13 @@ static void populate_stream_info(struct ctf_fs_ds_file_group *group, bt2::MapVal
      * the timestamp_begin of the first index entry and the timestamp_end
      * of the last index entry.
      */
-    BT_ASSERT(group->index);
-    BT_ASSERT(!group->index->entries.empty());
+    BT_ASSERT(!group->index.entries.empty());
 
     /* First entry. */
-    const ctf_fs_ds_index_entry& first_ds_index_entry = group->index->entries.front();
+    const ctf_fs_ds_index_entry& first_ds_index_entry = group->index.entries.front();
 
     /* Last entry. */
-    const ctf_fs_ds_index_entry& last_ds_index_entry = group->index->entries.back();
+    const ctf_fs_ds_index_entry& last_ds_index_entry = group->index.entries.back();
 
     stream_range->begin_ns = first_ds_index_entry.timestamp_begin_ns;
     stream_range->end_ns = last_ds_index_entry.timestamp_end_ns;
This page took 0.034892 seconds and 5 git commands to generate.