Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / doc / dev / perf.rst
1 Using perf
2 ==========
3
4 Top::
5
6   sudo perf top -p `pidof ceph-osd`
7
8 To capture some data with call graphs::
9
10   sudo perf record -p `pidof ceph-osd` -F 99 --call-graph dwarf -- sleep 60
11
12 To view by caller (where you can see what each top function calls)::
13
14   sudo perf report --call-graph caller
15
16 To view by callee (where you can see who calls each top function)::  
17
18   sudo perf report --call-graph callee
19
20 :note: If the caller/callee views look the same you may be
21        suffering from a kernel bug; upgrade to 4.8 or later.
22
23 Flamegraphs
24 -----------
25
26 First, get things set up::
27
28   cd ~/src
29   git clone https://github.com/brendangregg/FlameGraph
30
31 Run ceph, then record some perf data::
32
33   sudo perf record -p `pidof ceph-osd` -F 99 --call-graph dwarf -- sleep 60
34
35 Then generate the flamegraph::
36
37   sudo perf script | ~/src/FlameGraph/stackcollapse-perf.pl > /tmp/folded
38   ~/src/FlameGraph/flamegraph.pl /tmp/folded > /tmp/perf.svg
39   firefox /tmp/perf.svg