Add the verbose parameter to the legacy text options
authorJulien Desfossez <jdesfossez@efficios.com>
Mon, 23 Jan 2017 20:37:32 +0000 (15:37 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 28 May 2017 16:57:38 +0000 (12:57 -0400)
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
converter/babeltrace-cfg.c
plugins/text/text.c
plugins/text/text.h

index f3625c3bdfc3ac77e135bc33386000aa83663700..7c6883163d030f7d470162d1fb76afc633ceb328 100644 (file)
@@ -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:
index 163f3c2ced15c68f20a33f11eb602998cfe7fda1..44887b6fe11498470cac076f4d4deb9661a70318 100644 (file)
@@ -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) {
index 3816fb1999facb69737eef091f2d739b8d9b577d..ed4ad3e86d0b0b723a6523731c825fdc2f55ac82 100644 (file)
@@ -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 {
This page took 0.027092 seconds and 4 git commands to generate.