Debugging and profiling: Difference between revisions

Jump to navigation Jump to search
Line 36: Line 36:
Note that if your code changes current directory, then gmon.out will be created in the new working directory. Furthermore, your program should have sufficient permissions for gmon.out to be generated.
Note that if your code changes current directory, then gmon.out will be created in the new working directory. Furthermore, your program should have sufficient permissions for gmon.out to be generated.


==== Get the profiling plot ====
==== Get the profiling data ====
In this step the Gprof tool is executed again with the binary name and the above mentioned ‘gmon.out’ as argument. This should create an analysis file with all the desired profiling information.
In this step the Gprof tool is executed again with the binary name and the above mentioned ‘gmon.out’ as argument. This should create an analysis file with all the desired profiling information.
{{Command|gprof /path/to/your/executable gmon.out > analysis.txt}}
{{Command|gprof /path/to/your/executable gmon.out > analysis.txt}}
Bureaucrats, cc_docs_admin, cc_staff
337

edits

Navigation menu