Files
Programming_Tips/profiling.md

797 B

Profiling on Linux

Simple tips for software profiling using Linux.

Simple steps on using gprof:

gprof is a really efficient prototyping tool designed by Richard Stallman

It is a total graal to exactly know where your bottlenecks are, and which parts of your software have to be optimized first!

  • Simply install gprof on your computer (for debian based distros).
$ sudo apt-get install gprof
  • Compile your C code with the -pg option
  • Execute your program, just as usual

You will see that a gmon.out file was created during the execution You can retrieve the results of profiling by running gprof:

$ gprof your_binary gmon.out >> saved_report

and then read the result

$ vim saved_report