]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
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 | ||
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 | ||
22 | Starting oprofile | |
23 | ================= | |
24 | ||
aee94f69 | 25 | Run the following command to start ``oprofile``: |
7c673cae | 26 | |
aee94f69 | 27 | .. prompt:: bash $ |
7c673cae | 28 | |
aee94f69 | 29 | opcontrol --start |
7c673cae FG |
30 | |
31 | ||
32 | Stopping oprofile | |
33 | ================= | |
34 | ||
aee94f69 TL |
35 | Run the following command to stop ``oprofile``: |
36 | ||
37 | .. prompt:: bash $ | |
7c673cae | 38 | |
aee94f69 TL |
39 | opcontrol --stop |
40 | ||
41 | ||
7c673cae FG |
42 | Retrieving oprofile Results |
43 | =========================== | |
44 | ||
aee94f69 TL |
45 | Run the following command to retrieve the top ``cmon`` results: |
46 | ||
47 | .. prompt:: bash $ | |
48 | ||
49 | opreport -gal ./cmon | less | |
50 | ||
7c673cae | 51 | |
aee94f69 TL |
52 | Run the following command to retrieve the top ``cmon`` results, with call |
53 | graphs 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 | ||
64 | Resetting oprofile | |
65 | ================== | |
66 | ||
aee94f69 | 67 | Run 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 |