Test: Ensure wildcards may only appear last in a string literal
[lttng-tools.git] / src / bin / lttng-sessiond / jul.c
index da4cf6782322f5c44bdcab50c1349ee7e1155324..bf4669b239053f470807fb7110d8a5a230b6efd7 100644 (file)
@@ -722,7 +722,8 @@ error:
  *
  * Return a new object else NULL on error.
  */
-struct jul_event *jul_create_event(const char *name)
+struct jul_event *jul_create_event(const char *name,
+               struct lttng_filter_bytecode *filter)
 {
        struct jul_event *event;
 
@@ -739,6 +740,10 @@ struct jul_event *jul_create_event(const char *name)
                lttng_ht_node_init_str(&event->node, event->name);
        }
 
+       if (filter) {
+               event->filter = filter;
+       }
+
 error:
        return event;
 }
@@ -871,6 +876,15 @@ void jul_destroy_domain(struct jul_domain *dom)
        rcu_read_lock();
        cds_lfht_for_each_entry(dom->events->ht, &iter.iter, node, node) {
                int ret;
+               struct jul_event *event;
+
+               /*
+                * When destroying an event, we have to try to disable it on the agent
+                * side so the event stops generating data. The return value is not
+                * important since we have to continue anyway destroying the object.
+                */
+               event = caa_container_of(node, struct jul_event, node);
+               (void) jul_disable_event(event);
 
                ret = lttng_ht_del(dom->events, &iter);
                assert(!ret);
This page took 0.024637 seconds and 5 git commands to generate.