Bureaucrats, cc_docs_admin, cc_staff
2,318
edits
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
=GNU Profiler (gprof) = | =GNU Profiler (gprof) = | ||
== What is Gprof ? == | == What is Gprof ? == | ||
Line 9: | Line 9: | ||
=== Switch to GNU compiler === | === Switch to GNU compiler === | ||
Load the appropriate GNU compiler. For example, for GCC: | Load the appropriate GNU compiler. For example, for GCC: | ||
{{Command|module load gcc/ | {{Command|module load gcc/7.3.0}} | ||
=== Compile your code === | === Compile your code === | ||
Line 25: | Line 25: | ||
In this step the Gprof tool is executed again with the binary name and the above mentioned <tt>gmon.out</tt> 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 <tt>gmon.out</tt> 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}} | ||
We can | We can see that the new file <tt>analysis.txt</tt> has been created in the current working directory. |