Author: vangyzen
Date: Fri Oct  4 21:39:11 2019
New Revision: 353111
URL: https://svnweb.freebsd.org/changeset/base/353111

Log:
  Add CTLFLAG_STATS to all COUNTER_U64* sysctl OIDs
  
  CTLFLAG_STATS identifies a sysctl OID as statistical or informational,
  as opposed to a configurable/tunable OID that changes behavior.
  This can be used, for example, to verfiy that the kyua tests do not
  modify configurable OIDs when allow_sysctl_side_effects is true.
  
  Add CTLFLAG_STATS to all COUNTER_U64* OIDs.
  
  I will add the flag to more OIDs in a few subsequent commits, to
  facilitate MFC.  The flag should be added to many more OIDs.  I plan to
  add it those that my test found and some nearby that looked obvious.
  
  MFC after:    2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/sys/sysctl.h

Modified: head/sys/sys/sysctl.h
==============================================================================
--- head/sys/sys/sysctl.h       Fri Oct  4 18:38:47 2019        (r353110)
+++ head/sys/sys/sysctl.h       Fri Oct  4 21:39:11 2019        (r353111)
@@ -699,7 +699,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry);
 /* Oid for a 64-bit unsigned counter(9).  The pointer must be non NULL. */
 #define        SYSCTL_COUNTER_U64(parent, nbr, name, access, ptr, descr)       
\
        SYSCTL_OID(parent, nbr, name,                                   \
-           CTLTYPE_U64 | CTLFLAG_MPSAFE | (access),                    \
+           CTLTYPE_U64 | CTLFLAG_MPSAFE | CTLFLAG_STATS | (access),    \
            (ptr), 0, sysctl_handle_counter_u64, "QU", descr);          \
        CTASSERT((((access) & CTLTYPE) == 0 ||                          \
            ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_U64) &&       \
@@ -712,7 +712,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry);
        CTASSERT(((access) & CTLTYPE) == 0 ||                           \
            ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_U64);         \
        sysctl_add_oid(ctx, parent, nbr, name,                          \
-           CTLTYPE_U64 | CTLFLAG_MPSAFE | (access),                    \
+           CTLTYPE_U64 | CTLFLAG_MPSAFE | CTLFLAG_STATS | (access),    \
            __ptr, 0, sysctl_handle_counter_u64, "QU", __DESCR(descr),  \
            NULL);                                                      \
 })
@@ -720,7 +720,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry);
 /* Oid for an array of counter(9)s.  The pointer and length must be non zero. 
*/
 #define        SYSCTL_COUNTER_U64_ARRAY(parent, nbr, name, access, ptr, len, 
descr) \
        SYSCTL_OID(parent, nbr, name,                                   \
-           CTLTYPE_OPAQUE | CTLFLAG_MPSAFE | (access),                 \
+           CTLTYPE_OPAQUE | CTLFLAG_MPSAFE | CTLFLAG_STATS | (access), \
            (ptr), (len), sysctl_handle_counter_u64_array, "S", descr); \
        CTASSERT((((access) & CTLTYPE) == 0 ||                          \
            ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE) &&    \
@@ -734,7 +734,7 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry);
        CTASSERT(((access) & CTLTYPE) == 0 ||                           \
            ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE);      \
        sysctl_add_oid(ctx, parent, nbr, name,                          \
-           CTLTYPE_OPAQUE | CTLFLAG_MPSAFE | (access),                 \
+           CTLTYPE_OPAQUE | CTLFLAG_MPSAFE | CTLFLAG_STATS | (access), \
            __ptr, len, sysctl_handle_counter_u64_array, "S",           \
            __DESCR(descr), NULL);                                      \
 })
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to