[Bug 210235] sysutils/conky improve chances of getting CPU temperature

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sun Jun 12 13:10:46 UTC 2016


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=210235

            Bug ID: 210235
           Summary: sysutils/conky improve chances of getting CPU
                    temperature
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: freebsd-ports-bugs at FreeBSD.org
          Reporter: walter at pelissero.de
                CC: ntarmos at ceid.upatras.gr
             Flags: maintainer-feedback?(ntarmos at ceid.upatras.gr)
                CC: ntarmos at ceid.upatras.gr

conky, at least on my machine, fails to get the CPU temperature.
A change to freebsd.c improves the chances of finding something useful,
although possibly not from ACPI:

@@ -419,13 +423,14 @@
        int temp;
        (void)fd;

-       if (GETSYSCTL("hw.acpi.thermal.tz0.temperature", temp)) {
-               fprintf(stderr,
-                       "Cannot read sysctl
\"hw.acpi.thermal.tz0.temperature\"\n");
-               return 0.0;
-       }
-
-       return KELVTOC(temp);
+       if (0 == GETSYSCTL("hw.acpi.thermal.tz0.temperature", temp))
+               return KELVTOC(temp);
+       if (0 == GETSYSCTL("dev.cpu.0.temperature", temp))
+               return KELVTOC(temp);
+       if (0 == GETSYSCTL("dev.amdtemp.0.core0.sensor0", temp))
+               return KELVTOC(temp);
+       fprintf(stderr, "Cannot read sysctl for temperature\n");
+       return 0.0;
 }

 static void get_battery_stats(int *battime, int *batcapacity, int *batstate,
int *ac) {

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-ports-bugs mailing list