}
/*
- * 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)
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);
}
/*
- * 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)
* 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;
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,
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;