Can gprof be used to profile a multi-threaded program that uses pthreads? That is, will its output include the time used in all the threads?
Yes, it is possible with the help of a workaround described here.