From: Jérémie Galarneau Date: Wed, 30 Mar 2022 13:23:46 +0000 (-0400) Subject: sessiond: document RCU locking assumption during channel metadata statedump X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=60f1b42d6280b6bd386abb726dca4fd3b31d8491;p=lttng-tools.git sessiond: document RCU locking assumption during channel metadata statedump The rcu read lock must be held by the caller during a call to ust_metadata_channel_statedump. An assertion and a comment are added. Signed-off-by: Jérémie Galarneau Change-Id: Ia57a140d51470cc43cf62d36c9b4b552e1c17191 --- diff --git a/src/bin/lttng-sessiond/ust-metadata.cpp b/src/bin/lttng-sessiond/ust-metadata.cpp index 566799efd..5f031a9c4 100644 --- a/src/bin/lttng-sessiond/ust-metadata.cpp +++ b/src/bin/lttng-sessiond/ust-metadata.cpp @@ -906,12 +906,16 @@ end: /* * Should be called with session registry mutex held. + * + * RCU read lock must be held by the caller. */ int ust_metadata_channel_statedump(struct ust_registry_session *session, struct ust_registry_channel *chan) { int ret; + ASSERT_RCU_READ_LOCKED(); + /* Don't dump metadata events */ if (chan->chan_id == -1U) return 0;