Gprof allows for profiling a program, and analyze where the program passes most of its time in order to imporve the performace by modifying the code. The program must be compiled with a
profiling option or available in the sourcecode. Then
you will do a test run to collect profiling data. The results will be based on this test run.
Official Homepage