uint64_t capacity, uint64_t *count)
{
try {
- bt_message_iterator_class_next_method_status status;
struct ctf_fs_msg_iter_data *msg_iter_data =
(struct ctf_fs_msg_iter_data *) bt_self_message_iterator_get_data(iterator);
uint64_t i = 0;
* it now.
*/
BT_CURRENT_THREAD_MOVE_ERROR_AND_RESET(msg_iter_data->next_saved_error);
- status = msg_iter_data->next_saved_status;
- goto end;
+ return msg_iter_data->next_saved_status;
}
+ bt_message_iterator_class_next_method_status status;
+
do {
status = ctf_fs_iterator_next_one(msg_iter_data, &msgs[i]);
if (status == BT_MESSAGE_ITERATOR_CLASS_NEXT_METHOD_STATUS_OK) {
status = BT_MESSAGE_ITERATOR_CLASS_NEXT_METHOD_STATUS_OK;
}
-end:
return status;
return status;
} catch (const std::bad_alloc&) {
{
try {
struct ctf_fs_port_data *port_data;
- bt_message_iterator_class_initialize_method_status status;
enum ctf_msg_iter_medium_status medium_status;
port_data = (struct ctf_fs_port_data *) bt_self_component_port_get_data(
if (medium_status != CTF_MSG_ITER_MEDIUM_STATUS_OK) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(msg_iter_data->logger,
"Failed to create ctf_fs_ds_group_medops");
- status = ctf_msg_iter_medium_status_to_msg_iter_initialize_status(medium_status);
- goto error;
+ return ctf_msg_iter_medium_status_to_msg_iter_initialize_status(medium_status);
}
msg_iter_data->msg_iter = ctf_msg_iter_create(
if (!msg_iter_data->msg_iter) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(msg_iter_data->logger,
"Cannot create a CTF message iterator.");
- status = BT_MESSAGE_ITERATOR_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR;
- goto error;
+ return BT_MESSAGE_ITERATOR_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR;
}
/*
bt_self_message_iterator_set_data(self_msg_iter, msg_iter_data.release());
- status = BT_MESSAGE_ITERATOR_CLASS_INITIALIZE_METHOD_STATUS_OK;
- goto end;
-
-error:
- bt_self_message_iterator_set_data(self_msg_iter, NULL);
-
-end:
- return status;
+ return BT_MESSAGE_ITERATOR_CLASS_INITIALIZE_METHOD_STATUS_OK;
} catch (const std::bad_alloc&) {
return BT_MESSAGE_ITERATOR_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR;
} catch (const bt2::Error&) {
struct ctf_fs_ds_file_group *ds_file_group,
bt_self_component_source *self_comp_src)
{
- int ret = 0;
- ctf_fs_port_data::UP port_data;
-
const auto port_name = ctf_fs_make_port_name(ds_file_group);
+ auto port_data = bt2s::make_unique<ctf_fs_port_data>();
+
BT_CPPLOGI_SPEC(ctf_fs->logger, "Creating one port named `{}`", port_name);
- /* Create output port for this file */
- port_data = bt2s::make_unique<ctf_fs_port_data>();
port_data->ctf_fs = ctf_fs;
port_data->ds_file_group = ds_file_group;
- ret = bt_self_component_source_add_output_port(self_comp_src, port_name.c_str(),
- port_data.get(), NULL);
+
+ int ret = bt_self_component_source_add_output_port(self_comp_src, port_name.c_str(),
+ port_data.get(), NULL);
if (ret) {
- goto error;
+ return ret;
}
ctf_fs->port_data.emplace_back(std::move(port_data));
- goto end;
-
-error:
- ret = -1;
-
-end:
- return ret;
+ return 0;
}
static int create_ports_for_trace(struct ctf_fs_component *ctf_fs,
struct ctf_fs_trace *ctf_fs_trace,
bt_self_component_source *self_comp_src)
{
- int ret = 0;
-
/* Create one output port for each stream file group */
for (const auto& ds_file_group : ctf_fs_trace->ds_file_groups) {
- ret = create_one_port_for_trace(ctf_fs, ds_file_group.get(), self_comp_src);
+ int ret = create_one_port_for_trace(ctf_fs, ds_file_group.get(), self_comp_src);
if (ret) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(ctf_fs->logger, "Cannot create output port.");
- goto end;
+ return ret;
}
}
-end:
- return ret;
+ return 0;
}
/*
int64_t begin_ns = -1;
struct ctf_fs_ds_file_group *ds_file_group = NULL;
ctf_fs_ds_file_group::UP new_ds_file_group;
- int ret;
ctf_fs_ds_file_info::UP ds_file_info;
ctf_fs_ds_index::UP index;
ctf_msg_iter_up msg_iter;
const auto ds_file =
ctf_fs_ds_file_create(ctf_fs_trace, bt2::Stream::Shared {}, path, ctf_fs_trace->logger);
if (!ds_file) {
- goto error;
+ return -1;
}
/* Create a temporary iterator to read the ds_file. */
ctf_fs_ds_file_medops, ds_file.get(), nullptr, ctf_fs_trace->logger);
if (!msg_iter) {
BT_CPPLOGE_STR_SPEC(ctf_fs_trace->logger, "Cannot create a CTF message iterator.");
- goto error;
+ return -1;
}
ctf_msg_iter_set_dry_run(msg_iter.get(), true);
- ret = ctf_msg_iter_get_packet_properties(msg_iter.get(), &props);
+ int ret = ctf_msg_iter_get_packet_properties(msg_iter.get(), &props);
if (ret) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(
ctf_fs_trace->logger,
"Cannot get stream file's first packet's header and context fields (`{}`).", path);
- goto error;
+ return ret;
}
sc = ctf_trace_class_borrow_stream_class_by_id(ds_file->metadata->tc, props.stream_class_id);
BT_CPPLOGE_APPEND_CAUSE_SPEC(
ctf_fs_trace->logger,
"Cannot convert clock cycles to nanoseconds from origin (`{}`).", path);
- goto error;
+ return ret;
}
}
ds_file_info = ctf_fs_ds_file_info_create(path, begin_ns);
if (!ds_file_info) {
- goto error;
+ return -1;
}
index = ctf_fs_ds_file_build_index(ds_file.get(), ds_file_info.get(), msg_iter.get());
if (!index) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(ctf_fs_trace->logger, "Failed to index CTF stream file \'{}\'",
ds_file->file->path);
- goto error;
+ return -1;
}
if (begin_ns == -1) {
ctf_fs_ds_file_group_create(ctf_fs_trace, sc, UINT64_C(-1), std::move(index));
if (!new_ds_file_group) {
- goto error;
+ return -1;
}
ds_file_group_insert_ds_file_info_sorted(new_ds_file_group.get(), std::move(ds_file_info));
ctf_fs_trace->ds_file_groups.emplace_back(std::move(new_ds_file_group));
- goto end;
+ return 0;
}
BT_ASSERT(stream_instance_id != -1);
new_ds_file_group =
ctf_fs_ds_file_group_create(ctf_fs_trace, sc, stream_instance_id, std::move(index));
if (!new_ds_file_group) {
- goto error;
+ return -1;
}
ds_file_group = new_ds_file_group.get();
ds_file_group_insert_ds_file_info_sorted(ds_file_group, std::move(ds_file_info));
- goto end;
-
-error:
- ret = -1;
-
-end:
- return ret;
+ return 0;
}
static int create_ds_file_groups(struct ctf_fs_trace *ctf_fs_trace)
{
- int ret = 0;
const char *basename;
GError *error = NULL;
BT_CPPLOGE_APPEND_CAUSE_SPEC(ctf_fs_trace->logger,
"Cannot open directory `{}`: {} (code {})", ctf_fs_trace->path,
error->message, error->code);
- goto error;
+ if (error) {
+ g_error_free(error);
+ }
+ return -1;
}
while ((basename = g_dir_read_name(dir.get()))) {
continue;
}
- ret = ctf_fs_file_open(&file, "rb");
+ int ret = ctf_fs_file_open(&file, "rb");
if (ret) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(ctf_fs_trace->logger, "Cannot open stream file `{}`",
file.path);
- goto error;
+ return ret;
}
if (file.size == 0) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(ctf_fs_trace->logger,
"Cannot add stream file `{}` to stream file group",
file.path);
- goto error;
+ return ret;
}
}
- goto end;
-
-error:
- ret = -1;
-
-end:
- if (error) {
- g_error_free(error);
- }
-
- return ret;
+ return 0;
}
static int set_trace_name(bt_trace *trace, const char *name_suffix)
{
- int ret = 0;
const bt_value *val;
std::string name;
name += name_suffix;
}
- ret = bt_trace_set_name(trace, name.c_str());
- if (ret) {
- goto end;
- }
-
- goto end;
-
-end:
- return ret;
+ return bt_trace_set_name(trace, name.c_str());
}
static ctf_fs_trace::UP ctf_fs_trace_create(const char *path, const char *name,
bt_self_component *selfComp,
const bt2c::Logger& parentLogger)
{
- int ret;
- ctf_fs_trace::UP ctf_fs_trace {new struct ctf_fs_trace(parentLogger)};
-
+ ctf_fs_trace::UP ctf_fs_trace = bt2s::make_unique<struct ctf_fs_trace>(parentLogger);
ctf_fs_trace->path = path;
ctf_fs_trace->metadata = bt2s::make_unique<ctf_fs_metadata>();
- ret = ctf_fs_metadata_set_trace_class(selfComp, ctf_fs_trace.get(), clkClsCfg);
+ int ret = ctf_fs_metadata_set_trace_class(selfComp, ctf_fs_trace.get(), clkClsCfg);
if (ret) {
- goto error;
+ return nullptr;
}
if (ctf_fs_trace->metadata->trace_class) {
bt_trace *trace = bt_trace_create(ctf_fs_trace->metadata->trace_class->libObjPtr());
if (!trace) {
- goto error;
+ return nullptr;
}
ctf_fs_trace->trace = bt2::Trace::Shared::createWithoutRef(trace);
ret = ctf_trace_class_configure_ir_trace(ctf_fs_trace->metadata->tc,
ctf_fs_trace->trace->libObjPtr());
if (ret) {
- goto error;
+ return nullptr;
}
ret = set_trace_name(ctf_fs_trace->trace->libObjPtr(), name);
if (ret) {
- goto error;
+ return nullptr;
}
}
ret = create_ds_file_groups(ctf_fs_trace.get());
if (ret) {
- goto error;
+ return nullptr;
}
- goto end;
-
-error:
- ctf_fs_trace.reset();
-
-end:
return ctf_fs_trace;
}
bt2c::GStringUP norm_path {bt_common_normalize_path(path_param, NULL)};
if (!norm_path) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(ctf_fs->logger, "Failed to normalize path: `{}`.", path_param);
- goto error;
+ return -1;
}
ret = path_is_ctf_trace(norm_path->str);
if (ret < 0) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(
ctf_fs->logger, "Failed to check if path is a CTF trace: path={}", norm_path->str);
- goto error;
+ return ret;
} else if (ret == 0) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(
ctf_fs->logger, "Path is not a CTF trace (does not contain a metadata file): `{}`.",
norm_path->str);
- goto error;
+ return -1;
}
// FIXME: Remove or ifdef for __MINGW32__
if (strcmp(norm_path->str, "/") == 0) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(ctf_fs->logger, "Opening a trace in `/` is not supported.");
- ret = -1;
- goto end;
+ return -1;
}
ctf_fs_trace = ctf_fs_trace_create(norm_path->str, trace_name, ctf_fs->clkClsCfg, selfComp,
if (!ctf_fs_trace) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(ctf_fs->logger, "Cannot create trace for `{}`.",
norm_path->str);
- goto error;
+ return -1;
}
traces.emplace_back(std::move(ctf_fs_trace));
- ret = 0;
- goto end;
-
-error:
- ret = -1;
-
-end:
- return ret;
+ return 0;
}
/*
{
std::vector<ctf_fs_ds_file_group::UP>& dest = dest_trace->ds_file_groups;
std::vector<ctf_fs_ds_file_group::UP>& src = src_trace->ds_file_groups;
- int ret = 0;
/*
* Save the initial length of dest: we only want to check against the
bt2s::make_unique<ctf_fs_ds_index>());
if (!new_dest_group) {
- ret = -1;
- goto end;
+ return -1;
}
dest_group = new_dest_group.get();
merge_ctf_fs_ds_file_groups(dest_group, std::move(src_group));
}
-end:
- return ret;
+ return 0;
}
/*
unsigned int winner_count;
struct ctf_fs_trace *winner;
guint i, winner_i;
- int ret = 0;
BT_ASSERT(traces.size() >= 2);
}
/* Merge trace's data stream file groups into winner's. */
- ret = merge_matching_ctf_fs_ds_file_groups(winner, std::move(trace));
+ int ret = merge_matching_ctf_fs_ds_file_groups(winner, std::move(trace));
if (ret) {
- goto end;
+ return ret;
}
}
*/
out_trace = std::move(traces[winner_i]);
-end:
- return ret;
+ return 0;
}
enum target_event
{
enum ctf_msg_iter_status iter_status = CTF_MSG_ITER_STATUS_OK;
ctf_msg_iter_up msg_iter;
- int ret = 0;
BT_ASSERT(ctf_fs_trace);
BT_ASSERT(index_entry);
index_entry->path, ctf_fs_trace->logger);
if (!ds_file) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(ctf_fs_trace->logger, "Failed to create a ctf_fs_ds_file");
- ret = -1;
- goto end;
+ return -1;
}
BT_ASSERT(ctf_fs_trace->metadata);
ctf_fs_ds_file_medops, ds_file.get(), NULL, ctf_fs_trace->logger);
if (!msg_iter) {
/* ctf_msg_iter_create() logs errors. */
- ret = -1;
- goto end;
+ return -1;
}
/*
iter_status = ctf_msg_iter_seek(msg_iter.get(), index_entry->offset.bytes());
if (iter_status) {
/* ctf_msg_iter_seek() logs errors. */
- ret = -1;
- goto end;
+ return -1;
}
switch (target_event) {
bt_common_abort();
}
if (iter_status) {
- ret = -1;
- goto end;
+ return -1;
}
/* Convert clock snapshot to timestamp. */
- ret = bt_util_clock_cycles_to_ns_from_origin(
+ int ret = bt_util_clock_cycles_to_ns_from_origin(
*cs, default_cc->frequency, default_cc->offset_seconds, default_cc->offset_cycles, ts_ns);
if (ret) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(ctf_fs_trace->logger,
"Failed to convert clock snapshot to timestamp");
- goto end;
+ return ret;
}
-end:
- return ret;
+ return 0;
}
static int decode_packet_first_event_timestamp(struct ctf_fs_trace *ctf_fs_trace,
*/
static int fix_index_lttng_event_after_packet_bug(struct ctf_fs_trace *trace)
{
- int ret = 0;
-
for (const auto& ds_file_group : trace->ds_file_groups) {
struct ctf_clock_class *default_cc;
* Decode packet to read the timestamp of the last event of the
* entry.
*/
- ret = decode_packet_last_event_timestamp(trace, default_cc, last_entry,
- &last_entry->timestamp_end,
- &last_entry->timestamp_end_ns);
+ int ret = decode_packet_last_event_timestamp(trace, default_cc, last_entry,
+ &last_entry->timestamp_end,
+ &last_entry->timestamp_end_ns);
if (ret) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(
trace->logger,
"Failed to decode stream's last packet to get its last event's clock snapshot.");
- goto end;
+ return ret;
}
}
-end:
- return ret;
+ return 0;
}
/*
*/
static int fix_index_barectf_event_before_packet_bug(struct ctf_fs_trace *trace)
{
- int ret = 0;
-
for (const auto& ds_file_group : trace->ds_file_groups) {
struct ctf_clock_class *default_cc;
const auto index = ds_file_group->index.get();
* 2. Set the current entry `begin` timestamp to the
* timestamp of the first event of the current packet.
*/
- ret = decode_packet_first_event_timestamp(trace, default_cc, curr_entry,
- &curr_entry->timestamp_begin,
- &curr_entry->timestamp_begin_ns);
+ int ret = decode_packet_first_event_timestamp(trace, default_cc, curr_entry,
+ &curr_entry->timestamp_begin,
+ &curr_entry->timestamp_begin_ns);
if (ret) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(trace->logger,
"Failed to decode first event's clock snapshot");
- goto end;
+ return ret;
}
/*
prev_entry->timestamp_end_ns = curr_entry->timestamp_begin_ns;
}
}
-end:
- return ret;
+
+ return 0;
}
/*
*/
static int fix_index_lttng_crash_quirk(struct ctf_fs_trace *trace)
{
- int ret = 0;
-
for (const auto& ds_file_group : trace->ds_file_groups) {
struct ctf_clock_class *default_cc;
* Decode packet to read the timestamp of the
* last event of the stream file.
*/
- ret = decode_packet_last_event_timestamp(trace, default_cc, last_entry,
- &last_entry->timestamp_end,
- &last_entry->timestamp_end_ns);
+ int ret = decode_packet_last_event_timestamp(trace, default_cc, last_entry,
+ &last_entry->timestamp_end,
+ &last_entry->timestamp_end_ns);
if (ret) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(trace->logger,
"Failed to decode last event's clock snapshot");
- goto end;
+ return ret;
}
}
}
}
-end:
- return ret;
+ return 0;
}
/*
*/
static int extract_tracer_info(struct ctf_fs_trace *trace, struct tracer_info *current_tracer_info)
{
- int ret = 0;
struct ctf_trace_class_env_entry *entry;
/* Clear the current_tracer_info struct */
*/
entry = ctf_trace_class_borrow_env_entry_by_name(trace->metadata->tc, "tracer_name");
if (!entry || entry->type != CTF_TRACE_CLASS_ENV_ENTRY_TYPE_STR) {
- goto missing_bare_minimum;
+ return -1;
}
/* Set tracer name. */
entry = ctf_trace_class_borrow_env_entry_by_name(trace->metadata->tc, "tracer_major");
if (!entry || entry->type != CTF_TRACE_CLASS_ENV_ENTRY_TYPE_INT) {
- goto missing_bare_minimum;
+ return -1;
}
/* Set major version number. */
entry = ctf_trace_class_borrow_env_entry_by_name(trace->metadata->tc, "tracer_minor");
if (!entry || entry->type != CTF_TRACE_CLASS_ENV_ENTRY_TYPE_INT) {
- goto end;
+ return 0;
}
/* Set minor version number. */
}
if (!entry || entry->type != CTF_TRACE_CLASS_ENV_ENTRY_TYPE_INT) {
- goto end;
+ return 0;
}
/* Set patch version number. */
current_tracer_info->patch = entry->value.i;
- goto end;
-
-missing_bare_minimum:
- ret = -1;
-end:
- return ret;
+ return 0;
}
static bool is_tracer_affected_by_lttng_event_after_packet_bug(struct tracer_info *curr_tracer_info)
*/
static int fix_packet_index_tracer_bugs(ctf_fs_trace *trace)
{
- int ret = 0;
struct tracer_info current_tracer_info;
- ret = extract_tracer_info(trace, ¤t_tracer_info);
+ int ret = extract_tracer_info(trace, ¤t_tracer_info);
if (ret) {
/*
* A trace may not have all the necessary environment
* are needed. Failing to extract these entries is not
* an error.
*/
- ret = 0;
BT_CPPLOGI_STR_SPEC(
trace->logger,
"Cannot extract tracer information necessary to compare with buggy versions.");
- goto end;
+ return 0;
}
/* Check if the trace may be affected by old tracer bugs. */
if (ret) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(trace->logger,
"Failed to fix LTTng event-after-packet bug.");
- goto end;
+ return ret;
}
trace->metadata->tc->quirks.lttng_event_after_packet = true;
}
if (ret) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(trace->logger,
"Failed to fix barectf event-before-packet bug.");
- goto end;
+ return ret;
}
trace->metadata->tc->quirks.barectf_event_before_packet = true;
}
if (ret) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(trace->logger,
"Failed to fix lttng-crash timestamp quirks.");
- goto end;
+ return ret;
}
trace->metadata->tc->quirks.lttng_crash = true;
}
-end:
- return ret;
+ return 0;
}
static bool compare_ds_file_groups_by_first_path(const ctf_fs_ds_file_group::UP& ds_file_group_a,
const bt_value *trace_name_value,
bt_self_component *selfComp)
{
- int ret = 0;
std::vector<std::string> paths;
std::vector<ctf_fs_trace::UP> traces;
const char *trace_name;
/* Create a separate ctf_fs_trace object for each path. */
for (const auto& path : paths) {
- ret = ctf_fs_component_create_ctf_fs_trace_one_path(ctf_fs, path.c_str(), trace_name,
- traces, selfComp);
+ int ret = ctf_fs_component_create_ctf_fs_trace_one_path(ctf_fs, path.c_str(), trace_name,
+ traces, selfComp);
if (ret) {
- goto end;
+ return ret;
}
}
ctf_fs->logger,
"Multiple traces given, but a trace does not have a UUID: path={}",
this_trace->path);
- goto error;
+ return -1;
}
if (bt_uuid_compare(first_trace_uuid, this_trace_uuid) != 0) {
"trace-uuid={}, trace-path={}",
first_trace_uuid_str, first_trace->path,
this_trace_uuid_str, this_trace->path);
- goto error;
+ return -1;
}
}
- ret = merge_ctf_fs_traces(std::move(traces), ctf_fs->trace);
+ int ret = merge_ctf_fs_traces(std::move(traces), ctf_fs->trace);
if (ret) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(ctf_fs->logger,
"Failed to merge traces with the same UUID.");
- goto error;
+ return ret;
}
} else {
/* Just one trace, it may or may not have a UUID, both are fine. */
ctf_fs->trace = std::move(traces[0]);
}
- ret = fix_packet_index_tracer_bugs(ctf_fs->trace.get());
+ int ret = fix_packet_index_tracer_bugs(ctf_fs->trace.get());
if (ret) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(ctf_fs->logger, "Failed to fix packet index tracer bugs.");
+ return ret;
}
/*
*/
std::sort(ctf_fs->trace->ds_file_groups.begin(), ctf_fs->trace->ds_file_groups.end(),
compare_ds_file_groups_by_first_path);
- goto end;
-
-error:
- ret = -1;
-end:
- return ret;
+ return 0;
}
static const std::string&
static int create_streams_for_trace(struct ctf_fs_trace *ctf_fs_trace)
{
- int ret;
-
for (const auto& ds_file_group : ctf_fs_trace->ds_file_groups) {
const std::string& name = get_stream_instance_unique_name(ds_file_group.get());
"Cannot create stream for DS file group: "
"addr={}, stream-name=\"{}\"",
fmt::ptr(ds_file_group), name);
- goto error;
+ return -1;
}
ds_file_group->stream = bt2::Stream::Shared::createWithoutRef(stream);
- ret = bt_stream_set_name(ds_file_group->stream->libObjPtr(), name.c_str());
+ int ret = bt_stream_set_name(ds_file_group->stream->libObjPtr(), name.c_str());
if (ret) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(ctf_fs_trace->logger,
"Cannot set stream's name: "
"addr={}, stream-name=\"{}\"",
fmt::ptr(ds_file_group->stream->libObjPtr()), name);
- goto error;
+ return ret;
}
}
- ret = 0;
- goto end;
-
-error:
- ret = -1;
-
-end:
- return ret;
+ return 0;
}
static const bt_param_validation_value_descr inputs_elem_descr =
bool read_src_fs_parameters(const bt_value *params, const bt_value **inputs,
const bt_value **trace_name, struct ctf_fs_component *ctf_fs)
{
- bool ret;
const bt_value *value;
enum bt_param_validation_status validate_value_status;
gchar *error = NULL;
validate_value_status = bt_param_validation_validate(params, fs_params_entries_descr, &error);
if (validate_value_status != BT_PARAM_VALIDATION_STATUS_OK) {
BT_CPPLOGE_APPEND_CAUSE_SPEC(ctf_fs->logger, "{}", error);
- ret = false;
- goto end;
+ g_free(error);
+ return false;
}
/* inputs parameter */
/* trace-name parameter */
*trace_name = bt_value_map_borrow_entry_value_const(params, "trace-name");
- ret = true;
-
-end:
- g_free(error);
- return ret;
+ return true;
}
static ctf_fs_component::UP ctf_fs_create(const bt_value *params,