help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Makefile and gprof problem


From: RS
Subject: Makefile and gprof problem
Date: Tue, 26 Dec 2006 12:55:49 -0500
User-agent: Thunderbird 1.5.0.7 (Macintosh/20060909)

Hi all,

I have compiled my files using

CXX=g++
CCFLAGS=-O2 -Wall
.cpp.o:.hpp
        $(CXX) -c $(CCFLAGS) $*.cpp -pg

and linked them using

program: main.cxx libfoo
        $(CXX) $(CCFLAGS)  main.cxx -o $@ -lfoo -pg

The program compiles well. But I am not sure if it is the correct syntax to get it work with gprof. When I run ./program and then gprof program, all the function names are tangled as though they are not linked correctly, and I get something like this:

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

  %   cumulative   self              self     total
 time   seconds   seconds    calls  ms/call  ms/call  name
  0.0       0.00     0.00  7973033     0.00     0.00  __Z7Func1Pii [35]
  0.0       0.00     0.00  2367316     0.00     0.00  past end of text [1]
0.0 0.00 0.00 28 0.00 0.00 __Z17Func2IdLi1EEES8_ [36] 0.0 0.00 0.00 15 0.00 0.00 __Z10Func3EEEiiii [37]
.....
[snip]
...

So my question is 1) why the program compiles,links and runs correctly, but the name of the functions look so weired? and 2) why the total and self times show to be 0.00? The program takes 15 minutes to run and the whole reason I want to profile it is to find out how long the self times are in each function.

Thanks,
RS
gcc version 4.0.0 20041026 (Apple Computer, Inc. build 4061)
OSX 10.4.7




reply via email to

[Prev in Thread] Current Thread [Next in Thread]