src.ctf.fs: pass path to ctf_fs_ds_index_entry constructor
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 21 Jun 2022 19:53:47 +0000 (15:53 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Tue, 23 Aug 2022 16:06:16 +0000 (12:06 -0400)
Change-Id: Id8c29f502cc126775e2ded67813a6f8714f06705
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8436
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

index e5b9791b8f482d1f25949859f71d72c12fbf889d..9e56a0f0e6d470a341cc03635f63b2b4644bdef2 100644 (file)
@@ -516,11 +516,7 @@ build_index_from_idx_file(struct ctf_fs_ds_file *ds_file, struct ctf_fs_ds_file_
             return nonstd::nullopt;
         }
 
-        ctf_fs_ds_index_entry index_entry {offset, packetSize};
-
-        /* Set path to stream file. */
-        index_entry.path = file_info->path.c_str();
-
+        ctf_fs_ds_index_entry index_entry {file_info->path.c_str(), offset, packetSize};
         index_entry.timestamp_begin = be64toh(file_index->timestamp_begin);
         index_entry.timestamp_end = be64toh(file_index->timestamp_end);
         if (index_entry.timestamp_end < index_entry.timestamp_begin) {
@@ -662,10 +658,8 @@ build_index_from_stream_file(struct ctf_fs_ds_file *ds_file, struct ctf_fs_ds_fi
             return nonstd::nullopt;
         }
 
-        ctf_fs_ds_index_entry index_entry {currentPacketOffset, currentPacketSize};
-
-        /* Set path to stream file. */
-        index_entry.path = file_info->path.c_str();
+        ctf_fs_ds_index_entry index_entry {file_info->path.c_str(), currentPacketOffset,
+                                           currentPacketSize};
 
         int ret = init_index_entry(index_entry, ds_file, &props);
         if (ret) {
index e1e7aa59307ee8f847dfdc4826fdc76ff576d95b..37dc18739aa11d03b7dea69f1f83f0fdaf61fd0d 100644 (file)
@@ -83,13 +83,15 @@ struct ctf_fs_ds_file
 
 struct ctf_fs_ds_index_entry
 {
-    ctf_fs_ds_index_entry(bt2_common::DataLen offsetParam, bt2_common::DataLen packetSizeParam) :
-        offset(offsetParam), packetSize(packetSizeParam)
+    ctf_fs_ds_index_entry(const char *pathParam, bt2_common::DataLen offsetParam,
+                          bt2_common::DataLen packetSizeParam) :
+        path {pathParam},
+        offset {offsetParam}, packetSize {packetSizeParam}
     {
     }
 
     /* Weak, belongs to ctf_fs_ds_file_info. */
-    const char *path = nullptr;
+    const char *path;
 
     /* Position of the packet from the beginning of the file. */
     bt2_common::DataLen offset;
This page took 0.02827 seconds and 5 git commands to generate.