Module Name:    src
Committed By:   dennis
Date:           Wed Dec 24 19:50:04 UTC 2014

Modified Files:
        src/sys/sys: namei.src

Log Message:
Update struct nchstats to 64 bit counters on all machines.
Remove the now-redundant struct nchstats_sysctl. Containerize
structure member names with a macro to eliminate cut-and-paste.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/sys/namei.src

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/sys/namei.src
diff -u src/sys/sys/namei.src:1.33 src/sys/sys/namei.src:1.34
--- src/sys/sys/namei.src:1.33	Tue Jun  3 21:16:15 2014
+++ src/sys/sys/namei.src	Wed Dec 24 19:50:04 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: namei.src,v 1.33 2014/06/03 21:16:15 joerg Exp $	*/
+/*	$NetBSD: namei.src,v 1.34 2014/12/24 19:50:04 dennis Exp $	*/
 
 /*
  * Copyright (c) 1985, 1989, 1991, 1993
@@ -288,36 +288,29 @@ void	namecache_print(struct vnode *, voi
 #endif
 
 /*
- * Stats on usefulness of namei caches.
- * XXX: should be 64-bit counters.
- */
-struct	nchstats {
-	long	ncs_goodhits;		/* hits that we can really use */
-	long	ncs_neghits;		/* negative hits that we can use */
-	long	ncs_badhits;		/* hits we must drop */
-	long	ncs_falsehits;		/* hits with id mismatch */
-	long	ncs_miss;		/* misses */
-	long	ncs_long;		/* long names that ignore cache */
-	long	ncs_pass2;		/* names found with passes == 2 */
-	long	ncs_2passes;		/* number of times we attempt it */
-	long	ncs_revhits;		/* reverse-cache hits */
-	long	ncs_revmiss;		/* reverse-cache misses */
-};
+ * Stats on usefulness of namei caches.  A couple of structures are
+ * used for counting, with members having the same names but different
+ * types.  Containerize member names with the preprocessor to avoid
+ * cut-'n'-paste.  A (U) in the comment documents values that are
+ * incremented unlocked; we may treat these specially.
+ */
+#define	_NAMEI_CACHE_STATS(type) {					\
+	type	ncs_goodhits;	/* hits that we can really use (U) */	\
+	type	ncs_neghits;	/* negative hits that we can use */	\
+	type	ncs_badhits;	/* hits we must drop */			\
+	type	ncs_falsehits;	/* hits with id mismatch (U) */		\
+	type	ncs_miss;	/* misses */				\
+	type	ncs_long;	/* long names that ignore cache */	\
+	type	ncs_pass2;	/* names found with passes == 2 (U) */	\
+	type	ncs_2passes;	/* number of times we attempt it (U) */	\
+	type	ncs_revhits;	/* reverse-cache hits */		\
+	type	ncs_revmiss;	/* reverse-cache misses */		\
+}
 
-struct	nchstats_sysctl {
-	uint64_t ncs_goodhits;		/* hits that we can really use */
-	uint64_t ncs_neghits;		/* negative hits that we can use */
-	uint64_t ncs_badhits;		/* hits we must drop */
-	uint64_t ncs_falsehits;		/* hits with id mismatch */
-	uint64_t ncs_miss;		/* misses */
-	uint64_t ncs_long;		/* long names that ignore cache */
-	uint64_t ncs_pass2;		/* names found with passes == 2 */
-	uint64_t ncs_2passes;		/* number of times we attempt it */
-	uint64_t ncs_revhits;		/* reverse-cache hits */
-	uint64_t ncs_revmiss;		/* reverse-cache misses */
-};
+/*
+ * Sysctl deals with a uint64_t version of the stats and summary
+ * totals are kept that way.
+ */
+struct	nchstats _NAMEI_CACHE_STATS(uint64_t);
 
-#ifdef _KERNEL
-extern struct nchstats nchstats;
-#endif
 /* #endif !_SYS_NAMEI_H_ (generated by gennameih.awk) */

Reply via email to