LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-25-2008, 05:28 AM   #1
soararing
LQ Newbie
 
Registered: Jul 2005
Posts: 13

Rep: Reputation: 0
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

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

Last edited by soararing; 08-25-2008 at 05:29 AM.
 
Old 08-26-2008, 03:45 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
Insert one more 0 in the loop and check. For me the code works fine, maybe the resolution is too low for your machine?
 
Old 08-27-2008, 12:49 AM   #3
soararing
LQ Newbie
 
Registered: Jul 2005
Posts: 13

Original Poster
Rep: Reputation: 0
I have tried, nothing happens, thanks!
Quote:
Originally Posted by Mara View Post
Insert one more 0 in the loop and check. For me the code works fine, maybe the resolution is too low for your machine?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
gnu arm issue in linking "__inline" methods RPDP Programming 10 09-30-2006 07:11 AM
running "hello world" in ARM Integrator Board ayeong Linux - Newbie 4 09-12-2006 02:01 AM
"My posts" and "My threads" should be exempt from the wait time before searches vharishankar LQ Suggestions & Feedback 6 03-06-2006 08:10 PM
Where to download precompiled bash binaries, such as "time" and "top"? elinuxqs Linux - Newbie 12 11-14-2005 08:36 PM
Lost DHCP Lease when putting computer in "Standby" mode for a "long" time pnellesen Linux - Networking 1 01-06-2005 11:44 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration