From: Simon Marchi Date: Tue, 5 Dec 2023 05:43:19 +0000 (+0000) Subject: src.ctf.fs: remove ctf_fs_ds_index_create X-Git-Url: https://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=19d9bb236e80a20c05ed81f9df2c2448b44fdfd4 src.ctf.fs: remove ctf_fs_ds_index_create 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 Reviewed-on: https://review.lttng.org/c/babeltrace/+/8308 Reviewed-by: Philippe Proulx Reviewed-on: https://review.lttng.org/c/babeltrace/+/12335 Tested-by: jenkins --- diff --git a/src/plugins/ctf/fs-src/data-stream-file.cpp b/src/plugins/ctf/fs-src/data-stream-file.cpp index e85c854e..fc07e9dc 100644 --- a/src/plugins/ctf/fs-src/data-stream-file.cpp +++ b/src/plugins/ctf/fs-src/data-stream-file.cpp @@ -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(); 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(); 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_file::~ctf_fs_ds_file() { (void) ds_file_munmap(this); diff --git a/src/plugins/ctf/fs-src/data-stream-file.hpp b/src/plugins/ctf/fs-src/data-stream-file.hpp index b9e37198..e5418ced 100644 --- a/src/plugins/ctf/fs-src/data-stream-file.hpp +++ b/src/plugins/ctf/fs-src/data-stream-file.hpp @@ -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, diff --git a/src/plugins/ctf/fs-src/fs.cpp b/src/plugins/ctf/fs-src/fs.cpp index 8f6e2c8a..65e9e644 100644 --- a/src/plugins/ctf/fs-src/fs.cpp +++ b/src/plugins/ctf/fs-src/fs.cpp @@ -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()); if (!new_dest_group) { ret = -1;