分析 ceph 命令的 CPU 使用情况 (gperftools)

loic

编译 Ceph 源代码后,使用

./configure --with-debug CFLAGS='-g' CXXFLAGS='-g'

使用 crushtool 测试模式来分析 crush 实现,命令如下:

LD_PRELOAD=/usr/lib/libprofiler.so.0 \ CPUPROFILE=crush.prof src/crushtool \ -i src/test/cli/crushtool/one-hundered-devices.crushmap \ --test --show-bad-mappings

cpu profiler 文档 中所述。 然后可以使用以下命令分析生成的 crush.prof 文件:

google-pprof --ignore=vector --focus=bucket_choose \ --gv ./src/crushtool crush.prof

显示 以下结果

任何 Ceph 命令都可以用这种方式进行分析。