GNU Gprof profiling Tools

The motive of profiling is when developers develop the program, they need to know which information about the function, like how much time the function has been taken to execute. When developers and researchers are working on machine learning algorithms, it is more significant to acquire the information about the time because machine learning algorithms sometimes take hours. After developing the algorithm, they optimize the algorithm by getting information from profiling. Multiple profiling tools are available, and from that, some are free or open-source, and some are paid versions. 

Here we explain the GNU Gprof profiling tool that is a free version for all.


We take one program and do the profiling to gain more ideas about why it's so important.

To see the program click here:  see Program.


Quick guidance of the Gprof : 

    Step 1:  First, we have to compile a program with -pg flag 

                -> gcc -pg matrix.c -o matrix

           Note: matrix. c is the file name of the c program. 

    Step 2:  Run the program.

                -> ./matrix

    Step 3 :  save the profiling into analysis.out file

               -> gprof -b matrix gmon.out > analysis.out

    Step 4:  to just print 

                -> gprof ./matrix gmon.out

    Step 5: To see the profiling , open analysis.out file.



Comments