MI: add <filter_expression> (event filter expression)
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Sat, 29 Aug 2015 21:12:48 +0000 (17:12 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 3 Mar 2016 22:19:41 +0000 (17:19 -0500)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/config/config-session-abi.h
src/common/config/session-config.c
src/common/mi-lttng.c
src/common/mi_lttng.xsd

index 23f8c84165acc78edc3b4d96b3fe9e13cb5fc61d..f7cee34eb44a0d9886fd112d731101f65f6968fc 100644 (file)
@@ -60,6 +60,7 @@ extern const char * const config_element_snapshot_mode;
 extern const char * const config_element_loglevel;
 extern const char * const config_element_loglevel_type;
 extern const char * const config_element_filter;
+extern const char * const config_element_filter_expression;
 extern const char * const config_element_snapshot_outputs;
 extern const char * const config_element_consumer_output;
 extern const char * const config_element_destination;
index ba938d9f1578863b9253c28d61bbe7bd29b4ff08..8fcb75230ad4309e4efddb428ab748c9b6721ab9 100644 (file)
@@ -109,6 +109,7 @@ const char * const config_element_snapshot_mode = "snapshot_mode";
 const char * const config_element_loglevel = "loglevel";
 const char * const config_element_loglevel_type = "loglevel_type";
 const char * const config_element_filter = "filter";
+const char * const config_element_filter_expression = "filter_expression";
 const char * const config_element_snapshot_outputs = "snapshot_outputs";
 const char * const config_element_consumer_output = "consumer_output";
 const char * const config_element_destination = "destination";
index fc22e4e0cabeb34f9f75b78607d79d0b5337f7f2..ef98687d868108ef6e37e604b9c5e6c577f1cf00 100644 (file)
@@ -922,6 +922,7 @@ int mi_lttng_event_common_attributes(struct mi_writer *writer,
                struct lttng_event *event)
 {
        int ret;
+       const char *filter_expression;
 
        /* Open event element */
        ret = mi_lttng_writer_open_element(writer, config_element_event);
@@ -954,6 +955,23 @@ int mi_lttng_event_common_attributes(struct mi_writer *writer,
        ret = mi_lttng_writer_write_element_bool(writer,
                        config_element_filter, event->filter);
 
+       /* Event filter expression */
+       ret = lttng_event_get_filter_string(event, &filter_expression);
+
+       if (ret) {
+               goto end;
+       }
+
+       if (filter_expression) {
+               ret = mi_lttng_writer_write_element_string(writer,
+                       config_element_filter_expression,
+                       filter_expression);
+
+               if (ret) {
+                       goto end;
+               }
+       }
+
 end:
        return ret;
 }
index efb62a20bb8613d70958eb872cc0f8877414d4e6..3992a8e71f907f81bebdd8e38163fbba997f63f7 100644 (file)
@@ -197,6 +197,7 @@ THE SOFTWARE.
                        <xs:element name="loglevel" type="loglevel_string_type" default="" minOccurs="0" />
                        <xs:element name="enabled" type="xs:boolean" default="false" minOccurs="0" />
                        <xs:element name="filter" type="xs:boolean" minOccurs="0" />
+                       <xs:element name="filter_expression" type="xs:string" minOccurs="0" />
                        <xs:element name="exclusion" type="xs:boolean" minOccurs="0" />
                        <xs:element name="exclusions" type="event_exclusion_list_type" minOccurs="0"/>
                        <xs:element name="attributes" type="event_attributes_type" minOccurs="0" />
This page took 0.033227 seconds and 4 git commands to generate.