Compilation
compile and link program using gcc/g++, without using ld command, with flag -pg
Autotools
for auto tools, clean project (make clean),
execute $> CFLAGS=-pg ./configure && make && sudo make install
Generation
execute the program /bin/prog.exe (or test suite), gmon.out file will be created in working directory
NOTE: gmon.out file will be created on program exit, killing the process, would not generate gmon.out
Post Processing
In order to generate profiling information from gmon.out, execute following command:
$> gprof /bin/prog.exe gmon.out > analyse.txt
Profiling information will be generated in analyse.txt file.
NOTE: provide complete path to program and complete path to gmon.out (here gmon.out is present in current directory)
compile and link program using gcc/g++, without using ld command, with flag -pg
Autotools
for auto tools, clean project (make clean),
execute $> CFLAGS=-pg ./configure && make && sudo make install
Generation
execute the program /bin/prog.exe (or test suite), gmon.out file will be created in working directory
NOTE: gmon.out file will be created on program exit, killing the process, would not generate gmon.out
Post Processing
In order to generate profiling information from gmon.out, execute following command:
$> gprof /bin/prog.exe gmon.out > analyse.txt
Profiling information will be generated in analyse.txt file.
NOTE: provide complete path to program and complete path to gmon.out (here gmon.out is present in current directory)