]> git.ipfire.org Git - people/mfischer/ipfire-2.x.git/commitdiff
collectd: fix cpufreq graph if virtual cores are offline
authorArne Fitzenreiter <arne_f@ipfire.org>
Thu, 4 Apr 2024 16:23:29 +0000 (18:23 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Thu, 4 Apr 2024 16:23:29 +0000 (18:23 +0200)
the kernel doesn't allow to read the frequency of a offline virtual core
if smt is disabled so now no error is reported in this case and NaN submited to the
database.

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
lfs/collectd
src/patches/collectd/collectd-4.10.9-cpufreq_skip_disabled_cores.patch [new file with mode: 0644]

index 5c4236b3af4686042ca7111bbf6f2cec73df4eb7..24f5bc632ec7c27d03d19b10a5746685fbd5d1f5 100644 (file)
@@ -103,12 +103,14 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0020-openvpn-Make-read-functions-robust-like-in-8516f9abb.patch
        cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0021-openvpn-Fix-copy-and-paste-error.patch
        cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/0022-openvpn-Change-data-type-from-COUNTER-to-DERIVE.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/collectd/collectd-4.10.9-cpufreq_skip_disabled_cores.patch
        cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd/silence-openvpn-errors.patch
        cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd-4.10.9-xfs-compile-fix.patch
        cd $(DIR_APP) && patch -p1 -i $(DIR_SRC)/src/patches/collectd-4.10-libiptc-build-fixes.patch
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/collectd-4.10.9-remove-checks-for-SENSORS_API_VERSION-upper-limit.patch
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/collectd-4.10-drop-linux-disk-module.patch
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/collectd-4.10.9-fix-glibc-headers.patch
+
        cd $(DIR_APP) && autoupdate -v configure.in
        cd $(DIR_APP) && autoreconf -vfi
        cd $(DIR_APP)/libltdl && autoreconf -vfi
diff --git a/src/patches/collectd/collectd-4.10.9-cpufreq_skip_disabled_cores.patch b/src/patches/collectd/collectd-4.10.9-cpufreq_skip_disabled_cores.patch
new file mode 100644 (file)
index 0000000..e8851b6
--- /dev/null
@@ -0,0 +1,18 @@
+diff -Naur collectd-4.10.9.org/src/cpufreq.c collectd-4.10.9/src/cpufreq.c
+--- collectd-4.10.9.org/src/cpufreq.c  2013-04-08 08:26:17.000000000 +0200
++++ collectd-4.10.9/src/cpufreq.c      2024-04-04 15:33:52.705372940 +0200
+@@ -104,12 +104,9 @@
+               if (fgets (buffer, 16, fp) == NULL)
+               {
+-                      char errbuf[1024];
+-                      WARNING ("cpufreq: fgets: %s",
+-                                      sstrerror (errno, errbuf,
+-                                              sizeof (errbuf)));
+                       fclose (fp);
+-                      return (-1);
++                      cpufreq_submit (i, NAN);
++                      break;
+               }
+               if (fclose (fp))