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
This commit is contained in:
vangyzen 2019-10-04 21:39:11 +00:00
parent 195cd9b514
commit 86daa3cd86

View File

@ -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); \
})