linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "M. Edward Borasky" <znmeb@aracnet.com>
To: <bug-binutils@gnu.org>, <linux-kernel@vger.kernel.org>,
	<gcc-bugs@gcc.gnu.org>
Cc: <jonathan.bright@onebox.com>, <aron@cs.rice.edu>
Subject: gprof, threads and forks
Date: Wed, 5 Sep 2001 20:04:00 -0700	[thread overview]
Message-ID: <HBEHIIBBKKNOBLMPKCBBEEKODKAA.znmeb@aracnet.com> (raw)

It's rare that I cross-post to this many lists, but

1. I blew a week trying to track this little monster down, and
2. It isn't at all clear to me where the appropriate fixes and documentation
changes need to be applied.

So here goes:

If you have an executable compiled with *gcc* using the "-pg" option, it is
supposed to generate a "gmon.out" file, which you can later process with the
*binutils* utility "gprof" to produce a profile. All this magic works just
dandy for a single threaded executable, but apparently child threads and
child processes created with "fork" don't get their execution time counted.
See the following links for the gory details:

http://sources.redhat.com/ml/bug-binutils/2001-q3/msg00090.html

http://uwsg.iu.edu/hypermail/linux/kernel/0101.3/1516.html

The second link implies that it's possible to fix this at the *kernel*
level. So my question to all of you is, "what's the best way to get this
fixed?" I need to profile a multi-threaded executable and personally don't
care about the "fork" case, but I'm sure there are others who would care
about forks and not threads.
--
M. Edward (Ed) Borasky, Chief Scientist, Borasky Research
http://www.borasky-research.net  http://www.aracnet.com/~znmeb
mailto:znmeb@borasky-research.com  mailto:znmeb@aracnet.com

Stand-Up Comedy: Because Man Does Not Live By Dread Alone


             reply	other threads:[~2001-09-06  3:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-06  3:04 M. Edward Borasky [this message]
2001-09-06  3:11 ` gprof, threads and forks Mike Fedyk
2001-09-06  3:42 ` Ian Lance Taylor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=HBEHIIBBKKNOBLMPKCBBEEKODKAA.znmeb@aracnet.com \
    --to=znmeb@aracnet.com \
    --cc=aron@cs.rice.edu \
    --cc=bug-binutils@gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    --cc=jonathan.bright@onebox.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).