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.
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?
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.