This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] patch to add 'maint profile-gdb' command
- To: Jason Molenda <jason-swarelist at molenda dot com>
- Subject: Re: [RFA] patch to add 'maint profile-gdb' command
- From: Eli Zaretskii <eliz at is dot elta dot co dot il>
- Date: Mon, 10 Sep 2001 09:50:38 +0200 (IST)
- cc: gdb-patches at sources dot redhat dot com, Tom Tromey <tromey at cygnus dot com>
On Mon, 10 Sep 2001, Jason Molenda wrote:
> This is a refresh of Tom Tromey's gdb profiling patch, originally here:
> http://sources.redhat.com/ml/gdb-patches/2000-q1/msg00022.html
Thanks! I think it's a very useful feature, but I have a few minor
comments.
> My only comments on this patch are (1) the documentation entry
> could note that your gmon.out file will be overwritten each time
> gdb is started, even if you don't do a profile-gdb on command[1], and
> (2) the configure.in check for $enable_profiling could be embedded
> in the AC_ARG_ENABLE() autoconf call. It doesn't make any practical
> difference, but it looks like tradition in gdb's configure.in is
> to include this code inside the AC_ARG_ENABLE call.
>
> [1] A bit of profiling happens before it can be turned
> off in captured_main(). This initial profiling will overwrite
> away any existing gmon.out. At least it does with the gprof
> on Linux and FreeBSD systems.
Isn't it better to use monstartup instead of moncontrol and -pg? It
looks like using monstartup could solve several problems:
- you don't overwrite gmon.out unless you actually profile
- you can link without -pg
- you can make this option available by default, since it is invisible
unless you actually profile (I dislike features that require a
rebuild to become available)
We will have to add Autoconf tests to see if monstartup is available, but
I think using moncontrol if --enable-profiling is given is not safe
enough anyway.
In addition, I think the commands this patch adds should be documented in
gdb.texinfo as well, since all commands one can type at GDB's prompt
should be described there.