Hi,
Recently I am trying to use gprof to profile my application on the board, but encounter some problem with grof, currently I can get gmon.out file, but I use 'gprof a.out gmon.out > log', I find out that gprof only show how many times each function has been called, but missing most important factor, each function always occupy 0 cpu time, this is so strange.
My arm linux cross-compiler info:
gcc-4.1.2
libc-2.5
binutils 2.18
So what's the problem with gprof, anybody can help me, thanks!
Code:
#include <stdio.h>
void func()
{
int i = 0;
int j = 0;
while(i < 10000000){
i++;
j += i;
}
return;
}
int main()
{
func();
return 0;
}
gprof result
Code:
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 1 0.00 0.00 func
...............