From owner-svn-src-all@FreeBSD.ORG Wed Sep 26 23:07:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7A514106566B; Wed, 26 Sep 2012 23:07:01 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 63CCE8FC0C; Wed, 26 Sep 2012 23:07:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q8QN71HN009012; Wed, 26 Sep 2012 23:07:01 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8QN71in009007; Wed, 26 Sep 2012 23:07:01 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201209262307.q8QN71in009007@svn.freebsd.org> From: Rick Macklem Date: Wed, 26 Sep 2012 23:07:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240977 - in stable/9/sys/fs: nfs nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Sep 2012 23:07:01 -0000 Author: rmacklem Date: Wed Sep 26 23:07:00 2012 New Revision: 240977 URL: http://svn.freebsd.org/changeset/base/240977 Log: MFC: r240289 Add a simple printf() based debug facility to the new nfs client. Use it for a printf() that can be harmlessly generated for mmap()'d files. It will be used extensively for the NFSv4.1 client. Debugging printf()s are enabled by setting vfs.nfs.debuglevel to a non-zero value. The higher the value, the more debugging printf()s. Modified: stable/9/sys/fs/nfs/nfs_commonport.c stable/9/sys/fs/nfs/nfscl.h stable/9/sys/fs/nfsclient/nfs_clrpcops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/dev/puc/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/fs/nfs/nfs_commonport.c ============================================================================== --- stable/9/sys/fs/nfs/nfs_commonport.c Wed Sep 26 22:13:03 2012 (r240976) +++ stable/9/sys/fs/nfs/nfs_commonport.c Wed Sep 26 23:07:00 2012 (r240977) @@ -60,6 +60,7 @@ struct mount nfsv4root_mnt; int newnfs_numnfsd = 0; struct nfsstats newnfsstats; int nfs_numnfscbd = 0; +int nfscl_debuglevel = 0; char nfsv4_callbackaddr[INET6_ADDRSTRLEN]; struct callout newnfsd_callout; void (*nfsd_call_servertimer)(void) = NULL; @@ -76,6 +77,8 @@ SYSCTL_INT(_vfs_nfs, OID_AUTO, realign_c SYSCTL_STRING(_vfs_nfs, OID_AUTO, callback_addr, CTLFLAG_RW, nfsv4_callbackaddr, sizeof(nfsv4_callbackaddr), "NFSv4 callback addr for server to use"); +SYSCTL_INT(_vfs_nfs, OID_AUTO, debuglevel, CTLFLAG_RW, &nfscl_debuglevel, + 0, "Debug level for new nfs client"); /* * Defines for malloc Modified: stable/9/sys/fs/nfs/nfscl.h ============================================================================== --- stable/9/sys/fs/nfs/nfscl.h Wed Sep 26 22:13:03 2012 (r240976) +++ stable/9/sys/fs/nfs/nfscl.h Wed Sep 26 23:07:00 2012 (r240977) @@ -68,4 +68,10 @@ struct nfsv4node { #define NFSSATTR_SIZENEG1 0x4 #define NFSSATTR_SIZERDEV 0x8 +/* Use this macro for debug printfs. */ +#define NFSCL_DEBUG(level, ...) do { \ + if (nfscl_debuglevel >= (level)) \ + printf(__VA_ARGS__); \ + } while (0) + #endif /* _NFS_NFSCL_H */ Modified: stable/9/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clrpcops.c Wed Sep 26 22:13:03 2012 (r240976) +++ stable/9/sys/fs/nfsclient/nfs_clrpcops.c Wed Sep 26 23:07:00 2012 (r240977) @@ -56,6 +56,7 @@ extern u_int32_t newnfs_false, newnfs_tr extern nfstype nfsv34_type[9]; extern int nfsrv_useacl; extern char nfsv4_callbackaddr[INET6_ADDRSTRLEN]; +extern int nfscl_debuglevel; NFSCLSTATEMUTEX; int nfstest_outofseq = 0; int nfscl_assumeposixlocks = 1; @@ -1398,7 +1399,7 @@ nfsrpc_write(vnode_t vp, struct uio *uio if (stateid.other[0] == 0 && stateid.other[1] == 0 && stateid.other[2] == 0) { nostateid = 1; - printf("stateid0 in write\n"); + NFSCL_DEBUG(1, "stateid0 in write\n"); } }