Problem description
===================
Function names are mangled in gprof output. Such name mangling in gprof
output only occurs when compiling with g++ under 64 bit modes

Compiler output
===============
The name HelloWorld is mangled.

Flat profile:

Each sample counts as 0.01 seconds.
 no time accumulated

  %   cumulative   self              self     total
 time   seconds   seconds    calls  Ts/call  Ts/call  name
  0.00      0.00     0.00        7     0.00     0.00  ._Z10HelloWorldv
  0.00      0.00     0.00        1     0.00     0.00  .__gmon_start__
^L                        Call graph


granularity: each sample hit covers 4 byte(s) no time propagated

index % time    self  children    called     name
                0.00    0.00       7/7           .main [9]
[1]      0.0    0.00    0.00       7         ._Z10HelloWorldv [1]
-----------------------------------------------
                                   1             .__gmon_start__ [2]
                0.00    0.00       1/1           .atexit [8]
[2]      0.0    0.00    0.00       1+1       .__gmon_start__ [2]
                                   1             .__gmon_start__ [2]
-----------------------------------------------
^L
Index by function name

   [1] ._Z10HelloWorldv        [2] .__gmon_start__Expected output
===============

Flat profile:

Each sample counts as 0.01 seconds.
 no time accumulated

  %   cumulative   self              self     total
 time   seconds   seconds    calls  Ts/call  Ts/call  name
  0.00      0.00     0.00        7     0.00     0.00  HelloWorld()
  0.00      0.00     0.00        1     0.00     0.00  global constructors keyed
to _Z10HelloWorldv
  0.00      0.00     0.00        1     0.00     0.00 
__static_initialization_and_destruction_0(int, int)
^L


                        Call graph


granularity: each sample hit covers 4 byte(s) no time propagated

index % time    self  children    called     name
                0.00    0.00       7/7           main [10]
[11]     0.0    0.00    0.00       7         HelloWorld() [11]
-----------------------------------------------
                0.00    0.00       1/1           __do_global_ctors_aux [14]
[12]     0.0    0.00    0.00       1         global constructors keyed to
_Z10HelloWorldv [12]
                0.00    0.00       1/1          
__static_initialization_and_destruction_0(int, int) [13]
-----------------------------------------------
                0.00    0.00       1/1           global constructors keyed to
_Z10HelloWorldv [12]
[13]     0.0    0.00    0.00       1        
__static_initialization_and_destruction_0(int, int) [13]
-----------------------------------------------
^L
Index by function name

  [12] global constructors keyed to _Z10HelloWorldv [11] HelloWorld() [13]
__static_initialization_and_destruction_0(int, int)


Steps to reproduce the problem
==============================
#
/usr/bin/g++ -m64 -pg -o hello hello.C >STEP1.out 2>&1
#
./hello >hello.out 2>STEP2.out
#
/usr/bin/gprof -b hello gmon.out >gprof.out 2>STEP6.out

/* Listing of hello.C */
#include <stream.h>

void HelloWorld()
{
        cout << "Hello, World\n";
}
int main()
{
        for(int i=0; i<7; i++)
                HelloWorld();
        return(0);
}


-- 
           Summary: gprof names are mangled under 64 bit compilation
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: gcov-profile
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: vkywong at ca dot ibm dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31624

Reply via email to