This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
PThread profiling
- From: Daniel Tralamazza <tralamazza at gmail dot com>
- To: systemtap at sourceware dot org
- Date: Mon, 23 Feb 2009 20:37:47 +0100
- Subject: PThread profiling
Hi,
I am doing userland synchronization primitives analysis as part of
my research. For the past 2 months or so I've been bugging people over
IRC with user space questions and bugs (sorry mjw & fche) I guess it's
time to show something.
Just for a bit of context: I first tried to use dynamic probes,
e.g.: 'process("/lib64/libpthread.so.0").function("__pthread_mutex_lock")
{}'. I even did a tapset for most pthread functions inside NPTL
('probe pthread.create'). It worked fine, but the overhead was causing
measurements errors (too slow == higher contention probability). It
was clear that I had to use static markers, all I had to do was patch
glibc/nptl and voila.
Right now I have a simple systemtap provider and a small glibc patch
(both WIP). I will continue to update this work as part of my
research, at the same time I making it available to anyone interested.
For the lazy people (like me) I have built glibc rpms for fedora 10
x86_64, you can find them here
http://daniel.tralamazza.com/pub/rpms.tar.gz
For the rest of you (suicidal maniacs) wanting to compile your own
glibc, I've put together a glibc.spec + patches:
http://daniel.tralamazza.com/pub/glibc.spec
http://daniel.tralamazza.com/pub/glibc-usdt.patch
http://daniel.tralamazza.com/pub/glibc-usdt-20081113T2206.tar.bz2
http://daniel.tralamazza.com/pub/pthread_probe.d (you need this if
you want to regenerate pthread_probe.h)
And there is even an example! Because everyone always shows lock
contention I chose something different.
The script can be found here:
http://daniel.tralamazza.com/pub/lock_topshared.stp
It shows the top 10 most shared locks, i.e.: locks which are accessed
by different threads and the sum of all acquisitions (per lock).
cheers,
--
Daniel Tralamazza
EPFL IC IIF DSLAB
INN-331
ps: The current patch doesn't contain the pthread_cond_* probes.