Difference between revisions of "HOWTO use oprofile"

From Nsnam
Jump to: navigation, search
(oprofile example)
 
Line 32: Line 32:
  
 
TBD
 
TBD
 +
 +
= Additional references =
 +
 +
* http://mailman.isi.edu/pipermail/ns-developers/2009-February/005290.html

Revision as of 18:14, 29 August 2012

Main Page - Current Development - Developer FAQ - Tools - Related Projects - Project Ideas - Summer Projects

Installation - Troubleshooting - User FAQ - HOWTOs - Samples - Models - Education - Contributed Code - Papers

This is a brief HOWTO on using oprofile to statistically sample the execution performance of an ns-3 program.

Background

Please read this tutorial on oprofile: http://ssvb.github.com/2011/08/23/yet-another-oprofile-tutorial.html

There are several open source profilers, including gprof, oprofile, sysprof, and valgrind. This HOWTO focuses on oprofile, which is a good tool for ns-3 because ns-3 programs are logic-heavy with lots of small functions and templates, and therefore a statistical profiler such as oprofile is more relevant than a profile that counts instructions such as gprof or valgrind.

Use

oprofile is available as a package on Linux distros (e.g. 'yum install oprofile').

First, it is strongly recommended to build ns-3 as optimized code before profiling.

 ./waf configure -d optimized --enable-examples --enable-static

Second, you will need to run as root. Third you will want to run the program outside of waf, which may require you to set the LD_LIBRARY_PATH variable to find the ns-3 libraries.

 # opcontrol --deinit
 # opcontrol --no-vmlinux
 # opcontrol --separate=kernel
 # opcontrol --init
 # opcontrol --reset
 # opcontrol --start
 # ./test-program
 # opcontrol --stop
 # opreport -l ./test-program

Example

TBD

Additional references