Remove unneeded RCU lock
[lttng-tools.git] / src / bin / lttng-sessiond / agent.c
index b69e929ca0eda857aaa233e483df05b6191e085b..ca2d4c872931632f4e5d46cb9c6b17b6b3d0d8ed 100644 (file)
@@ -303,9 +303,7 @@ static ssize_t list_events(struct agent_app *app, struct lttng_event **events)
                data_size = be32toh(reply_hdr.data_size) + sizeof(*reply);
                break;
        default:
-               ERR("Agent returned an unknown code: %" PRIu32,
-                               be32toh(reply_hdr.ret_code));
-               ret = LTTNG_ERR_FATAL;
+               ret = LTTNG_ERR_UNK;
                goto error;
        }
 
@@ -361,6 +359,7 @@ static int enable_event(struct agent_app *app, struct agent_event *event)
 {
        int ret;
        uint64_t data_size;
+       uint32_t reply_ret_code;
        struct lttcomm_agent_enable msg;
        struct lttcomm_agent_generic_reply reply;
 
@@ -392,16 +391,16 @@ static int enable_event(struct agent_app *app, struct agent_event *event)
                goto error_io;
        }
 
-       switch (be32toh(reply.ret_code)) {
+       reply_ret_code = be32toh(reply.ret_code);
+       log_reply_code(reply_ret_code);
+       switch (reply_ret_code) {
        case AGENT_RET_CODE_SUCCESS:
                break;
        case AGENT_RET_CODE_UNKNOWN_NAME:
                ret = LTTNG_ERR_UST_EVENT_NOT_FOUND;
                goto error;
        default:
-               ERR("Agent returned an unknown code: %" PRIu32,
-                               be32toh(reply.ret_code));
-               ret = LTTNG_ERR_FATAL;
+               ret = LTTNG_ERR_UNK;
                goto error;
        }
 
@@ -423,6 +422,7 @@ static int disable_event(struct agent_app *app, struct agent_event *event)
 {
        int ret;
        uint64_t data_size;
+       uint32_t reply_ret_code;
        struct lttcomm_agent_disable msg;
        struct lttcomm_agent_generic_reply reply;
 
@@ -452,16 +452,16 @@ static int disable_event(struct agent_app *app, struct agent_event *event)
                goto error_io;
        }
 
-       switch (be32toh(reply.ret_code)) {
+       reply_ret_code = be32toh(reply.ret_code);
+       log_reply_code(reply_ret_code);
+       switch (reply_ret_code) {
        case AGENT_RET_CODE_SUCCESS:
                break;
        case AGENT_RET_CODE_UNKNOWN_NAME:
                ret = LTTNG_ERR_UST_EVENT_NOT_FOUND;
                goto error;
        default:
-               ERR("Agent returned an unknown code: %" PRIu32,
-                               be32toh(reply.ret_code));
-               ret = LTTNG_ERR_FATAL;
+               ret = LTTNG_ERR_UNK;
                goto error;
        }
 
@@ -716,10 +716,7 @@ void agent_add_app(struct agent_app *app)
        assert(app);
 
        DBG3("Agent adding app sock: %d and pid: %d to ht", app->sock->fd, app->pid);
-
-       rcu_read_lock();
        lttng_ht_add_unique_ulong(agent_apps_ht_by_sock, &app->node);
-       rcu_read_unlock();
 }
 
 /*
@@ -792,9 +789,7 @@ void agent_add(struct agent *agt, struct lttng_ht *ht)
 
        DBG3("Agent adding from domain %d", agt->domain);
 
-       rcu_read_lock();
        lttng_ht_add_unique_u64(ht, &agt->node);
-       rcu_read_unlock();
 }
 
 /*
@@ -958,6 +953,7 @@ void agent_destroy_event(struct agent_event *event)
        assert(event);
 
        free(event->filter);
+       free(event->filter_expression);
        free(event);
 }
 
This page took 0.024792 seconds and 4 git commands to generate.