gprof使用方法
要分析的文件如test.c
[shell]
gcc -pg test.c
./a.out
gprof -b ./a.out
[/shell]
[shell]
Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls s/call s/call name
66.74 9.13 9.13 2 4.57 4.57 forf
33.26 13.68 4.55 main
0.00 13.68 0.00 1 0.00 0.00 s
[/shell]