]> git.proxmox.com Git - ceph.git/blame - ceph/doc/rados/troubleshooting/cpu-profiling.rst
update ceph source to reef 18.2.1
[ceph.git] / ceph / doc / rados / troubleshooting / cpu-profiling.rst
CommitLineData
7c673cae
FG
1===============
2 CPU Profiling
3===============
4
5If you built Ceph from source and compiled Ceph for use with `oprofile`_
6you can profile Ceph's CPU usage. See `Installing Oprofile`_ for details.
7
8
9Initializing oprofile
10=====================
11
aee94f69
TL
12``oprofile`` must be initalized the first time it is used. Locate the
13``vmlinux`` image that corresponds to the kernel you are running:
7c673cae 14
aee94f69
TL
15.. prompt:: bash $
16
17 ls /boot
18 sudo opcontrol --init
19 sudo opcontrol --setup --vmlinux={path-to-image} --separate=library --callgraph=6
7c673cae
FG
20
21
22Starting oprofile
23=================
24
aee94f69 25Run the following command to start ``oprofile``:
7c673cae 26
aee94f69 27.. prompt:: bash $
7c673cae 28
aee94f69 29 opcontrol --start
7c673cae
FG
30
31
32Stopping oprofile
33=================
34
aee94f69
TL
35Run the following command to stop ``oprofile``:
36
37.. prompt:: bash $
7c673cae 38
aee94f69
TL
39 opcontrol --stop
40
41
7c673cae
FG
42Retrieving oprofile Results
43===========================
44
aee94f69
TL
45Run the following command to retrieve the top ``cmon`` results:
46
47.. prompt:: bash $
48
49 opreport -gal ./cmon | less
50
7c673cae 51
aee94f69
TL
52Run the following command to retrieve the top ``cmon`` results, with call
53graphs attached:
7c673cae 54
aee94f69 55.. prompt:: bash $
7c673cae 56
aee94f69
TL
57 opreport -cal ./cmon | less
58
59.. important:: After you have reviewed the results, reset ``oprofile`` before
60 running it again. The act of resetting ``oprofile`` removes data from the
61 session directory.
7c673cae
FG
62
63
64Resetting oprofile
65==================
66
aee94f69 67Run the following command to reset ``oprofile``:
7c673cae 68
aee94f69
TL
69.. prompt:: bash $
70
71 sudo opcontrol --reset
7c673cae 72
aee94f69
TL
73.. important:: Reset ``oprofile`` after analyzing data. This ensures that
74 results from prior tests do not get mixed in with the results of the current
75 test.
7c673cae
FG
76
77.. _oprofile: http://oprofile.sourceforge.net/about/
78.. _Installing Oprofile: ../../../dev/cpu-profiler
aee94f69
TL
79
80