diff options
author | Ed Schouten <ed@FreeBSD.org> | 2016-12-14 12:53:33 +0000 |
---|---|---|
committer | Ed Schouten <ed@FreeBSD.org> | 2016-12-14 12:53:33 +0000 |
commit | 4c484fd216d5aa5d1ef40578d6373229dc6abf9c (patch) | |
tree | d9bf4e5e07ff6189c52988129e3f576a388ca0b5 /sys/cam/nvme/nvme_da.c | |
parent | 1e1f3941e4071048c0bbdc4238d221842d818188 (diff) | |
download | src-4c484fd216d5aa5d1ef40578d6373229dc6abf9c.tar.gz src-4c484fd216d5aa5d1ef40578d6373229dc6abf9c.zip |
Add label annotations to CAM sysctls.
Under kern.cam we have certain sysctls that are per-device, such as the
ones under kern.cam.ada.[0-9]+.*. Add a "device_index" label annotation
to such sysctls, so that the Prometheus metrics exporter will give all
of those metrics the same name. The device number will be added to the
metric name as the "device_index" label.
Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D8775
Notes
Notes:
svn path=/head/; revision=310052
Diffstat (limited to 'sys/cam/nvme/nvme_da.c')
-rw-r--r-- | sys/cam/nvme/nvme_da.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/cam/nvme/nvme_da.c b/sys/cam/nvme/nvme_da.c index 9628530edb20..5e316c365295 100644 --- a/sys/cam/nvme/nvme_da.c +++ b/sys/cam/nvme/nvme_da.c @@ -608,9 +608,9 @@ ndasysctlinit(void *context, int pending) sysctl_ctx_init(&softc->sysctl_ctx); softc->flags |= NDA_FLAG_SCTX_INIT; - softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx, + softc->sysctl_tree = SYSCTL_ADD_NODE_WITH_LABEL(&softc->sysctl_ctx, SYSCTL_STATIC_CHILDREN(_kern_cam_nda), OID_AUTO, tmpstr2, - CTLFLAG_RD, 0, tmpstr); + CTLFLAG_RD, 0, tmpstr, "device_index"); if (softc->sysctl_tree == NULL) { printf("ndasysctlinit: unable to allocate sysctl tree\n"); cam_periph_release(periph); |