注意

本文档适用于 Ceph 开发版本。

CPU 分析

如果你从源代码构建 Ceph 并编译 Ceph 以使用oprofile你可以分析 Ceph 的 CPU 使用情况。参见安装 Oprofile for details.

初始化 oprofile

oprofile必须在第一次使用时初始化。定位与您正在运行的内核对应的vmlinux图像:

ls /boot
sudo opcontrol --init
sudo opcontrol --setup --vmlinux={path-to-image} --separate=library --callgraph=6

开始 oprofile

运行以下命令以启动oprofile:

opcontrol --start

停止 oprofile

运行以下命令以停止oprofile:

opcontrol --stop

获取 oprofile 结果

运行以下命令以获取带有调用cmon结果中:

opreport -gal ./cmon | less

运行以下命令以获取带有调用cmon图的顶部结果:

opreport -cal ./cmon | less

重要

在您查看结果后,重置oprofile在再次运行之前。重置操作oprofile会从会话目录中删除数据。

重置 oprofile

运行以下命令以重置oprofile:

sudo opcontrol --reset

重要

重置oprofile在分析数据后。这确保了先前的测试结果不会与当前测试结果混合在一起。

由 Ceph 基金会带给您

Ceph 文档是一个社区资源,由非盈利的 Ceph 基金会资助和托管Ceph Foundation. 如果您想支持这一点和我们的其他工作,请考虑加入现在加入.