This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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: gprof stats without clean exit -> how?


Hi Alan,

> Is it possible to obtain a "current" gprof stats on a program
> without having the program do a clean exit -- i.e.,
> 
> -> dump stats
> -> abort()
> 
> sequence ?

It depends upon the particular implementation of the profiling library
functions.  For a C program they typically use atexit() to register a
dump-the-stats-and-tidy-up function, so you could arrange for you
program to call this function directly at the point where you want the
stats generated.  A C++ implementation will probably use a global
constructor/destructor so you would need to find a way to invoke the
destructor directly.

Cheers
        Nick


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