Profiling with gprof


Next
Last

Index
Text
  
 Compile with -pg option to add profiling info:

   >gcc -pg -o My_prog My_prog.c 

 Run the program: My_prog
 Output written to file: gmon.out
 Run gprof:

   >gprof My_prog gmon.out
 

Debugging and Profiling