In the process of using gprof to profile a C++ program I\'ve written, I\'ve noticed that the vast majority of execution time is spent in the function \"frame_dummy\". More preci
I encountered the same issue, here is my output from gprof:
% cumulative self self total
time seconds seconds calls ms/call ms/call name
52.00 16.27 16.27 204000 0.08 0.08 frame_dummy
47.46 31.12 14.85 418000 0.04 0.07 f2
0.51 31.28 0.16 21800 0.01 1.42 f1
0.03 31.29 0.01 1980 0.01 14.21 f5
In my case, it got resolved when I compiled with gcc -Os
instead of gcc -O3
:
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls ms/call ms/call name
53.12 22.24 22.24 200000 0.11 0.11 f4
45.65 41.36 19.11 598000 0.03 0.03 f2
0.69 41.65 0.29 20000 0.01 1.45 f3
0.45 41.84 0.19 39800 0.00 0.32 f1
0.10 41.88 0.04 evaluate
That is, gprof mistook f4
for frame_dummy
.