Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Dec 2007 11:22:37 -0800
From:      Garrett Cooper <youshi10@u.washington.edu>
To:        Nikos Ntarmos <ntarmos@ceid.upatras.gr>
Cc:        current@freebsd.org
Subject:   Re: gprof's broken in 7-CURRENT
Message-ID:  <A4F76BFD-E5BB-462A-ABA1-BE79FDC88469@u.washington.edu>
In-Reply-To: <20071201191324.GA90389@ace.netcins.ceid.upatras.gr>
References:  <C2D2A8C6-8B39-4359-B968-0B52786B12EB@u.washington.edu> <20071201165946.GA13320@ace.netcins.ceid.upatras.gr> <20071201191324.GA90389@ace.netcins.ceid.upatras.gr>

next in thread | previous in thread | raw e-mail | index | archive | help
On Dec 1, 2007, at 11:13 AM, Nikos Ntarmos wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Sat, Dec 01, 2007 at 06:59:46PM +0200, Nikos Ntarmos wrote:
>> I just finished a cvsup/buildworld/installworld cycle and tried
>> executing a CFLAGS+=-pg compiled version of pkg_info. Except from the
>> (initially confusing) fact that pkg_info chdir(2)'s into every port's
>> directory under /var/db/pkg and thus pkg_info.gmon is created in the
>> dir of the last visited port, gprof didn't segfault or whatever.
>>
>> However, I now see an artifact, not present previously in my BETA1
>> world: .mcount seems to be taking the best part of the time  
>> percentage
>> in the flat profile section. FYI I've done a 'pkg_info -a >/dev/null'
>> and put the output of 'gprof /path/to/profiled/pkg_info  
>> pkg_info.gmon'
>> online at http://ntarmos.dyndns.org/Misc/pkg_info.gprof. I also see
>> this with my other -pg compiled code, so this is due to either
>> something that changed between BETA1 and now, or some of the (just
>> rebuilt) libraries taking up the change in profile.h.
>
> Interestingly, the .mcount flatprofline is substituted by _mcleanup if
> pkg_info is compiled -O1 -- see [1]. If it is then compiled -O0, the
> output is as in [2] (i.e. no .mcount and no _mcleanup). I guess  
> there's
> something I don't get wrt optimization levels and profiling,  
> although I
> can't quite see the connection. After all, .mcount and _mcleanup are
> explicitly excluded by default (usr.bin/gprof/elf.c:59,
> usr.bin/gprof/aout.c:61).
>
> \n\n
>
> [1] http://ntarmos.dyndns.org/Misc/pkg_info.gprof.O1
> [2] http://ntarmos.dyndns.org/Misc/pkg_info.gprof.O0
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.4 (FreeBSD)
> Comment: Nikos Ntarmos <ntarmos@ceid.upatras.gr>
>
> iD8DBQFHUbJUm6J1ac+VFgoRAmD8AJ9Ut3XoJVJwZ22OsArviKHjH4dsGwCeN4T4
> ECtTFTRuhQI/GVlny+VifyU=
> =NSTP
> -----END PGP SIGNATURE-----


	Strange. Maybe there are some inconsistencies between my system and  
an up-to-date system, or maybe I'm just using gprof incorrectly.  
Could you show me how you ran pkg_info with gprof please?
Thanks,
-Garrett



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?A4F76BFD-E5BB-462A-ABA1-BE79FDC88469>