]> xenbits.xensource.com Git - people/royger/freebsd.git/commitdiff
Attach a "thermal_zone" label to the ACPI thermal zone sysctls.
authored <ed@FreeBSD.org>
Wed, 14 Dec 2016 13:00:27 +0000 (13:00 +0000)
committered <ed@FreeBSD.org>
Wed, 14 Dec 2016 13:00:27 +0000 (13:00 +0000)
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

sys/dev/acpica/acpi_thermal.c

index fa1c2e81cc23eb91b59c9273ba5a20e98f8bb5e9..b2b2a13aa8898297ca8ba9569a9a9545c151db72 100644 (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,