[packages/xfce4-cpufreq-plugin] - /proc/cpuinfo shows only the basic cpu clock speed since kernel 4.13
baggins
baggins at pld-linux.org
Sat Jan 6 14:03:50 CET 2018
commit 5b70795b964987d887fcb57932a11fbd3e1ca976
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Sat Jan 6 13:59:17 2018 +0100
- /proc/cpuinfo shows only the basic cpu clock speed since kernel 4.13
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=51204e0639c49ada02fd823782ad673b6326d748
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f8475cef90082bf0902ddab106112de130d90395
no-freq-in-proc-cpuinfo.patch | 85 +++++++++++++++++++++++++++++++++++++++++++
xfce4-cpufreq-plugin.spec | 4 +-
2 files changed, 88 insertions(+), 1 deletion(-)
---
diff --git a/xfce4-cpufreq-plugin.spec b/xfce4-cpufreq-plugin.spec
index 1f29871..183d678 100644
--- a/xfce4-cpufreq-plugin.spec
+++ b/xfce4-cpufreq-plugin.spec
@@ -2,11 +2,12 @@ Summary: A cpufreq plugin for the Xfce panel
Summary(pl.UTF-8): Wtyczka cpufreq dla panelu Xfce
Name: xfce4-cpufreq-plugin
Version: 1.1.1
-Release: 1
+Release: 1.2
License: GPL v2
Group: X11/Applications
Source0: http://archive.xfce.org/src/panel-plugins/xfce4-cpufreq-plugin/1.1/%{name}-%{version}.tar.bz2
# Source0-md5: cc3447ee6663f2946fce86308ba3566b
+Patch0: no-freq-in-proc-cpuinfo.patch
URL: http://goodies.xfce.org/projects/panel-plugins/xfce4-cpufreq-plugin
BuildRequires: autoconf
BuildRequires: automake
@@ -34,6 +35,7 @@ procesora jako odpowiednio pokolorowany pasek.
%prep
%setup -q
+%patch0 -p1
%build
%{__libtoolize}
diff --git a/no-freq-in-proc-cpuinfo.patch b/no-freq-in-proc-cpuinfo.patch
new file mode 100644
index 0000000..39500e4
--- /dev/null
+++ b/no-freq-in-proc-cpuinfo.patch
@@ -0,0 +1,85 @@
+--- xfce4-cpufreq-plugin-1.1.1/panel-plugin/xfce4-cpufreq-linux.c~ 2014-12-22 18:50:31.000000000 +0100
++++ xfce4-cpufreq-plugin-1.1.1/panel-plugin/xfce4-cpufreq-linux.c 2018-01-06 13:32:33.608960079 +0100
+@@ -108,14 +108,12 @@
+ }
+
+ /* read available cpu freqs */
+- if (cpuFreq->intel_pstate == NULL) {
+ file =
+ g_strdup_printf ("/sys/devices/system/cpu/cpu%i/"
+ "cpufreq/scaling_available_frequencies",
+ cpu_number);
+ SYSFS_READ_INT_LIST (file, contents, cpu->available_freqs);
+ g_free (file);
+- }
+
+ /* read available cpu governors */
+ file = g_strdup_printf (
+@@ -132,14 +132,12 @@
+ g_free (file);
+
+ /* read current cpu freq */
+- if (cpuFreq->intel_pstate == NULL) {
+ file =
+ g_strdup_printf ("/sys/devices/system/cpu/cpu%i/"
+ "cpufreq/scaling_cur_freq",
+ cpu_number);
+ SYSFS_READ_INT (file, contents, cpu->cur_freq);
+ g_free (file);
+- }
+
+ /* read current cpu governor */
+ file = g_strdup_printf (
+@@ -173,14 +171,12 @@
+ cpu = g_ptr_array_index (cpuFreq->cpus, cpu_number);
+
+ /* read current cpu freq */
+- if (cpuFreq->intel_pstate == NULL) {
+ file =
+ g_strdup_printf ("/sys/devices/system/cpu/cpu%i/"
+ "cpufreq/scaling_cur_freq",
+ cpu_number);
+ SYSFS_READ_INT (file, contents, cpu->cur_freq);
+ g_free (file);
+- }
+
+ /* read current cpu governor */
+ file = g_strdup_printf ("/sys/devices/system/cpu/cpu%i/"
+@@ -398,18 +396,7 @@
+ if (!cpufreq_intel_pstate_params ())
+ return FALSE;
+
+- /* Read /proc/cpuinfo, that's where intel pstate stores
+- the "current frequencies" that are readable by
+- unprivileged users. */
+- if (!cpufreq_cpu_read_procfs_cpuinfo ())
+- return FALSE;
+-
+- /* now read the remaining cpufreq info for each cpu from sysfs */
+- for (i = 0; i < cpuFreq->cpus->len; i++) {
+- cpu = g_ptr_array_index (cpuFreq->cpus, i);
+- cpufreq_cpu_parse_sysfs_init (i, cpu);
+- }
+- return TRUE;
++ return cpufreq_cpu_read_sysfs ();
+ }
+
+ gboolean
+@@ -417,16 +404,7 @@
+ {
+ gint i;
+
+- if (g_file_test ("/sys/devices/system/cpu/intel_pstate", G_FILE_TEST_EXISTS))
+- {
+- /* read current cpu frequencies from /proc/cpuinfo */
+- cpufreq_cpu_read_procfs_cpuinfo ();
+-
+- /* read current scaling governor from sysfs */
+- for (i = 0; i < cpuFreq->cpus->len; i++)
+- cpufreq_cpu_read_sysfs_current (i);
+- }
+- else if (g_file_test ("/sys/devices/system/cpu/cpu0/cpufreq",
++ if (g_file_test ("/sys/devices/system/cpu/cpu0/cpufreq",
+ G_FILE_TEST_EXISTS))
+ {
+ for (i = 0; i < cpuFreq->cpus->len; i++)
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/xfce4-cpufreq-plugin.git/commitdiff/8a3e407c3fb837af9bc64b676e2769d0d508b65a
More information about the pld-cvs-commit
mailing list