Attach a "thermal_zone" label to the ACPI thermal zone sysctls.

In order to make Prometheus do graphing/alerting on thermal sensors in a
generic fashion, we should attach the name of the thermal zone device as
a label. That way there is only a single metric for the temperature of a
thermal zone, with its name attached as a label.

Reviewed by:	cem
Differential Revision:	https://reviews.freebsd.org/D8775
This commit is contained in:
ed 2016-12-14 13:00:27 +00:00
parent 93bcdbae64
commit 22f1bd6391

View File

@ -258,9 +258,9 @@ acpi_tz_attach(device_t dev)
}
sysctl_ctx_init(&sc->tz_sysctl_ctx);
sprintf(oidname, "tz%d", device_get_unit(dev));
sc->tz_sysctl_tree = SYSCTL_ADD_NODE(&sc->tz_sysctl_ctx,
SYSCTL_CHILDREN(acpi_tz_sysctl_tree),
OID_AUTO, oidname, CTLFLAG_RD, 0, "");
sc->tz_sysctl_tree = SYSCTL_ADD_NODE_WITH_LABEL(&sc->tz_sysctl_ctx,
SYSCTL_CHILDREN(acpi_tz_sysctl_tree),
OID_AUTO, oidname, CTLFLAG_RD, 0, "", "thermal_zone");
SYSCTL_ADD_PROC(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree),
OID_AUTO, "temperature", CTLTYPE_INT | CTLFLAG_RD,
&sc->tz_temperature, 0, sysctl_handle_int,