[ltt-dev] Why init needs pthread mutex in libust?

Robert rsm219 at gmail.com
Tue May 24 02:02:20 EDT 2011


Hello list,

I am trying to understand the code of libust, and there are some questions.

1. How is *libust* executed? Why it can execute before the *main* function
of an application?
2. Why *init* needs pthread *mutex*? I check the code and execution, it
seems that *ltt_trace_alloc* and *ltt_trace_start* are totally serialized.
     Also, currently there is only one trace (with the name of *ust*) in the
list *ltt_traces.head*, right? In the code, there are only two places that
modify the list, one is in *ltt_trace_alloc*, and the other happens in
destroying traces. But in execution they are serialized with other read to
the list during execution, then why we need *rcu_read_lock* and *
synchronize_rcu* there?

Maybe stupid questions, but if you guys can kindly answer them I will
appreciate it.

Thanks.

-- *Robert*
*
*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.casi.polymtl.ca/pipermail/lttng-dev/attachments/20110523/63b07f96/attachment-0003.htm>


More information about the lttng-dev mailing list