From: ed Date: Wed, 14 Dec 2016 13:05:04 +0000 (+0000) Subject: Let all FEATURE()s use the same Prometheus metric. X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=e8ba53b832404c34f14dfc5c1ed726b3f462922f;p=people%2Froyger%2Ffreebsd.git Let all FEATURE()s use the same Prometheus metric. Without this change, every individual FEATURE() declaration would have an individual metric in Prometheus. Though this wouldn't be harmful, it would look very cluttered. By letting it use a single metric with the name of the feature attached as a label, it also becomes easier to search, as you can apply regex matching, etc. Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D8775 --- diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h index 5f949f5a40c6..799e69ed6a75 100644 --- a/sys/sys/sysctl.h +++ b/sys/sys/sysctl.h @@ -796,9 +796,9 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_entry); * A macro to generate a read-only sysctl to indicate the presence of optional * kernel features. */ -#define FEATURE(name, desc) \ - SYSCTL_INT(_kern_features, OID_AUTO, name, CTLFLAG_RD | CTLFLAG_CAPRD, \ - SYSCTL_NULL_INT_PTR, 1, desc) +#define FEATURE(name, desc, label) \ + SYSCTL_INT_WITH_LABEL(_kern_features, OID_AUTO, name, \ + CTLFLAG_RD | CTLFLAG_CAPRD, SYSCTL_NULL_INT_PTR, 1, desc, "feature") #endif /* _KERNEL */