Re: libc/1427: gprof does not profile threads on linux

Dan Kegel (dank@kegel.com)
Thu, 06 Dec 2001 15:24:31 -0800


There is a longstanding bug against glibc
related to gprof support on multithreaded programs on linux:
http://bugs.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=default&pr=1427

The glibc maintainer's feeling at the time was that it was
linux's fault for having nonstandard signal semantics for
multithreaded programs. This is certainly a valid viewpoint.

Pragmatically, however, there is a simple workaround, documented at
http://sam.zoy.org/doc/programming/gprof.html
which works by putting a small wrapper around pthread_create.
(I haven't tested it myself, but it seems reasonable.)

Is it not time for glibc to incorporate this workaround when
building for Linux? That would get gprof working for now,
and if Linux ever changes its pthread signal semantics, the
workaround can be dropped.

Comments?
- Dan
-
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/