1. vi test.c
2. gcc -o test test.c -g -pg
3. ./test (执行这步可生成 gmon.out)
4. gprof test gmon.out > gprof.log (因为内容比较多,故我们让它重定向到一文件里,文件名任意)
1. vi test.c
2. gcc -o test test.c -g -pg
3. ./test (执行这步可生成 gmon.out)
4. gprof test gmon.out > gprof.log (因为内容比较多,故我们让它重定向到一文件里,文件名任意)