SHA256
1
0
forked from pool/cpupower
Dominique Leuenberger 2020-11-19 11:00:40 +00:00 committed by Git OBS Bridge
commit 8f0051b1e7
12 changed files with 59 additions and 316 deletions

View File

@ -1,34 +0,0 @@
From: Brahadambal Srinivasan <latha@linux.vnet.ibm.com>
Subject: Correction to manpage of cpupower
References: bsc#1162142
Patch-Mainline:
Git-commit: 8c30fa7666ff08dad632411d1a9b9883940e53ef
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git
Manpage of cpupower is listing wrong sub-commands in "See Also"
section. The option for cpupower-idle(1) should actually be
cpupower-idle-info(1) and cpupower-idle-set(1). This patch corrects
this anomaly.
Signed-off-by: Brahadambal Srinivasan <latha@linux.vnet.ibm.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: <trenn@suse.com>
diff --git a/man/cpupower.1 b/man/cpupower.1
index baf741d06e82..a5e4523a219b 100644
--- a/man/cpupower.1
+++ b/man/cpupower.1
@@ -62,9 +62,9 @@ all cores
Print the package name and version number.
.SH "SEE ALSO"
-cpupower-set(1), cpupower-info(1), cpupower-idle(1),
-cpupower-frequency-set(1), cpupower-frequency-info(1), cpupower-monitor(1),
-powertop(1)
+cpupower-set(1), cpupower-info(1), cpupower-idle-info(1),
+cpupower-idle-set(1), cpupower-frequency-set(1), cpupower-frequency-info(1),
+cpupower-monitor(1), powertop(1)
.PP
.SH AUTHORS
.nf

3
cpupower-5.10.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d46499057528206fc86f494c84e5677d5d6a76e01e070f92fbbf7b43b54f3b71
size 74850

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1b7678de31ac93bb8d86bfb552b020596138f56471994beb889215fbf9527442
size 74793

View File

@ -1,241 +0,0 @@
From: Thomas Renninger <trenn@suse.de>
Subject: cpupower: Revert library ABI changes from commit ae2917093fb60bdc1ed3e
References: bsc#1162142
Patch-Mainline:
Git-commit: 41ddb7e1f79693d904502ae9bea609837973eff8
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git
Commit ae2917093fb6 ("tools/power/cpupower: Display boost frequency
separately") modified the library function:
struct cpufreq_available_frequencies
*cpufreq_get_available_frequencies(unsigned int cpu)
to
struct cpufreq_frequencies
*cpufreq_get_frequencies(const char *type, unsigned int cpu)
This patch recovers the old API and implements the new functionality
in a newly introduce method:
struct cpufreq_boost_frequencies
*cpufreq_get_available_frequencies(unsigned int cpu)
This one should get merged into stable kernels back to 5.0 when
the above had been introduced.
Fixes: ae2917093fb6 ("tools/power/cpupower: Display boost frequency separately")
Cc: stable@vger.kernel.org
Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: <trenn@suse.com>
diff --git a/lib/cpufreq.c b/lib/cpufreq.c
index 2f55d4d23446..6e04304560ca 100644
--- a/lib/cpufreq.c
+++ b/lib/cpufreq.c
@@ -332,21 +332,74 @@ void cpufreq_put_available_governors(struct cpufreq_available_governors *any)
}
-struct cpufreq_frequencies
-*cpufreq_get_frequencies(const char *type, unsigned int cpu)
+struct cpufreq_available_frequencies
+*cpufreq_get_available_frequencies(unsigned int cpu)
{
- struct cpufreq_frequencies *first = NULL;
- struct cpufreq_frequencies *current = NULL;
+ struct cpufreq_available_frequencies *first = NULL;
+ struct cpufreq_available_frequencies *current = NULL;
char one_value[SYSFS_PATH_MAX];
char linebuf[MAX_LINE_LEN];
- char fname[MAX_LINE_LEN];
unsigned int pos, i;
unsigned int len;
- snprintf(fname, MAX_LINE_LEN, "scaling_%s_frequencies", type);
+ len = sysfs_cpufreq_read_file(cpu, "scaling_available_frequencies",
+ linebuf, sizeof(linebuf));
+ if (len == 0)
+ return NULL;
- len = sysfs_cpufreq_read_file(cpu, fname,
- linebuf, sizeof(linebuf));
+ pos = 0;
+ for (i = 0; i < len; i++) {
+ if (linebuf[i] == ' ' || linebuf[i] == '\n') {
+ if (i - pos < 2)
+ continue;
+ if (i - pos >= SYSFS_PATH_MAX)
+ goto error_out;
+ if (current) {
+ current->next = malloc(sizeof(*current));
+ if (!current->next)
+ goto error_out;
+ current = current->next;
+ } else {
+ first = malloc(sizeof(*first));
+ if (!first)
+ goto error_out;
+ current = first;
+ }
+ current->first = first;
+ current->next = NULL;
+
+ memcpy(one_value, linebuf + pos, i - pos);
+ one_value[i - pos] = '\0';
+ if (sscanf(one_value, "%lu", &current->frequency) != 1)
+ goto error_out;
+
+ pos = i + 1;
+ }
+ }
+
+ return first;
+
+ error_out:
+ while (first) {
+ current = first->next;
+ free(first);
+ first = current;
+ }
+ return NULL;
+}
+
+struct cpufreq_available_frequencies
+*cpufreq_get_boost_frequencies(unsigned int cpu)
+{
+ struct cpufreq_available_frequencies *first = NULL;
+ struct cpufreq_available_frequencies *current = NULL;
+ char one_value[SYSFS_PATH_MAX];
+ char linebuf[MAX_LINE_LEN];
+ unsigned int pos, i;
+ unsigned int len;
+
+ len = sysfs_cpufreq_read_file(cpu, "scaling_boost_frequencies",
+ linebuf, sizeof(linebuf));
if (len == 0)
return NULL;
@@ -391,9 +444,9 @@ struct cpufreq_frequencies
return NULL;
}
-void cpufreq_put_frequencies(struct cpufreq_frequencies *any)
+void cpufreq_put_available_frequencies(struct cpufreq_available_frequencies *any)
{
- struct cpufreq_frequencies *tmp, *next;
+ struct cpufreq_available_frequencies *tmp, *next;
if (!any)
return;
@@ -406,6 +459,11 @@ void cpufreq_put_frequencies(struct cpufreq_frequencies *any)
}
}
+void cpufreq_put_boost_frequencies(struct cpufreq_available_frequencies *any)
+{
+ cpufreq_put_available_frequencies(any);
+}
+
static struct cpufreq_affected_cpus *sysfs_get_cpu_list(unsigned int cpu,
const char *file)
{
diff --git a/lib/cpufreq.h b/lib/cpufreq.h
index a55f0d19215b..95f4fd9e2656 100644
--- a/lib/cpufreq.h
+++ b/lib/cpufreq.h
@@ -20,10 +20,10 @@ struct cpufreq_available_governors {
struct cpufreq_available_governors *first;
};
-struct cpufreq_frequencies {
+struct cpufreq_available_frequencies {
unsigned long frequency;
- struct cpufreq_frequencies *next;
- struct cpufreq_frequencies *first;
+ struct cpufreq_available_frequencies *next;
+ struct cpufreq_available_frequencies *first;
};
@@ -124,11 +124,17 @@ void cpufreq_put_available_governors(
* cpufreq_put_frequencies after use.
*/
-struct cpufreq_frequencies
-*cpufreq_get_frequencies(const char *type, unsigned int cpu);
+struct cpufreq_available_frequencies
+*cpufreq_get_available_frequencies(unsigned int cpu);
-void cpufreq_put_frequencies(
- struct cpufreq_frequencies *first);
+void cpufreq_put_available_frequencies(
+ struct cpufreq_available_frequencies *first);
+
+struct cpufreq_available_frequencies
+*cpufreq_get_boost_frequencies(unsigned int cpu);
+
+void cpufreq_put_boost_frequencies(
+ struct cpufreq_available_frequencies *first);
/* determine affected CPUs
diff --git a/utils/cpufreq-info.c b/utils/cpufreq-info.c
index e63cf55f81cf..6efc0f6b1b11 100644
--- a/utils/cpufreq-info.c
+++ b/utils/cpufreq-info.c
@@ -244,14 +244,14 @@ static int get_boost_mode_x86(unsigned int cpu)
static int get_boost_mode(unsigned int cpu)
{
- struct cpufreq_frequencies *freqs;
+ struct cpufreq_available_frequencies *freqs;
if (cpupower_cpu_info.vendor == X86_VENDOR_AMD ||
cpupower_cpu_info.vendor == X86_VENDOR_HYGON ||
cpupower_cpu_info.vendor == X86_VENDOR_INTEL)
return get_boost_mode_x86(cpu);
- freqs = cpufreq_get_frequencies("boost", cpu);
+ freqs = cpufreq_get_boost_frequencies(cpu);
if (freqs) {
printf(_(" boost frequency steps: "));
while (freqs->next) {
@@ -261,7 +261,7 @@ static int get_boost_mode(unsigned int cpu)
}
print_speed(freqs->frequency);
printf("\n");
- cpufreq_put_frequencies(freqs);
+ cpufreq_put_available_frequencies(freqs);
}
return 0;
@@ -475,7 +475,7 @@ static int get_latency(unsigned int cpu, unsigned int human)
static void debug_output_one(unsigned int cpu)
{
- struct cpufreq_frequencies *freqs;
+ struct cpufreq_available_frequencies *freqs;
get_driver(cpu);
get_related_cpus(cpu);
@@ -483,7 +483,7 @@ static void debug_output_one(unsigned int cpu)
get_latency(cpu, 1);
get_hardware_limits(cpu, 1);
- freqs = cpufreq_get_frequencies("available", cpu);
+ freqs = cpufreq_get_available_frequencies(cpu);
if (freqs) {
printf(_(" available frequency steps: "));
while (freqs->next) {
@@ -493,7 +493,7 @@ static void debug_output_one(unsigned int cpu)
}
print_speed(freqs->frequency);
printf("\n");
- cpufreq_put_frequencies(freqs);
+ cpufreq_put_available_frequencies(freqs);
}
get_available_governors(cpu);

View File

@ -1,3 +1,24 @@
-------------------------------------------------------------------
Thu Nov 12 22:01:00 UTC 2020 - Thomas Renninger <trenn@suse.de>
- Update turbostat to latest version 20.09.30 including:
* jsc#SLE-13412, jsc#SLE-13174 (rocket lake support)
* jsc#SLE-13448 (Alder Lake support)
* jsc#SLE-13348, jsc#SLE-13171 (Sapphire Rapid support)
* Support AMD Fam 19h
- Touched patches:
Deleted mainline integrated patches:
D Correction-to-manpage-of-cpupower.patch
D cpupower-Revert-library-ABI-changes-from-commit-ae2917093fb60bdc1ed3e.patch
Patches refreshed:
M rapl_monitor.patch
M turbostat_makefile_fix_asm_header.patch
-------------------------------------------------------------------
Thu Oct 15 18:20:53 UTC 2020 - Thomas Renninger <trenn@suse.de>
- Update intel-speed-select to version 1.6 (jsc#SLE-13334)
-------------------------------------------------------------------
Wed Jun 17 12:17:02 UTC 2020 - Paolo Stivanin <info@paolostivanin.com>

View File

@ -20,14 +20,14 @@
# Use this as version when things are in mainline kernel
%define version %(rpm -q --qf '%{VERSION}' kernel-source)
%define tsversion 20.03.20
%define tsversion 20.09.30
%define pbversion 17.05.11
%define ssversion 1.3
%define ssversion 1.6
Name: cpupower
# Use this as version when things are in mainline kernel
%define version %(rpm -q --qf '%VERSION' kernel-source)
Version: 5.5
Version: 5.10
Release: 0
Summary: Tools to determine and set CPU Power related Settings
License: GPL-2.0-only
@ -42,8 +42,6 @@ Source5: Makefile.intel-speed-select
Patch1: cpupower_rapl.patch
Patch2: rapl_monitor.patch
Patch3: cpupower_exclude_kernel_Makefile.patch
Patch4: cpupower-Revert-library-ABI-changes-from-commit-ae2917093fb60bdc1ed3e.patch
Patch5: Correction-to-manpage-of-cpupower.patch
Patch6: amd_do_not_show_amount_of_boost_states_if_zero.patch
#turbostat patches
@ -99,8 +97,6 @@ powersave module.
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
cd ../turbostat-%{tsversion}

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:64f5db5ee2b831ebbe88f968fd9e00217613758b09de0fc282fa9a27cc79798a
size 22313

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:dbc0766c94c61d16010059aa2440bda0e448e0c99cec268624b9ba940f92e0a6
size 22679

View File

@ -3,11 +3,16 @@ cpupower: rapl monitor - shows the used power consumption in uj for each rapl do
Signed-off-by: Thomas Renninger <trenn@suse.com>
Index: cpupower-5.5/Makefile
===================================================================
--- cpupower-5.5.orig/Makefile 2019-11-28 14:44:23.261812260 +0100
+++ cpupower-5.5/Makefile 2019-11-28 14:44:28.457812540 +0100
@@ -131,6 +131,7 @@ UTIL_OBJS = utils/helpers/amd.o utils/h
---
Makefile | 1
utils/idle_monitor/cpupower-monitor.c | 7 -
utils/idle_monitor/idle_monitors.def | 1
utils/idle_monitor/rapl_monitor.c | 141 ++++++++++++++++++++++++++++++++++
4 files changed, 147 insertions(+), 3 deletions(-)
--- a/Makefile
+++ b/Makefile
@@ -131,6 +131,7 @@
utils/idle_monitor/hsw_ext_idle.o \
utils/idle_monitor/amd_fam14h_idle.o utils/idle_monitor/cpuidle_sysfs.o \
utils/idle_monitor/mperf_monitor.o utils/idle_monitor/cpupower-monitor.o \
@ -15,11 +20,9 @@ Index: cpupower-5.5/Makefile
utils/cpupower.o utils/cpufreq-info.o utils/cpufreq-set.o \
utils/cpupower-set.o utils/cpupower-info.o utils/cpuidle-info.o \
utils/cpuidle-set.o utils/powercap-info.o
Index: cpupower-5.5/utils/idle_monitor/cpupower-monitor.c
===================================================================
--- cpupower-5.5.orig/utils/idle_monitor/cpupower-monitor.c 2019-11-28 14:44:23.261812260 +0100
+++ cpupower-5.5/utils/idle_monitor/cpupower-monitor.c 2019-11-28 14:44:28.457812540 +0100
@@ -457,9 +457,10 @@ int cmd_monitor(int argc, char **argv)
--- a/utils/idle_monitor/cpupower-monitor.c
+++ b/utils/idle_monitor/cpupower-monitor.c
@@ -459,9 +459,10 @@
print_results(1, cpu);
}
@ -33,21 +36,17 @@ Index: cpupower-5.5/utils/idle_monitor/cpupower-monitor.c
cpu_topology_release(cpu_top);
return 0;
}
Index: cpupower-5.5/utils/idle_monitor/idle_monitors.def
===================================================================
--- cpupower-5.5.orig/utils/idle_monitor/idle_monitors.def 2019-11-28 14:44:23.261812260 +0100
+++ cpupower-5.5/utils/idle_monitor/idle_monitors.def 2019-11-28 14:44:28.457812540 +0100
@@ -4,5 +4,6 @@ DEF(intel_nhm)
--- a/utils/idle_monitor/idle_monitors.def
+++ b/utils/idle_monitor/idle_monitors.def
@@ -4,5 +4,6 @@
DEF(intel_snb)
DEF(intel_hsw_ext)
DEF(mperf)
+DEF(rapl)
#endif
DEF(cpuidle_sysfs)
Index: cpupower-5.5/utils/idle_monitor/rapl_monitor.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ cpupower-5.5/utils/idle_monitor/rapl_monitor.c 2019-11-28 14:44:54.909813966 +0100
--- /dev/null
+++ b/utils/idle_monitor/rapl_monitor.c
@@ -0,0 +1,141 @@
+/*
+ * (C) 2016 Thomas Renninger <trenn@suse.com>

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:89159ac34c93da1ec7e6a671a78abec7f58524c2c7a89d279b83349849466179
size 45070

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:13f265b786c431f0498b0c02ce5de678bbc77010c6aea6a33dc84ffbedb1cbfa
size 46775

View File

@ -1,8 +1,10 @@
Index: turbostat-19.08.31/Makefile
===================================================================
--- turbostat-19.08.31.orig/Makefile 2019-10-29 15:23:56.962276473 +0100
+++ turbostat-19.08.31/Makefile 2019-10-29 16:12:52.926434670 +0100
@@ -9,9 +9,9 @@ ifeq ("$(origin O)", "command line")
---
Makefile | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/Makefile
+++ b/Makefile
@@ -9,9 +9,9 @@
endif
turbostat : turbostat.c
@ -12,6 +14,6 @@ Index: turbostat-19.08.31/Makefile
+override CFLAGS += -O2 -Wall -I ./include
+override CFLAGS += -DMSRHEADER='"msr-index.h"'
+override CFLAGS += -DINTEL_FAMILY_HEADER='"intel-family.h"'
override CFLAGS += -D_FILE_OFFSET_BITS=64
override CFLAGS += -D_FORTIFY_SOURCE=2
%: %.c