This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [patch] Remove sprof default installation
On Wed, 13 Aug 2008 17:45:43 +0200, Carlos O'Donell wrote:
> On Wed, Aug 13, 2008 at 9:37 AM, Olivier Fourdan <ofourdan@redhat.com> wrote:
> >> As gprof/-pg/sprof is now obsoleted by oprofile suggesting to start
> >> removing its support rather than fixing it.
>
> I don't think gprof is obsolete. Did you talk to the community about
> this? Is this documented somewhere?
For gprof (-pg) one needs to build the binary as -static and with all the
libraries with -pg as otherwise the missing profiling points may skew the
results too much.
Contrary to it oprofile runs without -pg and even without -static. Just
unfortunately currently oprofile requires -fno-omit-frame-pointer which is
default on x86 but no longer on x86_64.
The oprofile x86_64 unwinding problem will be fixed while -pg would need to
start supporting simultaneous profiling of multiple contiguous memory regions
to properly support shared libraries and still one would have to rebuild the
binary incl. its libraries with -pg.
> > I have just opened yesterday a bugzilla to fix sprof in glibc with a
> > proposed patch (see bug#458861)
> >
> > That patch for glibc is trivial seem to work fine.
>
> Which bugzilla? I would like to have a look at your patch. Thanks.
Olivier F. did mean:
https://bugzilla.redhat.com/show_bug.cgi?id=458861
Unfortunately it does not work so simply for me with latest glibc as it
will crash on:
Inconsistency detected by ld.so: dl-open.c: 652: _dl_open: Assertion `_dl_debug_initialize (0, args.nsid)->r_state == RT_CONSISTENT' failed!
which would need at least:
--- glibc-20080802T0809/elf/dl-load.c 2008-07-26 10:40:05.000000000 +0200
+++ glibc-20080802T0809-x/elf/dl-load.c 2008-08-12 19:54:56.000000000 +0200
@@ -937,7 +937,9 @@ _dl_map_object_from_fd (const char *name
#endif
/* Signal that we are going to add new objects. */
- if (r->r_state == RT_CONSISTENT)
+ if (mode & __RTLD_SPROF)
+ ;
+ else if (r->r_state == RT_CONSISTENT)
{
#ifdef SHARED
/* Auditing checkpoint: we are going to add new objects. */
but I did not continue with the patching.
Regards,
Jan