From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Molenda To: Eli Zaretskii Cc: gdb-patches@sources.redhat.com, tromey@cygnus.com Subject: Re: [RFA] patch to add 'maint profile-gdb' command Date: Mon, 10 Sep 2001 13:59:00 -0000 Message-id: <20010910135756.A13905@shell17.ba.best.com> References: <20010910003022.A21681@shell17.ba.best.com> <3B9CE0C6.5060700@cygnus.com> <20010910115244.A25119@shell17.ba.best.com> <7263-Mon10Sep2001234038+0300-eliz@is.elta.co.il> X-SW-Source: 2001-09/msg00148.html On Mon, Sep 10, 2001 at 11:40:38PM +0300, Eli Zaretskii wrote: > > I'd disagree. First, these functions are not very portable. Our > > very own RH 6.2 box that is sourceware.cygnus.com does not have > > moncontrol() or monstart(), and -pg doesn't seem to be usable at > > all. My RH 7.1 box at home works fine. MacOS X's FreeBSD works > > fine. > > We could autoconfiscate this, couldn't we? We could detect whether moncontrol() exists or not, but there aren't any macros specifically related to profiling in automake/autoconf. I suppose we could have a test that would try to include a call to moncontrol() and see if it causes a link-time error when not paired with a -pg. I don't see the point -- without compiling the program with -pg, running moncontrol() is pointless. You're going to have an ifdef in main.c either way - either to check ENABLE_PROFILING or check HAVE_MONCONTROL - and profiling is not going to work unless you're specifically compiling gdb with profiling in mind. > > I just re-read the man page, it doesn't matter where it's disabled. The > > gmon.out file is going to be overwritten each time gdb is run no matter > > what. > > Not if we use monstartup: the file is not touched unless monstartup is > called. monstartup provides some information, but not everything that full profiling gets you. I think we should stick with linking -pg and using moncontrol(). Jason