public inbox for frysk@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: Eugene Teo <eteo@redhat.com>
Cc: frysk@sourceware.org
Subject: Re: Extending Frysk to trace user-space lockings
Date: Fri, 20 Jul 2007 08:51:00 -0000	[thread overview]
Message-ID: <1184921481.3611.17.camel@dijkstra.wildebeest.org> (raw)
In-Reply-To: <46A02732.3090900@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1407 bytes --]

Hi Eugene,

On Fri, 2007-07-20 at 11:08 +0800, Eugene Teo wrote:
> Is it possible to extend Frysk to trace user-space lockings? I am trying to
> write a tool that basically outputs the lock used and the backtrace showing
> who is holding on to it. I don't really have an example output that I can show,
> but if you have an idea to share, do let me know!

I am afraid I know too little about user space locking or even know how
various user space locking mechanisms are implemented to give a real
answer.

Lets assume you are interested in pthread mutexes. Then what you can do
at this point with frysk is get a simple  stack trace of all threads of
a process using ftrace <pid> this should include things like
pthread_cond_wait() calls. This at least gives you info on whether or
not threads are contending.

We could build on that by extracting the mutex argument from that call
and then get the owner from that (although I am not sure how
standardized all this is and whether or not you are supposed to be able
to get at the owner field). But that needs some creative hacking on the
frysk sources to make your own specialized ftrace-pthread-mutex variant
and possibly you will need the debug info for the program you are
examining to munch through the stack frame, function call argument list
and mutex fields.

Hope some of the above rambling makes sense.

Cheers,

Mark

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2007-07-20  8:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-20  3:08 Eugene Teo
2007-07-20  8:51 ` Mark Wielaard [this message]
2007-08-23  0:24   ` Phil Muldoon
2007-08-23  0:45     ` Phil Muldoon

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=1184921481.3611.17.camel@dijkstra.wildebeest.org \
    --to=mark@klomp.org \
    --cc=eteo@redhat.com \
    --cc=frysk@sourceware.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).