使用Gnu gprof进行Linux平台下的程序分析
http://www.pcdog.com/edu/linux/18/10/u231314_1.html http://www.pcdog.com/edu/linux/18/10/u231314_2.html http://www.pcdog.com/edu/linux/18/10/u231314_3.html Compile source .c code for analysis, Create executable file: >> gcc -pg test.c -o test 2. Launch executable file, Create gmon.out >> ./test 3. Use gmon.out to analysis: >> gprof -b test gmon.out | less or: >> gprof -b test gmon.out | more 4. 常用的Gprof 命令选项解释: -b不再输出统计图表中每个字段的详细描述。 -p 只输出函数的调用图(Call graph 的那部分信息)。 -q 只输出函数的时间消耗列表。 -E Name不再输出函数Name 及其子函数的调用图,此标志类似于 -e 标志,但它在总时间和百分比时间的计算中排除了由函数Name 及其子函数所用的时间。
…