Messages in this thread | | | Date | Thu, 14 Mar 2002 02:08:34 -0500 | From | Jakub Jelinek <> | Subject | Re: libc/1427: gprof does not profile threads <synopsis of the problem (one li\ne)> |
| |
On Wed, Mar 13, 2002 at 04:19:02PM -0800, Dan Kegel wrote: > Ulrich Drepper wrote: > > > > On Wed, 2002-03-13 at 15:17, Dan Kegel wrote: > > > > > So let's break the logjam and fix glibc's linuxthreads' pthread_create > > > to [support profiling multithreaded programs] > > > > I will add nothing like this. The implementation is broken enough and > > any addition just makes it worse. If you patch your own code you'll get > > what you want at your own risk. > > OK. What's the right way to fix this, then?
Surely don't use timer for profiling. Have the compiler generate profiling calls both at function entry and exit and use rdtsc/whatever other register your machine has (or even better profiling registers) to note time of that function being entered/left.
Jakub - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |