From e1d200e5b48cebd7d76ed823396bf33373e0249b Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Tue, 9 Apr 2024 16:46:55 -0400 Subject: [PATCH] src.ctf.fs: pass clkClsCfg to ctf_fs_component constructor Change-Id: I3a9d696780d044505d273a28804915bf2f9e9c16 Reviewed-on: https://review.lttng.org/c/babeltrace/+/8422 Reviewed-by: Philippe Proulx Reviewed-on: https://review.lttng.org/c/babeltrace/+/12357 CI-Build: Simon Marchi Tested-by: jenkins --- src/plugins/ctf/fs-src/fs.cpp | 8 +++----- src/plugins/ctf/fs-src/fs.hpp | 6 ++++-- src/plugins/ctf/fs-src/query.cpp | 4 +--- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/plugins/ctf/fs-src/fs.cpp b/src/plugins/ctf/fs-src/fs.cpp index b028893a..02cf97df 100644 --- a/src/plugins/ctf/fs-src/fs.cpp +++ b/src/plugins/ctf/fs-src/fs.cpp @@ -1578,11 +1578,9 @@ static ctf_fs_component::UP ctf_fs_create(const bt2::ConstMapValue params, bt_self_component_source *self_comp_src) { bt_self_component *self_comp = bt_self_component_source_as_self_component(self_comp_src); - ctf_fs_component::UP ctf_fs = bt2s::make_unique( - bt2c::Logger {bt2::SelfSourceComponent {self_comp_src}, "PLUGIN/SRC.CTF.FS/COMP"}); - const auto parameters = read_src_fs_parameters(params, ctf_fs->logger); - - ctf_fs->clkClsCfg = parameters.clkClsCfg; + const bt2c::Logger logger {bt2::SelfSourceComponent {self_comp_src}, "PLUGIN/SRC.CTF.FS/COMP"}; + const auto parameters = read_src_fs_parameters(params, logger); + auto ctf_fs = bt2s::make_unique(parameters.clkClsCfg, logger); if (ctf_fs_component_create_ctf_fs_trace( ctf_fs.get(), parameters.inputs, diff --git a/src/plugins/ctf/fs-src/fs.hpp b/src/plugins/ctf/fs-src/fs.hpp index 9add53da..c9ca2a90 100644 --- a/src/plugins/ctf/fs-src/fs.hpp +++ b/src/plugins/ctf/fs-src/fs.hpp @@ -74,8 +74,10 @@ struct ctf_fs_component { using UP = std::unique_ptr; - explicit ctf_fs_component(const bt2c::Logger& parentLogger) noexcept : - logger {parentLogger, "PLUGIN/SRC.CTF.FS/COMP"} + explicit ctf_fs_component(const ctf::src::ClkClsCfg& clkClsCfgParam, + const bt2c::Logger& parentLogger) noexcept : + logger {parentLogger, "PLUGIN/SRC.CTF.FS/COMP"}, + clkClsCfg {clkClsCfgParam} { } diff --git a/src/plugins/ctf/fs-src/query.cpp b/src/plugins/ctf/fs-src/query.cpp index a7225dda..34679310 100644 --- a/src/plugins/ctf/fs-src/query.cpp +++ b/src/plugins/ctf/fs-src/query.cpp @@ -167,10 +167,8 @@ static void populate_trace_info(const struct ctf_fs_trace *trace, const bt2::Map bt2::Value::Shared trace_infos_query(const bt2::ConstMapValue params, const bt2c::Logger& logger) { - ctf_fs_component ctf_fs {logger}; const auto parameters = read_src_fs_parameters(params, logger); - - ctf_fs.clkClsCfg = parameters.clkClsCfg; + ctf_fs_component ctf_fs {parameters.clkClsCfg, logger}; if (ctf_fs_component_create_ctf_fs_trace( &ctf_fs, parameters.inputs, -- 2.34.1