Fix: UTF-8 characters may be stored on up to 4 bytes
[lttng-tools.git] / src / bin / lttng-sessiond / agent.c
index ab6905190e0eb7082923832398fdababae09efbc..9ec98167eb5a3c4db7c6f428cca926ac6b2f42d6 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;
        }
 
@@ -402,9 +400,7 @@ static int enable_event(struct agent_app *app, struct agent_event *event)
                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;
        }
 
@@ -465,9 +461,7 @@ static int disable_event(struct agent_app *app, struct agent_event *event)
                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;
        }
 
@@ -722,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();
 }
 
 /*
@@ -798,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();
 }
 
 /*
@@ -813,7 +802,7 @@ struct agent *agent_create(enum lttng_domain_type domain)
        int ret;
        struct agent *agt;
 
-       agt = zmalloc(sizeof(*agt));
+       agt = zmalloc(sizeof(struct agent));
        if (!agt) {
                goto error;
        }
@@ -872,10 +861,7 @@ void agent_add_event(struct agent_event *event, struct agent *agt)
        assert(agt->events);
 
        DBG3("Agent adding event %s", event->name);
-
-       rcu_read_lock();
        add_unique_agent_event(agt->events, event);
-       rcu_read_unlock();
        agt->being_used = 1;
 }
 
@@ -964,6 +950,7 @@ void agent_destroy_event(struct agent_event *event)
        assert(event);
 
        free(event->filter);
+       free(event->filter_expression);
        free(event);
 }
 
@@ -980,14 +967,6 @@ void agent_destroy(struct agent *agt)
 
        DBG3("Agent destroy");
 
-       /*
-        * Just ignore if no events hash table exists. This is possible if for
-        * instance an agent object was allocated but not initialized.
-        */
-       if (!agt->events) {
-               return;
-       }
-
        rcu_read_lock();
        cds_lfht_for_each_entry(agt->events->ht, &iter.iter, node, node) {
                int ret;
This page took 0.025218 seconds and 4 git commands to generate.