From: compudj@krystal.dyndns.org (Mathieu Desnoyers)
Subject: [ltt-dev] trace a futex
Date: Tue, 2 Dec 2008 14:50:16 -0500 [thread overview]
Message-ID: <20081202195015.GA25792@Krystal> (raw)
In-Reply-To: <8d94e9280812021142j2eb5ca72td730410e97ccd9a1@mail.gmail.com>
* Gian Lorenzo Meocci (glmeocci at gmail.com) wrote:
> Hi all,
>
> I am working (always) on a multithread tracing system. I would know if
> there is a method to trace, with LTTng, an lll_lock or a lowlevel
> function futex_wait.
> I want establish if a synchronization primitive (like
> pthread_mutex_lock or sem_wait) has acquires a lock or not.
Tracing futex wait will only tell you when there has been "heavy"
contention on the mutex which required to put the process to sleep. The
pthread code starts by looping a few times actively waiting for the lock
before it calls the OS.
Therefore, the best way to trace this would be to use the userspace
markers and trace the mutex down/up events. This would imply recompiling
the pthread library.
Also note that when this instrumentation will be enabled (I mean by this
dynamically enabled at runtime), the system may be noticeably slower
because there will be 1 system call each time the mutex primitive is
called. The current userspace tracing goes through a system call to the
OS. Eventually, we should be able to change that into a direct memory
write, which will be much faster.
Mathieu
>
> Thanks a lot,
>
>
> --
> Ing. Gian Lorenzo Meocci
> http://www.meocci.it
>
> _______________________________________________
> ltt-dev mailing list
> ltt-dev at lists.casi.polymtl.ca
> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
>
--
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
next prev parent reply other threads:[~2008-12-02 19:50 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-02 19:42 Gian Lorenzo Meocci
2008-12-02 19:50 ` Mathieu Desnoyers [this message]
2008-12-02 20:15 ` Gian Lorenzo Meocci
2008-12-02 21:55 ` Mathieu Desnoyers
2008-12-02 22:10 ` Jan Kiszka
2008-12-02 22:10 ` Jan Kiszka
2008-12-02 22:10 ` Jan Kiszka
2008-12-03 5:26 ` Mathieu Desnoyers
2008-12-03 5:26 ` Mathieu Desnoyers
2008-12-03 5:26 ` Mathieu Desnoyers
2008-12-03 18:01 ` K.Prasad
2008-12-04 8:53 ` Peter Zijlstra
2008-12-05 12:28 ` Mathieu Desnoyers
2008-12-05 15:58 ` Peter Zijlstra
2008-12-05 16:01 ` Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081202195015.GA25792@Krystal \
--to=compudj@krystal.dyndns.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox