src.ctf.fs: pass path to ctf_fs_ds_index_entry constructor
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 6 Dec 2023 21:31:48 +0000 (21:31 +0000)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 17 Apr 2024 17:57:53 +0000 (13:57 -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>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12361
Tested-by: jenkins <jenkins@lttng.org>
src/plugins/ctf/fs-src/data-stream-file.cpp
src/plugins/ctf/fs-src/data-stream-file.hpp

index e4bebf9f68015af8147928f1d3046ff2fcafd3ef..22aa309f93df6244727a48e2926e113cf3d59c1a 100644 (file)
@@ -506,11 +506,7 @@ build_index_from_idx_file(struct ctf_fs_ds_file *ds_file, struct ctf_fs_ds_file_
             return bt2s::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) {
@@ -656,10 +652,7 @@ build_index_from_stream_file(struct ctf_fs_ds_file *ds_file, struct ctf_fs_ds_fi
             return bt2s::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, currentPacketOffset, currentPacketSize};
 
         int ret = init_index_entry(index_entry, ds_file, &props);
         if (ret) {
index e00a5cc43831447b9819cea817657b5434e01792..05a6db13538049d4ab194dd0695e03fa9a3f852e 100644 (file)
@@ -78,15 +78,15 @@ struct ctf_fs_ds_file
 
 struct ctf_fs_ds_index_entry
 {
-    explicit ctf_fs_ds_index_entry(const bt2c::DataLen offsetParam,
-                                   const bt2c::DataLen packetSizeParam) noexcept :
-        offset(offsetParam),
-        packetSize(packetSizeParam)
+    ctf_fs_ds_index_entry(const bt2c::CStringView pathParam, const bt2c::DataLen offsetParam,
+                          const bt2c::DataLen packetSizeParam) noexcept :
+        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. */
     bt2c::DataLen offset;
This page took 0.025629 seconds and 4 git commands to generate.