Bug 238920 - No accumulated time in gprof
Summary: No accumulated time in gprof
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: binutils
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-05-03 20:51 UTC by Daryll
Modified: 2007-11-30 22:12 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-05-23 14:40:56 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Daryll 2007-05-03 20:51:10 UTC
Fedora 7 test 4
2.6.12-1.1381_FC3smp
binutils-2.15.92.0.2-5.1

If I compile a piece of code with -pg and run it, a gmon.out is created. Then
when I look at the results, the number of calls of each function appears to be
correct, but they show no accumulated time.

Comment 1 Jakub Jelinek 2007-05-23 14:03:38 UTC
binutils-2.15.92.0.2 certainly aren't shipped on F7, nor such old kernel.
And I certainly can see non-zero accumulated time in F7 (or FC6).  E.g.:
$ cat > ux.c <<EOF
void
foo (void)
{
  int i;
  for (i = 0; i < 10000000; i++)
    asm volatile ("");
}
void
bar (void)
{
  int i;
  for (i = 0; i < 100000000; i++)
    asm volatile ("");
}
int
main (void)
{
  foo ();
  bar ();
  return 0;
}
EOF
$ gcc -pg -g -o ux ux.c
$ rm gmon.out
$ ./ux
$ gprof ./ux gmon.out 2>&1 | head -n 10
Flat profile:

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total
 time   seconds   seconds    calls  ms/call  ms/call  name
 89.46      0.24     0.24        1   241.53   241.53  bar
 11.18      0.27     0.03        1    30.19    30.19  foo

 %         the percentage of the total running time of the
time       program used by this function.

Maybe your accumulated times are too low?


Comment 2 Daryll 2007-05-23 14:40:56 UTC
My bad. I grabbed the version output from the wrong box.
But my test case wasn't accumulating user space time.
Your example worked fine, so this is not a bug.




Note You need to log in before you can comment on or make changes to this bug.