cli: make `--clock-force-correlate` use `force-clock-class-origin-unix-epoch`
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Thu, 19 Sep 2019 21:39:07 +0000 (17:39 -0400)
committerFrancis Deslauriers <francis.deslauriers@efficios.com>
Fri, 20 Sep 2019 19:11:35 +0000 (15:11 -0400)
The flt.utils.muxer's `assume-absolute-clock-classes` parameter will be
removed in a subsequent commit.

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Change-Id: I282576ad778eefd40e1d57266f3af2a880ceca47
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2071
Tested-by: jenkins <jenkins@lttng.org>
src/cli/babeltrace2-cfg-cli-args.c
tests/cli/convert/test_convert_args

index 0f33f86a824340fed12e8d9857003afabae967aa..fa1c1f54ee3ffb908e755ac31c258fce7a6e7dd8 100644 (file)
@@ -2148,6 +2148,8 @@ void print_convert_usage(FILE *fp)
        fprintf(fp, "\n");
        fprintf(fp, "Implicit `source.ctf.fs` component options:\n");
        fprintf(fp, "\n");
+       fprintf(fp, "      --clock-force-correlate       Force the origin of all clocks\n");
+       fprintf(fp, "                                    to the Unix epoch\n");
        fprintf(fp, "      --clock-offset=SEC            Set clock offset to SEC seconds\n");
        fprintf(fp, "      --clock-offset-ns=NS          Set clock offset to NS ns\n");
        fprintf(fp, "\n");
@@ -2175,11 +2177,6 @@ void print_convert_usage(FILE *fp)
        fprintf(fp, "  -w, --output=PATH                 Write output text to PATH instead of\n");
        fprintf(fp, "                                    the standard output\n");
        fprintf(fp, "\n");
-       fprintf(fp, "Implicit `filter.utils.muxer` component options:\n");
-       fprintf(fp, "\n");
-       fprintf(fp, "      --clock-force-correlate       Assume that clocks are inherently\n");
-       fprintf(fp, "                                    correlated across traces\n");
-       fprintf(fp, "\n");
        fprintf(fp, "Implicit `filter.utils.trimmer` component options:\n");
        fprintf(fp, "\n");
        fprintf(fp, "  -b, --begin=BEGIN                 Set the beginning time of the conversion\n");
@@ -3229,6 +3226,7 @@ struct bt_config *bt_config_convert_from_args(int argc, const char *argv[],
        const char *auto_source_discovery_restrict_plugin_name = NULL;
        const char *auto_source_discovery_restrict_component_class_name = NULL;
 
+       bool ctf_fs_source_force_clock_class_unix_epoch_origin = false;
        gchar *ctf_fs_source_clock_class_offset_arg = NULL;
        gchar *ctf_fs_source_clock_class_offset_ns_arg = NULL;
        *retcode = 0;
@@ -3701,9 +3699,7 @@ struct bt_config *bt_config_convert_from_args(int argc, const char *argv[],
                        implicit_text_args.exists = true;
                        break;
                case OPT_CLOCK_FORCE_CORRELATE:
-                       append_implicit_component_param(
-                               &implicit_muxer_args,
-                               "assume-absolute-clock-classes", "yes");
+                       ctf_fs_source_force_clock_class_unix_epoch_origin = true;
                        break;
                case OPT_CLOCK_GMT:
                        append_implicit_component_param(
@@ -4112,6 +4108,23 @@ struct bt_config *bt_config_convert_from_args(int argc, const char *argv[],
                }
        }
 
+
+       /*
+        * If --clock-force-correlated was given, apply it to any src.ctf.fs
+        * component.
+        */
+       if (ctf_fs_source_force_clock_class_unix_epoch_origin) {
+               int n;
+
+               n = append_multiple_implicit_components_param(
+                       discovered_source_args, "source.ctf.fs", "force-clock-class-origin-unix-epoch",
+                       "yes");
+               if (n == 0) {
+                       BT_CLI_LOGE_APPEND_CAUSE("--clock-force-correlate specified, but no source.ctf.fs component instantiated.");
+                       goto error;
+               }
+       }
+
        /* If --clock-offset was given, apply it to any src.ctf.fs component. */
        if (ctf_fs_source_clock_class_offset_arg) {
                int n;
index c59e41a7612788e185d38334424bf8a6284a7483..f7fbeb1ca0a14ea659f839cccd65607782966e09 100755 (executable)
@@ -117,7 +117,7 @@ test_bt_convert_run_args 'path non-option arg + --begin --end' "$path_to_trace -
 test_bt_convert_run_args 'path non-option arg + --timerange' "$path_to_trace --timerange=[abc,xyz]" "--component auto-disc-source-ctf-fs:source.ctf.fs --params 'inputs=[\"$path_to_trace\"]' --component pretty:sink.text.pretty --component muxer:filter.utils.muxer --component trimmer:filter.utils.trimmer --params 'begin=\"abc\"' --params 'end=\"xyz\"' --connect auto-disc-source-ctf-fs:muxer --connect muxer:trimmer --connect trimmer:pretty"
 test_bt_convert_run_args 'path non-option arg + --clock-cycles' "$path_to_trace --clock-cycles" "--component auto-disc-source-ctf-fs:source.ctf.fs --params 'inputs=[\"$path_to_trace\"]' --component pretty:sink.text.pretty --params clock-cycles=yes --component muxer:filter.utils.muxer --connect auto-disc-source-ctf-fs:muxer --connect muxer:pretty"
 test_bt_convert_run_args 'path non-option arg + --clock-date' "$path_to_trace --clock-date" "--component auto-disc-source-ctf-fs:source.ctf.fs --params 'inputs=[\"$path_to_trace\"]' --component pretty:sink.text.pretty --params clock-date=yes --component muxer:filter.utils.muxer --connect auto-disc-source-ctf-fs:muxer --connect muxer:pretty"
-test_bt_convert_run_args 'path non-option arg + --clock-force-correlate' "$path_to_trace --clock-force-correlate" "--component auto-disc-source-ctf-fs:source.ctf.fs --params 'inputs=[\"$path_to_trace\"]' --component pretty:sink.text.pretty --component muxer:filter.utils.muxer --params assume-absolute-clock-classes=yes --connect auto-disc-source-ctf-fs:muxer --connect muxer:pretty"
+test_bt_convert_run_args 'path non-option arg + --clock-force-correlate' "$path_to_trace --clock-force-correlate" "--component auto-disc-source-ctf-fs:source.ctf.fs --params force-clock-class-origin-unix-epoch=yes --params 'inputs=[\"$path_to_trace\"]' --component pretty:sink.text.pretty --component muxer:filter.utils.muxer --connect auto-disc-source-ctf-fs:muxer --connect muxer:pretty"
 test_bt_convert_run_args 'path non-option arg + --clock-gmt' "$path_to_trace --clock-gmt" "--component auto-disc-source-ctf-fs:source.ctf.fs --params 'inputs=[\"$path_to_trace\"]' --component pretty:sink.text.pretty --params clock-gmt=yes --component muxer:filter.utils.muxer --connect auto-disc-source-ctf-fs:muxer --connect muxer:pretty"
 test_bt_convert_run_args 'path non-option arg + --clock-offset' "$path_to_trace --clock-offset=15487" "--component auto-disc-source-ctf-fs:source.ctf.fs --params clock-class-offset-s=15487 --params 'inputs=[\"$path_to_trace\"]' --component pretty:sink.text.pretty --component muxer:filter.utils.muxer --connect auto-disc-source-ctf-fs:muxer --connect muxer:pretty"
 test_bt_convert_run_args 'path non-option arg + --clock-offset-ns' "$path_to_trace --clock-offset-ns=326159487" "--component auto-disc-source-ctf-fs:source.ctf.fs --params clock-class-offset-ns=326159487 --params 'inputs=[\"$path_to_trace\"]' --component pretty:sink.text.pretty --component muxer:filter.utils.muxer --connect auto-disc-source-ctf-fs:muxer --connect muxer:pretty"
This page took 0.027658 seconds and 4 git commands to generate.