Commit cc0175c1 authored by Chuck Lever's avatar Chuck Lever Committed by Trond Myklebust
Browse files

SUNRPC: display human-readable procedure name in rpc_iostats output



Add fields to the rpc_procinfo struct that allow the display of a
human-readable name for each procedure in the rpc_iostats output.

Also fix it so that the NFSv4 stats are broken up correctly by
sub-procedure number.  NFSv4 uses only two real RPC procedures:
NULL, and COMPOUND.

Test plan:
Mount with NFSv2, NFSv3, and NFSv4, and do "cat /proc/self/mountstats".

Signed-off-by: default avatarChuck Lever <cel@netapp.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 4ece3a2d
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -214,12 +214,16 @@ static struct rpc_procinfo nsm_procedures[] = {
		.p_encode	= (kxdrproc_t) xdr_encode_mon,
		.p_decode	= (kxdrproc_t) xdr_decode_stat_res,
		.p_bufsiz	= MAX(SM_mon_sz, SM_monres_sz) << 2,
		.p_statidx	= SM_MON,
		.p_name		= "MONITOR",
	},
[SM_UNMON] = {
		.p_proc		= SM_UNMON,
		.p_encode	= (kxdrproc_t) xdr_encode_unmon,
		.p_decode	= (kxdrproc_t) xdr_decode_stat,
		.p_bufsiz	= MAX(SM_mon_id_sz, SM_unmonres_sz) << 2,
		.p_statidx	= SM_UNMON,
		.p_name		= "UNMONITOR",
	},
};

+3 −1
Original line number Diff line number Diff line
@@ -546,7 +546,9 @@ nlmclt_decode_res(struct rpc_rqst *req, u32 *p, struct nlm_res *resp)
	.p_proc      = NLMPROC_##proc,					\
	.p_encode    = (kxdrproc_t) nlmclt_encode_##argtype,		\
	.p_decode    = (kxdrproc_t) nlmclt_decode_##restype,		\
	.p_bufsiz    = MAX(NLM_##argtype##_sz, NLM_##restype##_sz) << 2	\
	.p_bufsiz    = MAX(NLM_##argtype##_sz, NLM_##restype##_sz) << 2,	\
	.p_statidx   = NLMPROC_##proc,					\
	.p_name      = #proc,						\
	}

static struct rpc_procinfo	nlm_procedures[] = {
+3 −1
Original line number Diff line number Diff line
@@ -551,7 +551,9 @@ nlm4clt_decode_res(struct rpc_rqst *req, u32 *p, struct nlm_res *resp)
	.p_proc      = NLMPROC_##proc,					\
	.p_encode    = (kxdrproc_t) nlm4clt_encode_##argtype,		\
	.p_decode    = (kxdrproc_t) nlm4clt_decode_##restype,		\
	.p_bufsiz    = MAX(NLM4_##argtype##_sz, NLM4_##restype##_sz) << 2	\
	.p_bufsiz    = MAX(NLM4_##argtype##_sz, NLM4_##restype##_sz) << 2,	\
	.p_statidx   = NLMPROC_##proc,					\
	.p_name      = #proc,						\
	}

static struct rpc_procinfo	nlm4_procedures[] = {
+4 −0
Original line number Diff line number Diff line
@@ -137,6 +137,8 @@ static struct rpc_procinfo mnt_procedures[] = {
	  .p_encode		= (kxdrproc_t) xdr_encode_dirpath,	
	  .p_decode		= (kxdrproc_t) xdr_decode_fhstatus,
	  .p_bufsiz		= MNT_dirpath_sz << 2,
	  .p_statidx		= MNTPROC_MNT,
	  .p_name		= "MOUNT",
	},
};

@@ -146,6 +148,8 @@ static struct rpc_procinfo mnt3_procedures[] = {
	  .p_encode		= (kxdrproc_t) xdr_encode_dirpath,
	  .p_decode		= (kxdrproc_t) xdr_decode_fhstatus3,
	  .p_bufsiz		= MNT_dirpath_sz << 2,
	  .p_statidx		= MOUNTPROC3_MNT,
	  .p_name		= "MOUNT",
	},
};

+3 −1
Original line number Diff line number Diff line
@@ -682,7 +682,9 @@ nfs_stat_to_errno(int stat)
	.p_encode   =  (kxdrproc_t) nfs_xdr_##argtype,			\
	.p_decode   =  (kxdrproc_t) nfs_xdr_##restype,			\
	.p_bufsiz   =  MAX(NFS_##argtype##_sz,NFS_##restype##_sz) << 2,	\
	.p_timer    =  timer						\
	.p_timer    =  timer,						\
	.p_statidx  =  NFSPROC_##proc,					\
	.p_name     =  #proc,						\
	}
struct rpc_procinfo	nfs_procedures[] = {
    PROC(GETATTR,	fhandle,	attrstat, 1),
Loading