sink.text.dmesg: remove `read-from-stdin` parameter, use absent `path`
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 5 Oct 2017 04:15:23 +0000 (00:15 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 2 Nov 2017 19:54:14 +0000 (15:54 -0400)
We don't need separate `path` and `read-from-stdin` parameters for
this component class: if `path` is absent, read from standard input.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
cli/babeltrace-log.c
plugins/text/dmesg/dmesg.c

index 2ff48ca69e03ce40b409a8b366e335066df05672..9037dd93f87bb0eeaab26d37e61518bec2b6e82f 100644 (file)
@@ -122,8 +122,6 @@ int main(int argc, char *argv[])
                "--component",
                "dmesg:src.text.dmesg",
                "--params",
-               "read-from-stdin=yes",
-               "--params",
                NULL, /* no-extract-timestamp=? placeholder */
                "--component",
                "ctf:sink.ctf.fs",
@@ -144,12 +142,12 @@ int main(int argc, char *argv[])
        }
 
        if (no_extract_ts) {
-               bt_argv[7] = "no-extract-timestamp=yes";
+               bt_argv[5] = "no-extract-timestamp=yes";
        } else {
-               bt_argv[7] = "no-extract-timestamp=no";
+               bt_argv[5] = "no-extract-timestamp=no";
        }
 
-       bt_argv[13] = output_path;
+       bt_argv[11] = output_path;
        (void) g_spawn_sync(NULL, bt_argv, NULL,
                G_SPAWN_CHILD_INHERITS_STDIN, NULL, NULL,
                NULL, NULL, &retcode, &error);
index f1a4324fef78d32d65642c0fe3bdbfff53145141..c126a15ad83613dd477f0e6d0a7f8cf651216873 100644 (file)
@@ -413,21 +413,6 @@ int handle_params(struct dmesg_component *dmesg_comp, struct bt_value *params)
        const char *path_str;
        int ret = 0;
 
-       read_from_stdin = bt_value_map_get(params, "read-from-stdin");
-       if (read_from_stdin) {
-               if (!bt_value_is_bool(read_from_stdin)) {
-                       BT_LOGE("Expecting a boolean value for the `read-from-stdin` parameter: "
-                               "type=%s",
-                               bt_value_type_string(
-                                       bt_value_get_type(read_from_stdin)));
-                       goto error;
-               }
-
-               ret = bt_value_bool_get(read_from_stdin,
-                       &dmesg_comp->params.read_from_stdin);
-               assert(ret == 0);
-       }
-
        no_timestamp = bt_value_map_get(params, "no-extract-timestamp");
        if (no_timestamp) {
                if (!bt_value_is_bool(no_timestamp)) {
@@ -462,10 +447,7 @@ int handle_params(struct dmesg_component *dmesg_comp, struct bt_value *params)
                assert(ret == 0);
                g_string_assign(dmesg_comp->params.path, path_str);
        } else {
-               if (!dmesg_comp->params.read_from_stdin) {
-                       BT_LOGE_STR("Expecting `path` parameter or true `read-from-stdin` parameter.");
-                       goto error;
-               }
+               dmesg_comp->params.read_from_stdin = true;
        }
 
        goto end;
This page took 0.02571 seconds and 4 git commands to generate.