Valgrind has a thread error detector:
http://valgrind.org/docs/manual/drd-manual.html
mutrace measures mutex contention
http://0pointer.de/blog/projects/mutrace.html
LTTng has a lot of cool features too.
System tap looks interesting too:
https://sourceware.org/systemtap/