Load: expose overrides elements in mi
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Thu, 24 Nov 2016 21:44:17 +0000 (16:44 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 25 Nov 2016 22:45:39 +0000 (17:45 -0500)
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng/commands/load.c
src/common/mi-lttng-3.0.xsd
src/common/mi-lttng.c
src/common/mi-lttng.h

index 7578fdce0b687d3fc74854501aac593006a1073b..338df372f7838583e0f42547340672d7f3ec5be1 100644 (file)
@@ -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;
 }
index 38b13bcf2a8367750af6cda0c245f64edb2cae32..33d24ebf071731e0c6f91728994e06cdfe7f7070 100644 (file)
@@ -425,6 +425,15 @@ THE SOFTWARE.
                <xs:all>
                        <xs:element name="session" type="tns:session_type" />
                        <xs:element name="path" type="xs:string" />
+                       <xs:element name="overrides" type="tns:overrides_type" />
+               </xs:all>
+       </xs:complexType>
+
+       <!-- Maps to the override parameters of the load command -->
+       <xs:complexType name="overrides_type">
+               <xs:all>
+                       <xs:element name="name" type="tns:name_type" minOccurs="0" />
+                       <xs:element name="url" type="xs:string" minOccurs="0" />
                </xs:all>
        </xs:complexType>
 
index a15bde4e3fad440f2455745fc2cdb17aa6dc803e..e87e767c56a2a686929a7f752418cff5369b63dd 100644 (file)
@@ -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 = "";
index e2108002448dc0cf49e474d0c74f088e409afdd4..e7cf8af92ff37b840e01ebbcddbfc60c484510ac 100644 (file)
@@ -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;
This page took 0.028429 seconds and 4 git commands to generate.