[openbeos] Re: Help with built-in profiling

Stephan Assmus <superstippi@xxxxxx> wrote:
> can someone here help me a bit to get on track with profiling? I have 
> successfully built the app_server in the test environment using the -
> pg GCC 
> switch. You have to provide an "mcount" function or link everything 
> against 
> "/boot/develop/lib/x86/i386-mcount.o". The resulting executable runs 
> very 

I think Be's compiler automatically added i386-mcount.o to the 
executable, at least I can't remember needing it in the past. However, 
it still works with Oliver's GCC just fine when linked manually.

Anyway, for our current compiler, both -p and -pg result in the same 
output. After having run the application, you'll find a file called 
"profile_log.*" in the directory of the application.
To examine it, you would normally use gprof, but since that's not part 
of BeOS, you have to use "bprof" on that profile log, and it will tell 
where the app has spent its time.

"profile" OTOH is called on an application without the -p option 
enabled - it periodically tests where the application is, and when it 
quits, it will dump its results on stdout.

Bye,
   Axel.


Other related posts: