src.ctf.fs: remove ctf_fs_ds_index_create
authorSimon Marchi <simon.marchi@efficios.com>
Fri, 10 Jun 2022 16:56:48 +0000 (12:56 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Tue, 23 Aug 2022 16:06:16 +0000 (12:06 -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>
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 88614d5731ab79b0ba6909a484e061a7ef533314..c2e5266ca5d5ba87c2378adb6055cf6e50de16db 100644 (file)
@@ -569,10 +569,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(ds_file->logCfg);
-    if (!index) {
-        goto error;
-    }
+    index = bt2_common::makeUnique<ctf_fs_ds_index>();
 
     for (i = 0; i < file_entry_count; i++) {
         struct ctf_packet_index *file_index = (struct ctf_packet_index *) file_pos;
@@ -711,17 +708,13 @@ 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;
     bt2_common::DataLen currentPacketOffset = bt2_common::DataLen::fromBytes(0);
     const bt2_common::LogCfg& logCfg = ds_file->logCfg;
 
     BT_CLOGI("Indexing stream file %s", ds_file->file->path.c_str());
 
-    index = ctf_fs_ds_index_create(logCfg);
-    if (!index) {
-        goto error;
-    }
+    ctf_fs_ds_index::UP index = bt2_common::makeUnique<ctf_fs_ds_index>();
 
     while (true) {
         ctf_fs_ds_index_entry::UP index_entry;
@@ -844,12 +837,6 @@ end:
     return index;
 }
 
-BT_HIDDEN
-ctf_fs_ds_index::UP ctf_fs_ds_index_create(const bt2_common::LogCfg& logCfg)
-{
-    return bt2_common::makeUnique<ctf_fs_ds_index>();
-}
-
 ctf_fs_ds_file::~ctf_fs_ds_file()
 {
     (void) ds_file_munmap(this);
index 9caaec6589a72c121dfae89aad2a95e47628d02f..a9b18ac108574e9aec0310160a80a5660e1120df 100644 (file)
@@ -162,9 +162,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);
 
-BT_HIDDEN
-ctf_fs_ds_index::UP ctf_fs_ds_index_create(const bt2_common::LogCfg& logCfg);
-
 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,
index 52bf33435f070ce6486d171fc99bb80ccb4363e7..61a078f901b3a94e2d9b638bd14e18924fbe5f9f 100644 (file)
@@ -922,12 +922,7 @@ 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 = ctf_fs_ds_index_create(dest_trace->logCfg);
-            if (!index) {
-                ret = -1;
-                goto end;
-            }
-
+            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));
             /* Ownership of index is transferred. */
This page took 0.027641 seconds and 5 git commands to generate.