bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gprof call counts wrong in multithreaded program


From: Kalle Olavi Niemitalo
Subject: Re: gprof call counts wrong in multithreaded program
Date: Sun, 30 May 2010 11:07:39 +0300
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.51 (gnu/linux)

Hi, Nick.  You write:

> How do you feel about the attached patch to update the documentation ?

It is an improvement, but I think it would be even better to
specifically mention glibc.  Usually, I expect GNU programs to
work best with glibc and GCC; if you just warn that the counting
function might not be thread-safe, then users might assume that
the warning applies to some propietary C libraries that GNU
policies prevent you from naming.

On the other hand, if the user has already noticed that the call
counts vary, and is reading the manual to find the reason, then
your proposed wording would give the user the hint to look at
threads and the mcount implementation.  I am afraid that many
users would have difficulty finding out whether the mcount they
are using is thread-safe or not, but perhaps the problem does not
come up that often and users hitting it will already be skilled
with the debugger.

The most thread-safe version of mcount seems to be in NetBSD.
It allocates separate counters for each thread and sums them when
the threads exit.  That implementation carries a non-UCB
advertising clause, though.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]