bt2::Value::Shared trace_infos_query(const bt2::ConstMapValue params, const bt2c::Logger& logger)
{
- ctf_fs_component::UP ctf_fs = ctf_fs_component_create(logger);
- if (!ctf_fs) {
- BT_CPPLOGE_APPEND_CAUSE_AND_THROW_SPEC(logger, bt2::Error,
- "Cannot create ctf_fs_component");
- }
-
+ ctf_fs_component ctf_fs {logger};
const bt_value *inputs_value = NULL;
const bt_value *trace_name_value;
- if (!read_src_fs_parameters(params.libObjPtr(), &inputs_value, &trace_name_value,
- ctf_fs.get())) {
+ if (!read_src_fs_parameters(params.libObjPtr(), &inputs_value, &trace_name_value, &ctf_fs)) {
BT_CPPLOGE_APPEND_CAUSE_AND_THROW_SPEC(logger, bt2::Error, "Failed to read parameters");
}
- if (ctf_fs_component_create_ctf_fs_trace(ctf_fs.get(), inputs_value, trace_name_value, NULL)) {
+ if (ctf_fs_component_create_ctf_fs_trace(&ctf_fs, inputs_value, trace_name_value, NULL)) {
BT_CPPLOGE_APPEND_CAUSE_AND_THROW_SPEC(logger, bt2::Error, "Failed to create trace");
}
const auto result = bt2::ArrayValue::create();
const auto traceInfo = result->appendEmptyMap();
- populate_trace_info(ctf_fs->trace.get(), traceInfo, logger);
+ populate_trace_info(ctf_fs.trace.get(), traceInfo, logger);
return result;
}