How to measure mutex contention?

Luís Oliveira picture Luís Oliveira · Aug 8, 2009 · Viewed 12.3k times · Source

I have some threaded code using PThreads on Linux that, I suspect, is suffering from excessive lock contention. What tools are available for me to measure this?

Solaris has DTrace and plockstat. Is there something similar on Linux? (I know about a recent DTrace port for Linux but it doesn't seem to be ready for prime time yet.)

Answer

user391515 picture user391515 · Jul 14, 2010

mutrace is the tool: http://0pointer.de/blog/projects/mutrace.html

Its easy to build, install and use.