Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Dec 2016 13:05:04 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r310056 - head/sys/sys
Message-ID:  <201612141305.uBED54Sb017047@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ed
Date: Wed Dec 14 13:05:04 2016
New Revision: 310056
URL: https://svnweb.freebsd.org/changeset/base/310056

Log:
  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

Modified:
  head/sys/sys/sysctl.h

Modified: head/sys/sys/sysctl.h
==============================================================================
--- head/sys/sys/sysctl.h	Wed Dec 14 13:03:01 2016	(r310055)
+++ head/sys/sys/sysctl.h	Wed Dec 14 13:05:04 2016	(r310056)
@@ -796,9 +796,9 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e
  * 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 */
 



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