mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
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
This commit is contained in:
parent
3fd335bcc7
commit
ae15715360
1 changed files with 2 additions and 2 deletions
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Reference in a new issue