Cygwin 1.5.25: gprof time accumulation problem

David Donovan donovand@gmail.com
Mon Aug 4 22:22:00 GMT 2008


Dear Cygwin,

I am having difficulties using gprof under cygwin.  When I try to
profile the following code, taken from IBM's developerWorks
(http://www.ibm.com/developerworks/library/l-gnuprof.html) using
gprof, I get "no time accumlated".  The number of calls to the various
functions are correct, but I get no timing information whatsoever.

Someone else reported this as a problem on the list back in June 2008,
where the respondent suggested that the code execution was faster than
the resolution of gprof's timing interval (0.1ms).   In this
situation, this is not the case, as I ran the code with 500000
iterations and the user time was much larger than 0.1ms as reported by
"time".

At this point, I'm stumped.  Is anyone else having problems with gprof?

Any suggestions would be greatly appreiciated.

Best Regards,
David Donovan

Example code follows, and my cygcheck.out is attached:

#include <stdio.h>
int a(void) {
  int i=0,g=0;
  while(i++<100000)
  {
     g+=i;
  }
  return g;
}
int b(void) {
  int i=0,g=0;
  while(i++<400000)
  {
    g+=i;
  }
  return g;
}

int main(int argc, char** argv)
{
   int iterations;

   if(argc != 2)
   {
      printf("Usage %s <No of Iterations>\n", argv[0]);
      exit(-1);
   }
   else
      iterations = atoi(argv[1]);

   printf("No of iterations = %d\n", iterations);

   while(iterations--)
   {
      a();
      b();
   }
   return 1;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygcheck.out
Type: application/octet-stream
Size: 68204 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20080804/7e79eed9/attachment.obj>
-------------- next part --------------
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


More information about the Cygwin mailing list