gprof使用说明

http://www.cs.utah.edu/dept/old/texinfo/as/gprof.html
gcc使用 -pg 参数编译程序
gcc -o test test.c -g -pg
编译成功后运行程序,会在当前目录下生成gmon.out文件
./test
使用gprof和gmon.out运行程序
gprof test gmon.out
这时将输出程序的性能信息

你可能感兴趣的:(gcc)