const char *plugin_options[] = {
"color",
"output-path",
- "debug-info-dir",
- "debug-info-target-prefix",
- "debug-info-full-path",
"no-delta",
"clock-cycles",
"clock-seconds",
}
}
g_free(pretty->options.output_path);
- g_free(pretty->options.debug_info_dir);
- g_free(pretty->options.debug_info_target_prefix);
g_free(pretty);
}
break;
case BT_NOTIFICATION_TYPE_EVENT:
{
- struct bt_ctf_event *event = bt_notification_event_get_event(
- notification);
-
- if (!event) {
- ret = BT_COMPONENT_STATUS_ERROR;
- goto end;
- }
- ret = pretty_print_event(pretty, event);
- bt_put(event);
+ ret = pretty_print_event(pretty, notification);
if (ret != BT_COMPONENT_STATUS_OK) {
goto end;
}
}
BT_HIDDEN
-enum bt_component_status pretty_accept_port_connection(
+void pretty_port_connected(
struct bt_private_component *component,
struct bt_private_port *self_port,
struct bt_port *other_port)
{
- enum bt_component_status ret = BT_COMPONENT_STATUS_OK;
struct bt_private_connection *connection;
struct pretty_component *pretty;
bt_private_connection_create_notification_iterator(connection);
if (!pretty->input_iterator) {
- ret = BT_COMPONENT_STATUS_ERROR;
+ pretty->error = true;
}
bt_put(connection);
- return ret;
}
BT_HIDDEN
bt_private_component_get_user_data(component);
enum bt_notification_iterator_status it_ret;
- it = pretty->input_iterator;
+ if (unlikely(pretty->error)) {
+ ret = BT_COMPONENT_STATUS_ERROR;
+ goto end;
+ }
+ it = pretty->input_iterator;
it_ret = bt_notification_iterator_next(it);
+
switch (it_ret) {
case BT_NOTIFICATION_ITERATOR_STATUS_ERROR:
ret = BT_COMPONENT_STATUS_ERROR;
notification = bt_notification_iterator_get_notification(it);
assert(notification);
ret = handle_notification(pretty, notification);
- pretty->processed_first_event = true;
end:
bt_put(notification);
return ret;
goto end;
}
- ret = apply_one_string("debug-info-dir",
- params,
- &pretty->options.debug_info_dir);
- if (ret != BT_COMPONENT_STATUS_OK) {
- goto end;
- }
-
- ret = apply_one_string("debug-info-target-prefix",
- params,
- &pretty->options.debug_info_target_prefix);
- if (ret != BT_COMPONENT_STATUS_OK) {
- goto end;
- }
-
- value = false; /* Default. */
- ret = apply_one_bool("debug-info-full-path", params, &value, NULL);
- if (ret != BT_COMPONENT_STATUS_OK) {
- goto end;
- }
- pretty->options.debug_info_full_path = value;
-
value = false; /* Default. */
ret = apply_one_bool("no-delta", params, &value, NULL);
if (ret != BT_COMPONENT_STATUS_OK) {