#207 no profile info for main

closed-fixed
gcc (462)
2003-03-19
2002-11-01
Danny Smith
No

Hi.

I'm using gcc (GCC) 3.2 (mingw special 20020817-
1) and GNU gprof 2.13 from
the MinGW 2.0.0 distributions, and am having some
issues with profiling.

It appears that the profiler is not correctly
recording the function calls.

For example the simple program inserted at the end
of this message (compiled
with -pg) is producing the call graph info:

index % time self children called name

<spontaneous>
[1] 67.7 1.57 0.00 foo [1]
-----------------------------------------
------

<spontaneous>
[2] 32.3 0.75 0.00 bar [2]
-----------------------------------------
------
2000 main
[82]
[82] 0.0 0.00 0.00 0+2000
main [82]
2000 main
[82]
-----------------------------------------
------

Notice, that it is not recording that main called
those functions, nor how
many times they were called.

On my linux box (gcc --version 2.96; gprof --
version GNU gprof 2.11.90.0.8)
I get the correct info.

Is there something special I should know about
with MinGW?

Thanks for your help.

Dan

// sample application below

bar()
{
int i;
for(i = 0; i < 100000; i++);
}

foo()
{
int i;
for(i = 0; i < 200000; i++);
}

main()
{
int i;
for(i = 0; i < 1000; i++)
{
foo();
bar();
}
}

Discussion

  • Danny Smith

    Danny Smith - 2002-12-05
    • status: open --> closed-fixed
     
  • Danny Smith

    Danny Smith - 2002-12-05

    Logged In: YES
    user_id=11494

    Fixed in gcc sorces (3.2 and cygwin-mingw-3.2.1
    branches) I will check in fix to CVS trunk when it is
    open for non-regression fixes.

    Danny

     
  • Danny Smith

    Danny Smith - 2003-02-13

    Logged In: YES
    user_id=11494

    Its broken again.
    Danny

     
  • Danny Smith

    Danny Smith - 2003-02-13
    • status: closed-fixed --> open-fixed
     
  • Danny Smith

    Danny Smith - 2003-02-13

    Logged In: YES
    user_id=11494

    If build libgmon.a with gcc3.3, profiling is good for
    exes compiled with gcc3.2.2 and gcc3.3.

    If I build libgmon.a with gcc3.2.2, profiling is broken for
    3.2.2 and 3.3 compiled exes.

    Danny

     
  • Danny Smith

    Danny Smith - 2003-03-19

    Logged In: YES
    user_id=11494

    Should be fixed now.

     
  • Danny Smith

    Danny Smith - 2003-03-19
    • status: open-fixed --> closed-fixed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks