svn commit: r310055 - head/sys/kern

Ed Schouten ed at FreeBSD.org
Wed Dec 14 13:03:02 UTC 2016


Author: ed
Date: Wed Dec 14 13:03:01 2016
New Revision: 310055
URL: https://svnweb.freebsd.org/changeset/base/310055

Log:
  Add a "device_index" label to all sysctls under dev.$driver.$index.
  
  This way it becomes possible to graph a property for all instances of a
  single driver. For example, graphing the number of packets across all
  USB controllers, the amount of dropped packets on all NICs, etc.
  
  Reviewed by:	cem
  Differential Revision:	https://reviews.freebsd.org/D8775

Modified:
  head/sys/kern/subr_bus.c

Modified: head/sys/kern/subr_bus.c
==============================================================================
--- head/sys/kern/subr_bus.c	Wed Dec 14 13:00:27 2016	(r310054)
+++ head/sys/kern/subr_bus.c	Wed Dec 14 13:03:01 2016	(r310055)
@@ -288,10 +288,10 @@ device_sysctl_init(device_t dev)
 		return;
 	devclass_sysctl_init(dc);
 	sysctl_ctx_init(&dev->sysctl_ctx);
-	dev->sysctl_tree = SYSCTL_ADD_NODE(&dev->sysctl_ctx,
+	dev->sysctl_tree = SYSCTL_ADD_NODE_WITH_LABEL(&dev->sysctl_ctx,
 	    SYSCTL_CHILDREN(dc->sysctl_tree), OID_AUTO,
 	    dev->nameunit + strlen(dc->name),
-	    CTLFLAG_RD, NULL, "");
+	    CTLFLAG_RD, NULL, "", "device_index");
 	SYSCTL_ADD_PROC(&dev->sysctl_ctx, SYSCTL_CHILDREN(dev->sysctl_tree),
 	    OID_AUTO, "%desc", CTLTYPE_STRING | CTLFLAG_RD,
 	    dev, DEVICE_SYSCTL_DESC, device_sysctl_handler, "A",


More information about the svn-src-head mailing list