Performance is one of the biggest challenges programmers face while developing software. That is the reason why code profiling is one of the most important aspects of software development, as it lets you identify bottlenecks, dead code, and even bugs. Schneider Electric Unity Pro Demo here.
If you are a programmer who develops software applications for Linux, the GNU profiler “gprof” is the tool to look out for. Download and Install Gprof comes pre-installed with most of the Linux distributions, but if that’s not the case with your Linux distro, you can download and install it through a command line package manager like apt-get or yum. For example, run the following command to download and install gprof on Debian-based systems. Gprof test gmon.out >prof_output This command writes all the profiling information in human readable format to 'prof_output' file.
Note that you can change the output file name as per your convenience. Flat profile and Call graph If you open the file containing profiling data, you'll see that the information is divided into two parts: Flat profile and Call graph. While the former contains details like function call counts, total execution time spent in a function, and more, the latter describes the call tree of the program, providing details about the parent and child functions of a particular function.