public inbox for frysk@sourceware.org
 help / color / mirror / Atom feed
* Extending Frysk to trace user-space lockings
@ 2007-07-20  3:08 Eugene Teo
  2007-07-20  8:51 ` Mark Wielaard
  0 siblings, 1 reply; 4+ messages in thread
From: Eugene Teo @ 2007-07-20  3:08 UTC (permalink / raw)
  To: frysk

Hi,

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!

Thanks,
Eugene




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Extending Frysk to trace user-space lockings
  2007-07-20  3:08 Extending Frysk to trace user-space lockings Eugene Teo
@ 2007-07-20  8:51 ` Mark Wielaard
  2007-08-23  0:24   ` Phil Muldoon
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Wielaard @ 2007-07-20  8:51 UTC (permalink / raw)
  To: Eugene Teo; +Cc: frysk

[-- 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 --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Extending Frysk to trace user-space lockings
  2007-07-20  8:51 ` Mark Wielaard
@ 2007-08-23  0:24   ` Phil Muldoon
  2007-08-23  0:45     ` Phil Muldoon
  0 siblings, 1 reply; 4+ messages in thread
From: Phil Muldoon @ 2007-08-23  0:24 UTC (permalink / raw)
  To: Mark Wielaard; +Cc: Eugene Teo, frysk

Mark Wielaard wrote:
> 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. 

Are  futex's exposed via fhpd at the moment?

Regards

Phil

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Extending Frysk to trace user-space lockings
  2007-08-23  0:24   ` Phil Muldoon
@ 2007-08-23  0:45     ` Phil Muldoon
  0 siblings, 0 replies; 4+ messages in thread
From: Phil Muldoon @ 2007-08-23  0:45 UTC (permalink / raw)
  To: Mark Wielaard; +Cc: Eugene Teo, frysk

Phil Muldoon wrote:
>
> Are  futex's exposed via fhpd at the moment?
>
Answering self, no. But:

*./frysk_bin/frysk-core/frysk/bindir/ftrace -p 5396 -t futex

*Should trace all futex calls in the process. In that example, 5396 was 
firefox which makes lots of use of them. Does this help a bit in your 
task, Eugene?

Regards

Phil

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-08-23  0:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-20  3:08 Extending Frysk to trace user-space lockings Eugene Teo
2007-07-20  8:51 ` Mark Wielaard
2007-08-23  0:24   ` Phil Muldoon
2007-08-23  0:45     ` Phil Muldoon

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).