From: Jonathan Rajotte Date: Thu, 24 Nov 2016 21:44:17 +0000 (-0500) Subject: Load: expose overrides elements in mi X-Git-Tag: v2.10.0-rc1~97 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=23cb2d558f82a41f2539a0513071b06fb47e5cb8;p=lttng-tools.git Load: expose overrides elements in mi Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng/commands/load.c b/src/bin/lttng/commands/load.c index 7578fdce0..338df372f 100644 --- a/src/bin/lttng/commands/load.c +++ b/src/bin/lttng/commands/load.c @@ -116,9 +116,33 @@ static int mi_load_print(const char *session_name) } } - /* Close load element */ - ret = mi_lttng_writer_close_element(writer); + /* Print override elements */ + ret = mi_lttng_writer_open_element(writer, mi_lttng_element_load_overrides); + if (ret) { + goto end; + } + + /* Session name override element */ + if (opt_override_session_name) { + ret = mi_lttng_writer_write_element_string(writer, + config_element_name, opt_override_session_name); + if (ret) { + goto end; + } + } + + /* Session url override element */ + if (opt_override_url) { + ret = mi_lttng_writer_write_element_string(writer, + mi_lttng_element_load_override_url, + opt_override_url); + if (ret) { + goto end; + } + } + /* Close override and load element */ + ret = mi_lttng_close_multi_element(writer, 2); end: return ret; } diff --git a/src/common/mi-lttng-3.0.xsd b/src/common/mi-lttng-3.0.xsd index 38b13bcf2..33d24ebf0 100644 --- a/src/common/mi-lttng-3.0.xsd +++ b/src/common/mi-lttng-3.0.xsd @@ -425,6 +425,15 @@ THE SOFTWARE. + + + + + + + + + diff --git a/src/common/mi-lttng.c b/src/common/mi-lttng.c index a15bde4e3..e87e767c5 100644 --- a/src/common/mi-lttng.c +++ b/src/common/mi-lttng.c @@ -101,6 +101,8 @@ const char * const mi_lttng_element_save = "save"; /* Strings related to load command */ const char * const mi_lttng_element_load = "load"; +LTTNG_HIDDEN const char * const mi_lttng_element_load_overrides = "overrides"; +LTTNG_HIDDEN const char * const mi_lttng_element_load_override_url = "url"; /* General elements of mi_lttng */ const char * const mi_lttng_element_empty = ""; diff --git a/src/common/mi-lttng.h b/src/common/mi-lttng.h index e21080024..e7cf8af92 100644 --- a/src/common/mi-lttng.h +++ b/src/common/mi-lttng.h @@ -107,6 +107,8 @@ extern const char * const mi_lttng_element_save; /* Strings related to load command */ extern const char * const mi_lttng_element_load; +LTTNG_HIDDEN const char * const mi_lttng_element_load_overrides; +LTTNG_HIDDEN const char * const mi_lttng_element_load_override_url; /* General element of mi_lttng */ extern const char * const mi_lttng_element_empty;