runsisi's

technical notes

Ceph RBD 内核模块问题定位

2019-02-13 runsisi#ceph#rbd

Ceph 支持以用户态和内核态两种方式访问存储集群中的资源,具体到 RBD 上层块存储接口 Ceph 提供了 librbd 用户态库和 rbd 内核态块设备驱动访问 RBD 块设备,如下图所示。

rbd

查看 dmesg 打印:

dmesg -wH

控制 dmesg 日志打印:

echo 'module rbd +p' > /sys/kernel/debug/dynamic_debug/control
echo 'module rbd -p' > /sys/kernel/debug/dynamic_debug/control

echo 'file osd_client.c +p' > /sys/kernel/debug/dynamic_debug/control
echo 'file osd_client.c -p' > /sys/kernel/debug/dynamic_debug/control

echo 'func handle_osds_timeout +p' > /sys/kernel/debug/dynamic_debug/control
echo 'func handle_osds_timeout -p' > /sys/kernel/debug/dynamic_debug/control

查看 ceph 内核态客户端状态:

/sys/kernel/debug/ceph/

查看 tracing 信息:

/sys/kernel/debug/tracing/

参考资料

Linux tracing systems & how they fit together

https://jvns.ca/blog/2017/07/05/linux-tracing-systems

/proc/sysrq-trigger

https://github.com/torvalds/linux/blob/master/Documentation/admin-guide/sysrq.rst

event trace

https://www.kernel.org/doc/Documentation/trace/events.txt

function trace

https://www.kernel.org/doc/Documentation/trace/ftrace.txt

latency-tracker

https://github.com/efficios/latency-tracker.git