X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fcmd.c;h=33ab492daf330eacacc239646b866b612d5975e8;hp=9fc21fcaf60c3ef57156145998381e9fd487765a;hb=b11feea58d73a097e4e1447473798822da28a70d;hpb=e0a74f0198e6b12320fb6118b5193759e4329f76 diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 9fc21fcaf..33ab492da 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -220,7 +220,9 @@ static int list_lttng_agent_events(struct agent *agt, DBG3("Listing agent events"); + rcu_read_lock(); nb_event = lttng_ht_get_count(agt->events); + rcu_read_unlock(); if (nb_event == 0) { ret = nb_event; goto error; @@ -2486,8 +2488,10 @@ ssize_t cmd_list_channels(int domain, struct ltt_session *session, break; case LTTNG_DOMAIN_UST: if (session->ust_session != NULL) { + rcu_read_lock(); nb_chan = lttng_ht_get_count( - session->ust_session->domain_global.channels); + session->ust_session->domain_global.channels); + rcu_read_unlock(); } DBG3("Number of UST global channels %zd", nb_chan); if (nb_chan < 0) { @@ -2548,10 +2552,12 @@ ssize_t cmd_list_events(int domain, struct ltt_session *session, struct lttng_ht_iter iter; struct agent *agt; + rcu_read_lock(); cds_lfht_for_each_entry(session->ust_session->agents->ht, &iter.iter, agt, node.node) { nb_event = list_lttng_agent_events(agt, events); } + rcu_read_unlock(); } break; default: