CPU Profiling

If you built Ceph from source and compiled Ceph for use with oprofileyou can profile Ceph’s CPU usage. See Installing Oprofile for details.

Initializing oprofile

The first time you use oprofile you need to initialize it. Locate thevmlinux image corresponding to the kernel you are now running.

  1. ls /boot
  2. sudo opcontrol --init
  3. sudo opcontrol --setup --vmlinux={path-to-image} --separate=library --callgraph=6

Starting oprofile

To start oprofile execute the following command:

  1. opcontrol --start

Once you start oprofile, you may run some tests with Ceph.

Stopping oprofile

To stop oprofile execute the following command:

  1. opcontrol --stop

Retrieving oprofile Results

To retrieve the top cmon results, execute the following command:

  1. opreport -gal ./cmon | less

To retrieve the top cmon results with call graphs attached, execute thefollowing command:

  1. opreport -cal ./cmon | less

Important

After reviewing results, you should reset oprofile beforerunning it again. Resetting oprofile removes data from the sessiondirectory.

Resetting oprofile

To reset oprofile, execute the following command:

  1. sudo opcontrol --reset

Important

You should reset oprofile after analyzing data so thatyou do not commingle results from different tests.