Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Mac Programming / July 2006



Tip: Looking for answers? Try searching our database.

gprof reporting 0 seconds execution time

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dale Stanbrough - 08 Jul 2006 04:03 GMT
Just playing around with gprof and couldn't get it to produce any timing
info on 10.4.7 (on PPC). It does manage to provide correct function call
counts however.

The same program compiled and run on Solaris shows the timing info I was
expecting.

Compiling with

  gcc -pg file.c
  ./a.out
  gprof a.out gmon.out

Thanks,

Dale

Signature

dstanbro@spam.o.matic.bigpond.net.au

Mark - 09 Jul 2006 20:51 GMT
Use Shark instead of gprof to profile your program. gprof does not work
well on Mac OS X 10.4.
Dale Stanbrough - 13 Jul 2006 14:05 GMT
> Use Shark instead of gprof to profile your program. gprof does not work
> well on Mac OS X 10.4.

No good I'm afraid - i'm using it for demonstration purposes of how to
use gprof, not how to profile Mac programs per se.

Do you know why it doesn't work? I tried a free bsd machine the other
day and had the same problems.

Dale

Signature

dstanbro@spam.o.matic.bigpond.net.au

Mark - 13 Jul 2006 19:57 GMT
> Do you know why it doesn't work? I tried a free bsd machine the other
> day and had the same problems.

I don't know why. All I know is I've read several posts on various
message boards where people had the same problem you have. Nobody ever
came up with a solution, which leads me to conclude that gprof has big
problems on Mac OS X 10.4.
Joseph Gwinn - 14 Jul 2006 17:32 GMT
> > Do you know why it doesn't work? I tried a free bsd machine the other
> > day and had the same problems.
[quoted text clipped - 3 lines]
> came up with a solution, which leads me to conclude that gprof has big
> problems on Mac OS X 10.4.

I assume that gprof measure cpu time based on who was at bat when the
100-Hz (or 1000-Hz) interrupt ticked, probably mediated by a signal into
the process being monitored.  It sounds like this signal isn't
happening, for whatever reason.  Probably a setup issue.

Joe Gwinn
bdbkun@gmail.com - 27 Jul 2006 19:20 GMT
Gprof does not interrupt the process being monitored to determine
execution time. GCC introduces hooks at compile time to count how many
times the PC goes into each function, and how long it stays in each.
Gprof is just used to summarize and display the data.

GCC profiling operates in user-space with no specific requirement in
terms of kernel modules, signaling, etc.

Either the function call data is properly recorded as per the hooks put
in place by GCC, but then it is not properly displayed by gprof; or the
time data is not properly recorded by the GCC hooks.

Either way, this is a major pain for developers used to Unix systems.
Shark may be nice, but when you don't know it, when you already know
gprof and need to work in a console environment... It's a major
compatibility issue.

> > > Do you know why it doesn't work? I tried a free bsd machine the other
> > > day and had the same problems.
[quoted text clipped - 10 lines]
>
> Joe Gwinn
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.