Remove unneeded RCU lock
[lttng-tools.git] / src / bin / lttng-sessiond / cmd.c
index 11e2885411f69f6fb07325d0364aed8c891e37d1..30cfc21c4f07fc5f90d637d260a8cbe3740b5a41 100644 (file)
@@ -1383,6 +1383,7 @@ static int validate_event_name(const char *name)
        int ret = 0;
        const char *c = name;
        const char *event_name_end = c + LTTNG_SYMBOL_NAME_LEN;
+       bool null_terminated = false;
 
        /*
         * Make sure that unescaped wildcards are only used as the last
@@ -1391,6 +1392,7 @@ static int validate_event_name(const char *name)
        while (c < event_name_end) {
                switch (*c) {
                case '\0':
+                       null_terminated = true;
                        goto end;
                case '\\':
                        c++;
@@ -1407,6 +1409,9 @@ static int validate_event_name(const char *name)
                c++;
        }
 end:
+       if (!ret && !null_terminated) {
+               ret = LTTNG_ERR_INVALID_EVENT_NAME;
+       }
        return ret;
 }
 
@@ -1898,9 +1903,7 @@ int cmd_start_trace(struct ltt_session *session)
         * possible to enable channel thus inform the client.
         */
        if (usess && usess->domain_global.channels) {
-               rcu_read_lock();
                nb_chan += lttng_ht_get_count(usess->domain_global.channels);
-               rcu_read_unlock();
        }
        if (ksession) {
                nb_chan += ksession->channel_count;
@@ -2457,6 +2460,10 @@ ssize_t cmd_list_domains(struct ltt_session *session,
 
        if (session->kernel_session != NULL) {
                (*domains)[index].type = LTTNG_DOMAIN_KERNEL;
+
+               /* Kernel session buffer type is always GLOBAL */
+               (*domains)[index].buf_type = LTTNG_BUFFER_GLOBAL;
+
                index++;
        }
 
This page took 0.024552 seconds and 5 git commands to generate.