This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


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

Re: gprof prints incorrect results



----- Original Message -----
From: "Francois Colbert" <francois.colbert@videotron.ca>
To: <cygwin@cygwin.com>
Sent: Wednesday, July 25, 2001 9:27 PM
Subject: gprof prints incorrect results


> Hi.
>
> I tried to use the gprof utility, but I was unable to get useful
> results with the Cygwin version.
>
> I made a simple test program (see below: prof.cpp) and tried to
> profile it on a Linux system (with pre-installed utilities) and on a
> Windows system (with Cygwin utilities: gprof version 2.11.90, gcc
> version 2.95.2-6.).  On each platform, I compiled the program using
> the command line
>
>    gcc -pg prof.cpp -o prof.exe
>
> I executed prof.exe to generate a gmon.out file, and then I ran gprof
> using the command line
>
>    gprof --brief prof.exe gmon.out > prof-win32.txt
>
> under Windows, and
>
>    gprof --brief prof.exe gmon.out > prof-linux.txt
>
> under Linux.
>
>
> The two resulting text files, prof-win32.txt and prof-linux.txt, are
> listed below.  I didn't expect the timing data to be similar, because
> they are the result of the execution of two different executables in
> two different contexts.
>
> Nonetheless, I expected the statistics related to the call graph to be
> exactly the same.  They aren't.  I identified the following anomalies
> in the prof-win32.txt file:
>
> 1- In the flat profile section, number-of-calls stats are missing.
>
> 2- In the call graph section, the last column doesn't show any useful
>    data, since every function either is "spontaneous" or appears to be
>    called only by itself.
>
> 3- In the functions index at the end of the file, the DoSomething
>    function is missing.  It wasn't missing for every execution of the
>    test program, though.
I expect this would be improved if you built the entire run-time library
with -pg.  The cygwin setup doesn't provide for automatically linking a
profiling version of the run-time.  A possible work-around is to build a
separate copy of the run-time libraries and link specifically against
those libraries.  Recursive calling will be "spontaneous" no matter what
you do.



--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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