Fix: free metadata cache after grace period in consumer
[lttng-tools.git] / src / bin / lttng-sessiond / trace-ust.c
index 3881084f04fb4024b14970120e44e85c02b1d59d..9bc0b73d05cdb80363e159d76d703b102bd88141 100644 (file)
@@ -284,14 +284,6 @@ struct ltt_ust_session *trace_ust_create_session(uint64_t session_id)
                goto error_consumer;
        }
 
-       /*
-        * The tmp_consumer stays NULL until a set_consumer_uri command is
-        * executed. At this point, the consumer should be nullify until an
-        * enable_consumer command. This assignment is symbolic since we've zmalloc
-        * the struct.
-        */
-       lus->tmp_consumer = NULL;
-
        DBG2("UST trace session create successful");
 
        return lus;
@@ -309,7 +301,8 @@ error:
  *
  * Return pointer to structure or NULL.
  */
-struct ltt_ust_channel *trace_ust_create_channel(struct lttng_channel *chan)
+struct ltt_ust_channel *trace_ust_create_channel(struct lttng_channel *chan,
+               enum lttng_domain_type domain)
 {
        struct ltt_ust_channel *luc;
 
@@ -321,6 +314,8 @@ struct ltt_ust_channel *trace_ust_create_channel(struct lttng_channel *chan)
                goto error;
        }
 
+       luc->domain = domain;
+
        /* Copy UST channel attributes */
        luc->attr.overwrite = chan->attr.overwrite;
        luc->attr.subbuf_size = chan->attr.subbuf_size;
@@ -375,7 +370,8 @@ error:
 struct ltt_ust_event *trace_ust_create_event(struct lttng_event *ev,
                char *filter_expression,
                struct lttng_filter_bytecode *filter,
-               struct lttng_event_exclusion *exclusion)
+               struct lttng_event_exclusion *exclusion,
+               bool internal_event)
 {
        struct ltt_ust_event *lue;
 
@@ -387,6 +383,8 @@ struct ltt_ust_event *trace_ust_create_event(struct lttng_event *ev,
                goto error;
        }
 
+       lue->internal = internal_event;
+
        switch (ev->type) {
        case LTTNG_EVENT_PROBE:
                lue->attr.instrumentation = LTTNG_UST_PROBE;
@@ -429,8 +427,8 @@ struct ltt_ust_event *trace_ust_create_event(struct lttng_event *ev,
 
        /* Same layout. */
        lue->filter_expression = filter_expression;
-       lue->filter = (struct lttng_ust_filter_bytecode *) filter;
-       lue->exclusion = (struct lttng_event_exclusion *) exclusion;
+       lue->filter = filter;
+       lue->exclusion = exclusion;
 
        /* Init node */
        lttng_ht_node_init_str(&lue->node, lue->attr.name);
@@ -1067,8 +1065,7 @@ void trace_ust_destroy_session(struct ltt_ust_session *session)
                buffer_reg_uid_destroy(reg, session->consumer);
        }
 
-       consumer_destroy_output(session->consumer);
-       consumer_destroy_output(session->tmp_consumer);
+       consumer_output_put(session->consumer);
 
        fini_pid_tracker(&session->pid_tracker);
 
This page took 0.024381 seconds and 4 git commands to generate.