X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fload.c;h=8fa718ed522fced8bdb942c92f26be0f6b366360;hp=a0f5e1d65befd4f5990def4bd91acd948c6dd3f5;hb=fe559816ac5b48739c91eccdeeaee8ccde6eacc4;hpb=1b08cbce538eedab5682d174c012903d128c216f diff --git a/src/bin/lttng/commands/load.c b/src/bin/lttng/commands/load.c index a0f5e1d65..8fa718ed5 100644 --- a/src/bin/lttng/commands/load.c +++ b/src/bin/lttng/commands/load.c @@ -30,6 +30,7 @@ #include "../command.h" static char *opt_input_path; +static char *opt_override_url; static int opt_force; static int opt_load_all; @@ -50,6 +51,7 @@ static struct poptOption load_opts[] = { {"all", 'a', POPT_ARG_NONE, 0, OPT_ALL, 0, 0}, {"input-path", 'i', POPT_ARG_STRING, &opt_input_path, 0, 0, 0}, {"force", 'f', POPT_ARG_NONE, 0, OPT_FORCE, 0, 0}, + {"override-url",'U', POPT_ARG_STRING, &opt_override_url, 0, 0, 0}, {"list-options", 0, POPT_ARG_NONE, NULL, OPT_LIST_OPTIONS, NULL, NULL}, {0, 0, 0, 0, 0, 0, 0} }; @@ -246,6 +248,16 @@ int cmd_load(int argc, const char **argv) goto end; } + /* Set the overrides attributes if any */ + if (opt_override_url) { + ret = lttng_load_session_attr_set_override_url(session_attr, + opt_override_url); + if (ret) { + ERR("Url override is invalid"); + goto end; + } + } + ret = lttng_load_session(session_attr); if (ret) { ERR("%s", lttng_strerror(ret)); @@ -263,6 +275,10 @@ int cmd_load(int argc, const char **argv) } else { MSG("Session has been loaded successfully"); } + + if (opt_override_url) { + MSG("Session output url overridden with %s", opt_override_url); + } success = 1; ret = CMD_SUCCESS; }