From a263021c7b3cf7e563cb55b3985b46248320a545 Mon Sep 17 00:00:00 2001 From: Julien Desfossez Date: Mon, 23 Jan 2017 15:37:32 -0500 Subject: [PATCH] Add the verbose parameter to the legacy text options MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Julien Desfossez Signed-off-by: Jérémie Galarneau --- converter/babeltrace-cfg.c | 12 +++++++++++- plugins/text/text.c | 8 ++++++++ plugins/text/text.h | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/converter/babeltrace-cfg.c b/converter/babeltrace-cfg.c index f3625c3b..7c688316 100644 --- a/converter/babeltrace-cfg.c +++ b/converter/babeltrace-cfg.c @@ -130,6 +130,7 @@ struct text_legacy_opts { bool clock_date; bool clock_gmt; bool dbg_info_full_path; + bool verbose; }; /* Legacy input format format */ @@ -186,7 +187,7 @@ bool text_legacy_opts_is_any_set(struct text_legacy_opts *opts) bt_value_array_size(opts->names) > 0 || bt_value_array_size(opts->fields) > 0 || opts->no_delta || opts->clock_cycles || opts->clock_seconds || - opts->clock_date || opts->clock_gmt || + opts->clock_date || opts->clock_gmt || opts->verbose || opts->dbg_info_full_path; } @@ -1325,6 +1326,12 @@ struct bt_value *params_from_text_legacy_opts( goto error; } + if (bt_value_map_insert_bool(params, "verbose", + text_legacy_opts->verbose)) { + print_err_oom(); + goto error; + } + if (insert_flat_names_fields_from_array(params, text_legacy_opts->names, "name")) { goto error; @@ -1755,6 +1762,8 @@ void print_output_legacy_to_sinks( text_legacy_opts->clock_date); g_string_append_bool_param(str, "clock-gmt", text_legacy_opts->clock_gmt); + g_string_append_bool_param(str, "verbose", + text_legacy_opts->verbose); ret = append_prefixed_flag_params(str, text_legacy_opts->names, "name"); if (ret) { @@ -3754,6 +3763,7 @@ struct bt_config *bt_config_convert_from_args(int argc, const char *argv[], BT_PUT(cfg); goto end; case OPT_VERBOSE: + text_legacy_opts.verbose = true; cfg->verbose = true; break; case OPT_DEBUG: diff --git a/plugins/text/text.c b/plugins/text/text.c index 163f3c2c..44887b6f 100644 --- a/plugins/text/text.c +++ b/plugins/text/text.c @@ -54,6 +54,7 @@ const char *plugin_options[] = { "clock-seconds", "clock-date", "clock-gmt", + "verbose", "name-default", /* show/hide */ "name-payload", "name-context", @@ -417,6 +418,13 @@ enum bt_component_status apply_params(struct text_component *text, } text->options.clock_gmt = value; + value = false; /* Default. */ + ret = apply_one_bool("verbose", params, &value, NULL); + if (ret != BT_COMPONENT_STATUS_OK) { + goto end; + } + text->options.verbose = value; + /* Names. */ ret = apply_one_string("name-default", params, &str); if (ret != BT_COMPONENT_STATUS_OK) { diff --git a/plugins/text/text.h b/plugins/text/text.h index 3816fb19..ed4ad3e8 100644 --- a/plugins/text/text.h +++ b/plugins/text/text.h @@ -70,8 +70,8 @@ struct text_options { bool clock_date; bool clock_gmt; bool debug_info_full_path; - enum text_color_option color; + bool verbose; }; struct text_component { -- 2.34.1