Slide 7 of 24
Profiler:Compiling/Running/Getting Results
How to compile
- Use ‘-Mprof=func’ for function level profiling.
- Use ‘-Mprof=lines’ for basic block level profiling.
If you are compiling with ‘-O2’, then a basic block might be one to hundreds of source code lines. This option will slow performance maybe by 2x.
If you compile with ‘-O0’, the basic block is 1 line and performance will really suffer overheads, but the relative line number performance should be correct.
How to run
- Run the job as usual. Output files are put in subdirectory pmon.out in the current directory by default.
How to get results
- Run ‘profile’ (/usr/bin/profile).
- Run ‘profile -h’ for options.
Acknowledgement and Disclaimer