doc/rados/troubleshooting/cpu-profiling.rst
If you built Ceph from source and compiled Ceph for use with oprofile_
you can profile Ceph's CPU usage. See Installing Oprofile_ for details.
oprofile must be initalized the first time it is used. Locate the
vmlinux image that corresponds to the kernel you are running:
.. prompt:: bash $
ls /boot sudo opcontrol --init sudo opcontrol --setup --vmlinux={path-to-image} --separate=library --callgraph=6
Run the following command to start oprofile:
.. prompt:: bash $
opcontrol --start
Run the following command to stop oprofile:
.. prompt:: bash $
opcontrol --stop
Run the following command to retrieve the top cmon results:
.. prompt:: bash $
opreport -gal ./cmon | less
Run the following command to retrieve the top cmon results, with call
graphs attached:
.. prompt:: bash $
opreport -cal ./cmon | less
.. important:: After you have reviewed the results, reset oprofile before
running it again. The act of resetting oprofile removes data from the
session directory.
Run the following command to reset oprofile:
.. prompt:: bash $
sudo opcontrol --reset
.. important:: Reset oprofile after analyzing data. This ensures that
results from prior tests do not get mixed in with the results of the current
test.
.. _oprofile: http://oprofile.sourceforge.net/about/ .. _Installing Oprofile: ../../../dev/cpu-profiler