http://blog.csdn.net/yetyongjin/article/details/7717464
带-pg编译程序$ gcc -pg -o test test.c先运行程序$ ./test让mkgraph.sh可以运行$ chmod +x mkgraph.sh通过gprof产生函数调用图并导出为dot图形$ gprof ./test gmon.out -bq | ./mkgraph.sh > mkgraph.dot把DOT图转换为jpg格式$ dot -Tjpg mkgraph.dot -o mkgraph.jpg