On Jun 13, 2008, at 3:15 PM, Danhua Shao wrote: > Hi, Sam > > I am working on adding new DTrace probes for operations NFSv4.1 and > am confused about setup their provider: Add all new probes into a > new provider for NFSv4.1 or add them into the current NFSv4.0 > provider? > > I just compare the source code for operations in nfs4_srv.c and in > nfs41_srv.c. > > Some operations share code between the two versions. For example, > in nfs41_srv.c > static void > mds_op_readdir_free(nfs_resop4 *resop, compound_node_t *cn) > { > /* Common function used for NFSv4.0 and NFSv4.1 */ > rfs4_op_readdir_free(resop); > } > > This function reuse the operation definition in NFSv4.0 > > But other operations have similar name and arguments, but have > different implementation code. > > in nfsv41_srv.c: > static void > mds_op_read(nfs_argop4 *argop, nfs_resop4 *resop, struct svc_req *req, > compound_node_t *cn) > > in nfsv4_srv.c > static void > rfs4_op_read(nfs_argop4 *argop, nfs_resop4 *resop, struct svc_req > *req, > struct compound_state *cs) > > So, if the new probes for NFSv4.1 are put under the NFSv4.0 provider > ('nfsv4'), it is good for the shared code, but be confused for > operations with different implementation. > > If the new probes for NFSv4.1 are under a new provider, for example, > nfsv41, it is good to distinguish the different implementation for > operations in the two NFS versions, but there may be some redundant > probes for shared code operations. > > My favorite is the second solution, setup a new provider. But I am > not sure if it is fit the requirement for the users of these probes.
Since protocol state is separate between 40 and 41 my preference would be the second solution, *but* then i'm a developer.. and that is my main focus right now.. as an end-user wanting to know basic v4 information (which clients, which files, IO performance), i don't care about this silly minor version thing.. The 4.1 code is in flux; but i would recommend that the existing NFSv4 probes be placed in the corresponding mds_op* functions. Robert.