X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Ftrace-ust.c;h=97a9c77e81f6974625877c67b4e125fde692d9e4;hb=6bb9e85f440e1ee6e54105b2f2c13035039ae64d;hp=1830763b1b6a88d3c1ac7ba528d5512b3e7444a3;hpb=0525e9ae15d215943d8187e7f190d5a45e723085;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/trace-ust.c b/src/bin/lttng-sessiond/trace-ust.c index 1830763b1..97a9c77e8 100644 --- a/src/bin/lttng-sessiond/trace-ust.c +++ b/src/bin/lttng-sessiond/trace-ust.c @@ -116,7 +116,8 @@ no_match: } /* - * Find the channel in the hashtable. + * Find the channel in the hashtable and return channel pointer. RCU read side + * lock MUST be acquired before calling this. */ struct ltt_ust_channel *trace_ust_find_channel_by_name(struct lttng_ht *ht, char *name) @@ -124,14 +125,11 @@ struct ltt_ust_channel *trace_ust_find_channel_by_name(struct lttng_ht *ht, struct lttng_ht_node_str *node; struct lttng_ht_iter iter; - rcu_read_lock(); lttng_ht_lookup(ht, (void *)name, &iter); node = lttng_ht_iter_get_node_str(&iter); if (node == NULL) { - rcu_read_unlock(); goto error; } - rcu_read_unlock(); DBG2("Trace UST channel %s found by name", name); @@ -143,7 +141,8 @@ error: } /* - * Find the event in the hashtable. + * Find the event in the hashtable and return event pointer. RCU read side lock + * MUST be acquired before calling this. */ struct ltt_ust_event *trace_ust_find_event(struct lttng_ht *ht, char *name, struct lttng_filter_bytecode *filter, int loglevel) @@ -181,7 +180,7 @@ error: * Return pointer to structure or NULL. */ struct ltt_ust_session *trace_ust_create_session(char *path, - unsigned int session_id, struct lttng_domain *domain) + unsigned int session_id) { struct ltt_ust_session *lus; @@ -217,7 +216,7 @@ struct ltt_ust_session *trace_ust_create_session(char *path, lus->tmp_consumer = NULL; /* Use the default consumer output which is the tracing session path. */ - if (path && strlen(path) > 0) { + if (*path != '\0') { int ret; ret = snprintf(lus->consumer->dst.trace_path, PATH_MAX, @@ -413,13 +412,13 @@ struct ltt_ust_metadata *trace_ust_create_metadata(char *path) lum->attr.overwrite = DEFAULT_CHANNEL_OVERWRITE; lum->attr.subbuf_size = default_get_metadata_subbuf_size(); lum->attr.num_subbuf = DEFAULT_METADATA_SUBBUF_NUM; - lum->attr.switch_timer_interval = DEFAULT_CHANNEL_SWITCH_TIMER; - lum->attr.read_timer_interval = DEFAULT_CHANNEL_READ_TIMER; + lum->attr.switch_timer_interval = DEFAULT_UST_CHANNEL_SWITCH_TIMER; + lum->attr.read_timer_interval = DEFAULT_UST_CHANNEL_READ_TIMER; lum->attr.output = LTTNG_UST_MMAP; lum->handle = -1; /* Set metadata trace path */ - ret = snprintf(lum->pathname, PATH_MAX, "%s/metadata", path); + ret = snprintf(lum->pathname, PATH_MAX, "%s/" DEFAULT_METADATA_NAME, path); if (ret < 0) { PERROR("asprintf ust metadata"); goto error_free_metadata;