From mboxrd@z Thu Jan 1 00:00:00 1970 From: compudj@krystal.dyndns.org (Mathieu Desnoyers) Date: Tue, 2 Dec 2008 16:55:19 -0500 Subject: [ltt-dev] trace a futex In-Reply-To: <8d94e9280812021215m6a63d6c2l4e64acd26274953d@mail.gmail.com> References: <8d94e9280812021142j2eb5ca72td730410e97ccd9a1@mail.gmail.com> <20081202195015.GA25792@Krystal> <8d94e9280812021215m6a63d6c2l4e64acd26274953d@mail.gmail.com> Message-ID: <20081202215519.GA734@Krystal> * Gian Lorenzo Meocci (glmeocci at gmail.com) wrote: > Hi Mathieu, > > thanks for your reply. > > I want specify that: > 1) I am already patching glibc (and, of course, nptl/pthread_*) > 2) I already add two event to pthread_mutex_lock. The first at the > beginning of the function and the second after all return 0 presented > on that function. But those two events are not enough to establish if > a pthread_mutex_lock has been blocking. > In fact I know only the time spent on pthread_mutex_lock. If this time > is little probably I hold the mutex otherwise I was been descheduled. > > So thanks a lot again, > > Ok, then you will probably want to correlate your information with : - scheduling activity regarding your threads - system call entry events, especially sys_futex. Note that a thread calling sys_futex won't _necessarily_ be put to sleep.. it may still be able to take the lock relatively quickly. If you need more than that, we may think of instrumenting futex.c, but I am not sure this is required. Mathieu > -- > Ing. Gian Lorenzo Meocci > http://www.meocci.it > -- Mathieu Desnoyers OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68