src.ctf.fs: remove ctf_fs_ds_index_create
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 5 Dec 2023 05:43:19 +0000 (05:43 +0000)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 17 Apr 2024 17:57:53 +0000 (13:57 -0400)
Remove ctf_fs_ds_index_create, since it's now just a wrapper around
constructing a ctf_fs_ds_index.

Change-Id: Ia256fde3286f3f77a514835806f8862678e02359
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8308
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12335
Tested-by: jenkins <jenkins@lttng.org>
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

index e85c854ee08e13b7813d2bcf9b44940c972147fa..fc07e9dc4e20bf5d1f82f849d6a03fd844ec971b 100644 (file)
@@ -561,10 +561,7 @@ static ctf_fs_ds_index::UP build_index_from_idx_file(struct ctf_fs_ds_file *ds_f
         goto error;
     }
 
-    index = ctf_fs_ds_index_create();
-    if (!index) {
-        goto error;
-    }
+    index = bt2s::make_unique<ctf_fs_ds_index>();
 
     for (i = 0; i < file_entry_count; i++) {
         struct ctf_packet_index *file_index = (struct ctf_packet_index *) file_pos;
@@ -712,16 +709,12 @@ static ctf_fs_ds_index::UP build_index_from_stream_file(struct ctf_fs_ds_file *d
                                                         struct ctf_msg_iter *msg_iter)
 {
     int ret;
-    ctf_fs_ds_index::UP index;
     enum ctf_msg_iter_status iter_status = CTF_MSG_ITER_STATUS_OK;
     auto currentPacketOffset = bt2c::DataLen::fromBytes(0);
 
     BT_CPPLOGI_SPEC(ds_file->logger, "Indexing stream file {}", ds_file->file->path);
 
-    index = ctf_fs_ds_index_create();
-    if (!index) {
-        goto error;
-    }
+    ctf_fs_ds_index::UP index = bt2s::make_unique<ctf_fs_ds_index>();
 
     while (true) {
         struct ctf_msg_iter_packet_properties props;
@@ -843,11 +836,6 @@ end:
     return index;
 }
 
-ctf_fs_ds_index::UP ctf_fs_ds_index_create()
-{
-    return bt2s::make_unique<ctf_fs_ds_index>();
-}
-
 ctf_fs_ds_file::~ctf_fs_ds_file()
 {
     (void) ds_file_munmap(this);
index b9e37198074c1c81a2527bbe75da528e1ad62208..e5418ced7d5897ec2be66dec06a73838dcc4c40f 100644 (file)
@@ -155,8 +155,6 @@ 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);
 
-ctf_fs_ds_index::UP ctf_fs_ds_index_create();
-
 ctf_fs_ds_file_info::UP ctf_fs_ds_file_info_create(const char *path, int64_t begin_ns);
 
 ctf_fs_ds_file_group::UP ctf_fs_ds_file_group_create(struct ctf_fs_trace *ctf_fs_trace,
index 8f6e2c8a128d9dba9ee25c8df893485ed1dfdf48..65e9e64442886c68fdcade83c2e37913a234fa10 100644 (file)
@@ -898,14 +898,8 @@ static int merge_matching_ctf_fs_ds_file_groups(struct ctf_fs_trace *dest_trace,
                                                            src_group->sc->id);
             BT_ASSERT(sc);
 
-            auto index = ctf_fs_ds_index_create();
-            if (!index) {
-                ret = -1;
-                goto end;
-            }
-
-            auto new_dest_group =
-                ctf_fs_ds_file_group_create(dest_trace, sc, src_group->stream_id, std::move(index));
+            auto new_dest_group = ctf_fs_ds_file_group_create(dest_trace, sc, src_group->stream_id,
+                                                              bt2s::make_unique<ctf_fs_ds_index>());
 
             if (!new_dest_group) {
                 ret = -1;
This page took 0.026651 seconds and 4 git commands to generate.