This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC][PATCH] LD_DEBUG option to measure init time





> On Jul 30, 2015, at 8:53 PM, Carlos O'Donell <carlos@redhat.com> wrote:
> 
>> On 07/30/2015 08:59 AM, Maria Guseva wrote:
>> Currently the LD_DEBUG=statistics provides the total time spent in dynamic
>> linker and details it with relocation and load objects time. But other
>> useful information may be the time spent in init and init_array routines.
>> It may help to analyze the bottlenecks of application startup time. 
>> Attached (draft) patch measures the time of each call to .init and
>> .init_array entries in dl-init() for every loaded dso and cumulative time of
>> init() call for main executable. For each init function called also its
>> address is printed.  
> 
> Agreed.
> 
>> Would something like this be useful in mainline Glibc? If attitude is
>> generally positive I can work on more polished implementation.
> 
> I think the idea is a very good one. It's certainly useful information for
> application developers to have and it can be fed back into other tools.
> 
> The implementation needs polish. For example it should not do any timing
> unless DL_DEBUG_INITTIME is set.
> 
> What about time for finalizers? Same problem. Use a more generic flag
> e.g. DL_DEBUG_CTORDTOR_TIME to cover all cases.
> 
> Should LD_DEBUG=all enable this? Probably not.
> 
> Note that you need a patch to linux kernel man pages project to describe
> this new feature too.
> 
>> I'm also thinking about having such feature for platforms without HP timing
>> available, like arm. Some generic time measurements may be used e.g. via
>> clock_gettime syscall.
> 
> Yes please. That would be a requirement of acceptance, it should work on
> all machines.


Note aarch64 really should be using the virtual timer which is optional part of armv8 but not an optional part of the server base.  It is sad that arm is blocking a glibc patch due to it being an optional feature of v8 but is required for servers. 

Thanks,
Andrew

> 
> Cheers,
> Carlos.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]