X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=liblttng-ust%2Flttng-ust-statedump.c;h=644af303aa9ceae55bae10d899571d8999e02b26;hb=8002ea62058fd7e44575f7056a26c6b257948d03;hp=c8e508cdf9e9bd477f333ce79046e42625d64922;hpb=97c7c238f60194565d4839e38e712414c22494e3;p=lttng-ust.git diff --git a/liblttng-ust/lttng-ust-statedump.c b/liblttng-ust/lttng-ust-statedump.c index c8e508cd..644af303 100644 --- a/liblttng-ust/lttng-ust-statedump.c +++ b/liblttng-ust/lttng-ust-statedump.c @@ -431,13 +431,13 @@ void iter_end(struct dl_iterate_data *data, void *ip) trace_lib_load(&e->bin_data, ip); e->traced = true; } + e->marked = false; } else { if (e->traced) trace_lib_unload(&e->bin_data, ip); remove_dl_node(e); free_dl_node(e); } - e->marked = false; } } ust_unlock(); @@ -590,12 +590,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; }