Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/sys Call sysctl_kernhist_new for KERNHIST_LINK_STATIC. ...



details:   https://anonhg.NetBSD.org/src/rev/e8c59eba3476
branches:  trunk
changeset: 826890:e8c59eba3476
user:      skrll <skrll%NetBSD.org@localhost>
date:      Wed Oct 04 09:10:37 2017 +0000

description:
Call sysctl_kernhist_new for KERNHIST_LINK_STATIC.  I can get usbhist from
vmstat(1) again.

diffstat:

 sys/sys/kernhist.h |  15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diffs (50 lines):

diff -r ed8c575bb15e -r e8c59eba3476 sys/sys/kernhist.h
--- a/sys/sys/kernhist.h        Wed Oct 04 08:47:26 2017 +0000
+++ b/sys/sys/kernhist.h        Wed Oct 04 09:10:37 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kernhist.h,v 1.18 2017/01/10 00:50:57 pgoyette Exp $   */
+/*     $NetBSD: kernhist.h,v 1.19 2017/10/04 09:10:37 skrll Exp $      */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -147,6 +147,10 @@
 #define KERNHIST_DECL(NAME) extern struct kern_history NAME
 #define KERNHIST_DEFINE(NAME) struct kern_history NAME
 
+#define KERNHIST_LINK_STATIC(NAME) \
+       LIST_INSERT_HEAD(&kern_histories, &(NAME), list); \
+       sysctl_kernhist_new(&(NAME));
+
 #define KERNHIST_INIT(NAME,N) \
 do { \
        (NAME).name = __STRING(NAME); \
@@ -156,8 +160,7 @@
        (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 +174,6 @@
        /* 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); \
@@ -183,8 +183,7 @@
        (NAME).e = (struct kern_history_ent *) (BUF); \
        (NAME).s = 0; \
        memset((NAME).e, 0, sizeof(struct kern_history_ent) * (NAME).n); \
-       KERNHIST_LINK_STATIC(NAME); \
-       sysctl_kernhist_new(&(NAME)); \
+       KERNHIST_LINK_STATIC(NAME) \
 } while (/*CONSTCOND*/ 0)
 
 #ifndef KERNHIST_DELAY



Home | Main Index | Thread Index | Old Index