LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   gprof on arm-linux "no accumulated time problem" (https://www.linuxquestions.org/questions/programming-9/gprof-on-arm-linux-no-accumulated-time-problem-665201/)

soararing 08-25-2008 05:28 AM

gprof on arm-linux "no accumulated time problem"
 
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

...............


Mara 08-26-2008 03:45 PM

Insert one more 0 in the loop and check. For me the code works fine, maybe the resolution is too low for your machine?

soararing 08-27-2008 12:49 AM

I have tried, nothing happens, thanks!
Quote:

Originally Posted by Mara (Post 3260640)
Insert one more 0 in the loop and check. For me the code works fine, maybe the resolution is too low for your machine?



All times are GMT -5. The time now is 01:22 AM.