On 29/02/2016 11:30, Navin Parakkal wrote: > Is there any way of measuring total wait time per mutex according to > wall clock per cpu ? > If the platform is linux can we do any better ? I'm not sure that gcc is the best tool for such a task. Here a few random suggestions: http://0pointer.de/blog/projects/mutrace.html https://stackoverflow.com/questions/1249711/how-to-measure-mutex-contention https://lwn.net/Articles/608497/ https://lttng.org/features/ https://sourceware.org/systemtap/wiki https://sourceware.org/systemtap/wiki/SystemtapDtraceComparison http://www.brendangregg.com/blog/2015-07-08/choosing-a-linux-tracer.html http://www.brendangregg.com/linuxperf.html Regards.