lttng-ust(3): document `lttng_ust_loaded` symbol
[lttng-ust.git] / liblttng-ust / lttng-ust-statedump.c
index 2fb8f34d9b4f4e34d803813498187273441fc487..171cbaec0a666a83699d952cb31767c7ec3234bf 100644 (file)
@@ -551,6 +551,12 @@ void lttng_ust_dl_update(void *ip)
        if (getenv("LTTNG_UST_WITHOUT_BADDR_STATEDUMP"))
                return;
 
+       /*
+        * Fixup lttng-ust TLS when called from dlopen/dlclose
+        * instrumentation.
+        */
+       lttng_ust_fixup_tls();
+
        data.exec_found = 0;
        data.first = true;
        data.cancel = false;
@@ -590,12 +596,22 @@ int do_baddr_statedump(void *owner)
  * session, statedumps from different processes may be
  * interleaved. The vpid context should be used to identify which
  * events belong to which process.
+ *
+ * Grab the ust_lock outside of the RCU read-side lock because we
+ * perform synchronize_rcu with the ust_lock held, which can trigger
+ * deadlocks otherwise.
  */
 int do_lttng_ust_statedump(void *owner)
 {
+       ust_lock_nocheck();
        trace_statedump_start(owner);
+       ust_unlock();
+
        do_baddr_statedump(owner);
+
+       ust_lock_nocheck();
        trace_statedump_end(owner);
+       ust_unlock();
 
        return 0;
 }
This page took 0.023755 seconds and 4 git commands to generate.