]> git.proxmox.com Git - ceph.git/blob - ceph/doc/rados/troubleshooting/cpu-profiling.rst
update ceph source to reef 18.2.1
[ceph.git] / ceph / doc / rados / troubleshooting / cpu-profiling.rst
1 ===============
2 CPU Profiling
3 ===============
4
5 If you built Ceph from source and compiled Ceph for use with `oprofile`_
6 you can profile Ceph's CPU usage. See `Installing Oprofile`_ for details.
7
8
9 Initializing oprofile
10 =====================
11
12 ``oprofile`` must be initalized the first time it is used. Locate the
13 ``vmlinux`` image that corresponds to the kernel you are running:
14
15 .. prompt:: bash $
16
17 ls /boot
18 sudo opcontrol --init
19 sudo opcontrol --setup --vmlinux={path-to-image} --separate=library --callgraph=6
20
21
22 Starting oprofile
23 =================
24
25 Run the following command to start ``oprofile``:
26
27 .. prompt:: bash $
28
29 opcontrol --start
30
31
32 Stopping oprofile
33 =================
34
35 Run the following command to stop ``oprofile``:
36
37 .. prompt:: bash $
38
39 opcontrol --stop
40
41
42 Retrieving oprofile Results
43 ===========================
44
45 Run the following command to retrieve the top ``cmon`` results:
46
47 .. prompt:: bash $
48
49 opreport -gal ./cmon | less
50
51
52 Run the following command to retrieve the top ``cmon`` results, with call
53 graphs attached:
54
55 .. prompt:: bash $
56
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.
62
63
64 Resetting oprofile
65 ==================
66
67 Run the following command to reset ``oprofile``:
68
69 .. prompt:: bash $
70
71 sudo opcontrol --reset
72
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.
76
77 .. _oprofile: http://oprofile.sourceforge.net/about/
78 .. _Installing Oprofile: ../../../dev/cpu-profiler
79
80