查看可用的 rpcdebug 模块

  1. 要查看可用的 rpcdebug 模块,请运行:
# rpcdebug -vh
usage: rpcdebug [-v] [-h] [-m module] [-s flags...|-c flags...]
       set or cancel debug flags.
Module     Valid flags
rpc        xprt call debug nfs auth bind sched trans svcsock svcdsp misc cache all
nfs        vfs dircache lookupcache pagecache proc xdr file root callback client mount fscache pnfs pnfs_ld state all
nfsd       sock fh export svc proc fileop auth repcache xdr lockd all
nlm        svc client clntlock svclock monitor clntsubs svcsubs hostcache xdr all

其中:

-m:用于设置或者清除内核调试标志的模块名称
-s:为模块设置可用的内核调试标志
-c:清除内核调试标志

禁用调试

要禁用调试,请使用 -c(清除)选项,例如:

# rpcdebug -m nfs -c all
# rpcdebug -m nfsd -c all

注意:确保在完成调试后禁用调试。
启用调试后,调试会在日志上创建大量输出,可能会影响系统性能。

如何使用 rpcdebug 启用 NFS 调试日志记录

我们可以使用 rpcdebug 命令来设置和清除 Linux 内核的 NFS 客户端和服务器调试标志。
设置这些标志会导致内核将消息记录到系统日志(作为对 NFS 活动的响应。
以下是可以使用 rpcdebug 命令为其设置内核调试标志的模块列表。

nfsNFS客户端
nfsdNFS服务器
nlm网络锁管理器协议 (NLM)
rpc远程过程调用
www. On IT Road .com

启用调试 - 示例

  1. 启用所有 NFS(客户端)调试
    要在客户端上启用 NFS 调试:
# rpcdebug -m nfs -s all
  1. 启用NFSD(服务器端)lockd调试
    要启用服务器端 nfsd lockd 调试:
# rpcdebug -m nfsd -s lockd
  1. 开启RPC调用调试
    要启用 RPC 调用调试:
# rpcdebug -m rpc -s call
日期:2020-09-17 00:13:35 来源:oir作者:oir