Ceph cpu profile

oprofile

ceph官网推荐推荐使用oprofile,参考:http://docs.ceph.com/docs/master/dev/cpu-profiler/

重新编译ceph:

1
2
3
4
5
6
7
8
9
10
apt-get install oprofile oprofile-gui
make distclean
export CFLAGS=“-fno-omit-frame-pointer -O2 -g"

dpkg-buildpackage

或者:
./autogen.sh
./configure
make

使用oprofile:http://docs.ceph.com/docs/master/rados/troubleshooting/cpu-profiling/

perf

官网介绍:https://perf.wiki.kernel.org/index.php/Main_Page

安装:perf在ubuntu 14.04.1上需要安装linux-tools-3a.16.0-30-generic, linux-cloud-tools-3.16.0-30-generic

安装后perf不在PATH里指定的目录下,需要创建如下软连接:

1
ln -s /usr/lib/linux-lts-utopic-tools-3.16.0-30/perf /usr/local/bin/perf

常用操作

1
2
3
4
perf stat
perf top
perf record
perf report

指定process

1
2
3
4
perf stat -p 1436446 sleep 10
perf record -p 1436446
perf top -p 1436446
perf report

enable call-graph

1
2
3
[-g enables call-graph recording]
perf record -a -g
perf report -g graph
支持原创