Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Nov 2022 16:16:42 GMT
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: bc5708c0e2fc - main - counter: fix SYSCTL_COUNTER_U64_ARRAY type
Message-ID:  <202211171616.2AHGGgpm097169@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by glebius:

URL: https://cgit.FreeBSD.org/src/commit/?id=bc5708c0e2fc7a936e06a7916c292023ebd53e2a

commit bc5708c0e2fc7a936e06a7916c292023ebd53e2a
Author:     Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2022-11-17 16:16:14 +0000
Commit:     Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2022-11-17 16:16:14 +0000

    counter: fix SYSCTL_COUNTER_U64_ARRAY type
    
    There is nothing wrong with declaring an array as CTLTYPE_U64.  Note
    that sysctl(8) is able to print such arrays and doesn't need any change.
    
    Fixes:  b5b7b142a7e0e74bdd8c497f6a14804e71654dfd
---
 sys/sys/sysctl.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h
index 040012581087..207ffe4a62e7 100644
--- a/sys/sys/sysctl.h
+++ b/sys/sys/sysctl.h
@@ -757,8 +757,8 @@ 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 | CTLFLAG_STATS | (access),	\
-	    (ptr), (len), sysctl_handle_counter_u64_array, "S", descr);	\
+	    CTLTYPE_U64 | CTLFLAG_MPSAFE | CTLFLAG_STATS | (access),	\
+	    (ptr), (len), sysctl_handle_counter_u64_array, "QU", descr);\
 	CTASSERT((((access) & CTLTYPE) == 0 ||				\
 	    ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE) &&	\
 	    sizeof(counter_u64_t) == sizeof(*(ptr)) &&			\



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202211171616.2AHGGgpm097169>