Enforce documented RCU preconditions with assertions
[lttng-tools.git] / src / bin / lttng-sessiond / buffer-registry.cpp
index aca8ec1f227f54cc9f8fded46d8924c4b53841be..64e98333ffb6549cb2ffc5ca849a4d598b8780f4 100644 (file)
@@ -185,6 +185,8 @@ struct buffer_reg_uid *buffer_reg_uid_find(uint64_t session_id,
        struct buffer_reg_uid *reg = NULL, key;
        struct lttng_ht *ht = buffer_registry_uid;
 
+       ASSERT_RCU_READ_LOCKED();
+
        /* Setup key we are looking for. */
        key.session_id = session_id;
        key.bits_per_long = bits_per_long;
@@ -574,8 +576,6 @@ void buffer_reg_channel_destroy(struct buffer_reg_channel *regp,
 
 /*
  * Destroy a buffer registry session with the given domain.
- *
- * Should *NOT* be called with RCU read-side lock held.
  */
 static void buffer_reg_session_destroy(struct buffer_reg_session *regp,
                enum lttng_domain_type domain)
@@ -596,7 +596,7 @@ static void buffer_reg_session_destroy(struct buffer_reg_session *regp,
        }
        rcu_read_unlock();
 
-       ht_cleanup_push(regp->channels);
+       lttng_ht_destroy(regp->channels);
 
        switch (domain) {
        case LTTNG_DOMAIN_UST:
@@ -735,12 +735,10 @@ void buffer_reg_pid_destroy(struct buffer_reg_pid *regp)
 
 /*
  * Destroy per PID and UID registry hash table.
- *
- * Should *NOT* be called with RCU read-side lock held.
  */
 void buffer_reg_destroy_registries(void)
 {
        DBG3("Buffer registry destroy all registry");
-       ht_cleanup_push(buffer_registry_uid);
-       ht_cleanup_push(buffer_registry_pid);
+       lttng_ht_destroy(buffer_registry_uid);
+       lttng_ht_destroy(buffer_registry_pid);
 }
This page took 0.035882 seconds and 4 git commands to generate.