Module Name: src Committed By: snj Date: Fri Oct 13 08:14:51 UTC 2017
Modified Files: src/sys/sys [netbsd-8]: kernhist.h Log Message: Pull up following revision(s) (requested by pgoyette in ticket #301): sys/sys/kernhist.h: revision 1.19-1.20 Call sysctl_kernhist_new for KERNHIST_LINK_STATIC. I can get usbhist from vmstat(1) again. -- Use do {...} while 0; construct for KERNHIST_LINK_STATIC() NFCI To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.18.8.1 src/sys/sys/kernhist.h 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/kernhist.h diff -u src/sys/sys/kernhist.h:1.18 src/sys/sys/kernhist.h:1.18.8.1 --- src/sys/sys/kernhist.h:1.18 Tue Jan 10 00:50:57 2017 +++ src/sys/sys/kernhist.h Fri Oct 13 08:14:51 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: kernhist.h,v 1.18 2017/01/10 00:50:57 pgoyette Exp $ */ +/* $NetBSD: kernhist.h,v 1.18.8.1 2017/10/13 08:14:51 snj Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -147,6 +147,12 @@ extern struct kern_history_head kern_his #define KERNHIST_DECL(NAME) extern struct kern_history NAME #define KERNHIST_DEFINE(NAME) struct kern_history NAME +#define KERNHIST_LINK_STATIC(NAME) \ +do { \ + LIST_INSERT_HEAD(&kern_histories, &(NAME), list); \ + sysctl_kernhist_new(&(NAME)); \ +} while (/*CONSTCOND*/ 0) + #define KERNHIST_INIT(NAME,N) \ do { \ (NAME).name = __STRING(NAME); \ @@ -156,8 +162,7 @@ do { \ (NAME).e = (struct kern_history_ent *) \ kmem_zalloc(sizeof(struct kern_history_ent) * (N), KM_SLEEP); \ (NAME).s = 0; \ - LIST_INSERT_HEAD(&kern_histories, &(NAME), list); \ - sysctl_kernhist_new(&(NAME)); \ + KERNHIST_LINK_STATIC(NAME); \ } while (/*CONSTCOND*/ 0) #define KERNHIST_INITIALIZER(NAME,BUF) \ @@ -171,9 +176,6 @@ do { \ /* BUF will inititalized to zeroes by being in .bss */ \ } -#define KERNHIST_LINK_STATIC(NAME) \ - LIST_INSERT_HEAD(&kern_histories, &(NAME), list) - #define KERNHIST_INIT_STATIC(NAME,BUF) \ do { \ (NAME).name = __STRING(NAME); \ @@ -184,7 +186,6 @@ do { \ (NAME).s = 0; \ memset((NAME).e, 0, sizeof(struct kern_history_ent) * (NAME).n); \ KERNHIST_LINK_STATIC(NAME); \ - sysctl_kernhist_new(&(NAME)); \ } while (/*CONSTCOND*/ 0) #ifndef KERNHIST_DELAY