gprof -l -C objfile | sort -k 3 -n -rThis listing will show you the lines in your code executed most often, but not necessarily those that consumed the most time.
gprof -l
and lookup the function in the call graph.
The callers will be broken down by function and line number.
for i in `seq 1 100`; do fastprog mv gmon.out gmon.out.$i done gprof -s fastprog gmon.out.* gprof fastprog gmon.sumIf your program is completely deterministic, all the call counts will be simple multiples of 100 (i.e. a function called once in each run will appear with a call count of 100).
Go to the first, previous, next, last section, table of contents.