Update to 2.13

This commit is contained in:
yixiangzhike 2021-01-21 18:10:52 +08:00
parent cf25c5aeae
commit 029f1e6be0
8 changed files with 12 additions and 218 deletions

BIN
powertop-2.13.tar.gz Normal file

Binary file not shown.

View File

@ -1,41 +0,0 @@
From f3f350f138912dc89abb37676f7e65fc6057ec53 Mon Sep 17 00:00:00 2001
From: Gautam Paranjape <gautam.paranjape@intel.com>
Date: Fri, 21 Jul 2017 07:02:13 -0700
Subject: [PATCH] Some c-states exposed by the intel_idle driver are assigned
the same line_level, which means that the most recent one assigned can
overwrite another c-state. For example, the C1-SKL c-state is overwritten by
the C1E-SKL c-state because both have a "1" in the name and are assigned the
same line level. To fix this, check if a "sub c-state" (ex. C1E-SKL) is being
inserted. If so, check the vector of c-states if a c-state with similar name
(ex. C1-SKL) exists, and increment the line level.
Signed-off-by: Gautam Paranjape <gautam.paranjape@intel.com>
---
src/cpu/abstract_cpu.cpp | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/cpu/abstract_cpu.cpp b/src/cpu/abstract_cpu.cpp
index bc32336..c59721c 100644
--- a/src/cpu/abstract_cpu.cpp
+++ b/src/cpu/abstract_cpu.cpp
@@ -218,6 +218,17 @@ void abstract_cpu::insert_cstate(const char *linux_name, const char *human_name,
}
if (*c >= '0' && *c <='9') {
state->line_level = strtoull(c, NULL, 10);
+ if(*(c+1) != '-'){
+ int greater_line_level = strtoull(c, NULL, 10);
+ for(unsigned int pos = 0; pos < cstates.size(); pos++){
+ if(*c == cstates[pos]->human_name[1]){
+ if(*(c+1) != cstates[pos]->human_name[2]){
+ greater_line_level = max(greater_line_level, cstates[pos]->line_level);
+ state->line_level = greater_line_level + 1;
+ }
+ }
+ }
+ }
break;
}
c++;
--
2.14.3

View File

@ -1,51 +0,0 @@
From 0d3a1cda2a95484fa41cc4c35294a4153b3a5e97 Mon Sep 17 00:00:00 2001
From: Nivedita Swaminathan <nivedita.swaminathan@intel.com>
Date: Wed, 31 Jan 2018 14:53:28 -0800
Subject: [PATCH] Enable support for Intel CNL-U/Y
This commit adds support for Intel CNL-U/Y platforms
Signed-off-by: Nivedita Swaminathan <nivedita.swaminathan@intel.com>
---
src/cpu/intel_cpus.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/cpu/intel_cpus.cpp b/src/cpu/intel_cpus.cpp
index 4980516..4c7b315 100644
--- a/src/cpu/intel_cpus.cpp
+++ b/src/cpu/intel_cpus.cpp
@@ -68,6 +68,7 @@ static int intel_cpu_models[] = {
0x5E, /* SKY */
0x56, /* BDX-DE */
0x5c, /* BXT-P */
+ 0x66, /* CNL-U/Y */
0x7A, /* GLK */
0x8E, /* KBL */
0x9E, /* KBL */
@@ -166,6 +167,7 @@ nhm_core::nhm_core(int model)
case 0x5E: /* SKY */
case 0x3D: /* BDW */
case 0x5c: /* BXT-P */
+ case 0x66: /* CNL-U/Y */
case 0x7A: /* GLK */
case 0x8E: /* KBL */
case 0x9E: /* KBL */
@@ -347,6 +349,7 @@ nhm_package::nhm_package(int model)
case 0x5E: /* SKY */
case 0x3D: /* BDW */
case 0x5c: /* BXT-P */
+ case 0x66: /* CNL-U/Y */
case 0x7A: /* GLK */
case 0x8E: /* KBL */
case 0x9E: /* KBL */
@@ -380,6 +383,7 @@ nhm_package::nhm_package(int model)
case 0x4E: /* SKY */
case 0x5E: /* SKY */
case 0x5c: /* BXT-P */
+ case 0x66: /* CNL-U/Y */
case 0x7A: /* GLK */
case 0x8E: /* KBL */
case 0x9E: /* KBL */
--
2.14.3

View File

@ -1,66 +0,0 @@
diff --git a/src/cpu/cpu.cpp b/src/cpu/cpu.cpp
index f3711f5..019d922 100644
--- a/src/cpu/cpu.cpp
+++ b/src/cpu/cpu.cpp
@@ -68,7 +68,7 @@ static class abstract_cpu * new_package(int package, int cpu, char * vendor, int
char packagename[128];
if (strcmp(vendor, "GenuineIntel") == 0)
if (family == 6)
- if (is_supported_intel_cpu(model))
+ if (is_supported_intel_cpu(model, cpu))
ret = new class nhm_package(model);
if (!ret)
@@ -105,7 +105,7 @@ static class abstract_cpu * new_core(int core, int cpu, char * vendor, int famil
if (strcmp(vendor, "GenuineIntel") == 0)
if (family == 6)
- if (is_supported_intel_cpu(model))
+ if (is_supported_intel_cpu(model, cpu))
ret = new class nhm_core(model);
if (!ret)
@@ -134,7 +134,7 @@ static class abstract_cpu * new_cpu(int number, char * vendor, int family, int m
if (strcmp(vendor, "GenuineIntel") == 0)
if (family == 6)
- if (is_supported_intel_cpu(model))
+ if (is_supported_intel_cpu(model, number))
ret = new class nhm_cpu;
if (!ret)
diff --git a/src/cpu/intel_cpus.cpp b/src/cpu/intel_cpus.cpp
index 4c7b315..0030dba 100644
--- a/src/cpu/intel_cpus.cpp
+++ b/src/cpu/intel_cpus.cpp
@@ -77,13 +77,15 @@ static int intel_cpu_models[] = {
static int intel_pstate_driver_loaded = -1;
-int is_supported_intel_cpu(int model)
+int is_supported_intel_cpu(int model, int cpu)
{
int i;
+ uint64_t msr;
for (i = 0; intel_cpu_models[i] != 0; i++)
if (model == intel_cpu_models[i])
- return 1;
+ if (cpu < 0 || read_msr(cpu, MSR_APERF, &msr) >= 0)
+ return 1;
return 0;
}
diff --git a/src/cpu/intel_cpus.h b/src/cpu/intel_cpus.h
index d20db9a..79afb98 100644
--- a/src/cpu/intel_cpus.h
+++ b/src/cpu/intel_cpus.h
@@ -172,7 +172,7 @@ public:
};
-int is_supported_intel_cpu(int model);
+int is_supported_intel_cpu(int model, int cpu);
int byt_has_ahci();
int is_intel_pstate_driver_loaded();

View File

@ -1,51 +0,0 @@
From 523b15bd892f036bb6b777ad6c88f334f0980347 Mon Sep 17 00:00:00 2001
From: Nivedita Swaminathan <nivedita.swaminathan@intel.com>
Date: Wed, 31 Jan 2018 14:41:18 -0800
Subject: [PATCH] Enable support for Intel GLK
This commit enables support for Intel GLK platforms
Signed-off-by: Nivedita Swaminathan <nivedita.saminathan@intel.com>
---
src/cpu/intel_cpus.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/cpu/intel_cpus.cpp b/src/cpu/intel_cpus.cpp
index 3901342..4980516 100644
--- a/src/cpu/intel_cpus.cpp
+++ b/src/cpu/intel_cpus.cpp
@@ -68,6 +68,7 @@ static int intel_cpu_models[] = {
0x5E, /* SKY */
0x56, /* BDX-DE */
0x5c, /* BXT-P */
+ 0x7A, /* GLK */
0x8E, /* KBL */
0x9E, /* KBL */
0 /* last entry must be zero */
@@ -165,6 +166,7 @@ nhm_core::nhm_core(int model)
case 0x5E: /* SKY */
case 0x3D: /* BDW */
case 0x5c: /* BXT-P */
+ case 0x7A: /* GLK */
case 0x8E: /* KBL */
case 0x9E: /* KBL */
has_c7_res = 1;
@@ -345,6 +347,7 @@ nhm_package::nhm_package(int model)
case 0x5E: /* SKY */
case 0x3D: /* BDW */
case 0x5c: /* BXT-P */
+ case 0x7A: /* GLK */
case 0x8E: /* KBL */
case 0x9E: /* KBL */
has_c2c6_res=1;
@@ -377,6 +380,7 @@ nhm_package::nhm_package(int model)
case 0x4E: /* SKY */
case 0x5E: /* SKY */
case 0x5c: /* BXT-P */
+ case 0x7A: /* GLK */
case 0x8E: /* KBL */
case 0x9E: /* KBL */
has_c8c9c10_res = 1;
--
2.14.3

Binary file not shown.

View File

@ -1,17 +1,13 @@
Name: powertop Name: powertop
Version: 2.9 Version: 2.13
Release: 12 Release: 1
Summary: Power consumption tool for Linux Summary: Power consumption tool for Linux
License: GPLv2 License: GPLv2
URL: http://01.org/powertop/ URL: http://01.org/powertop/
Source0: http://01.org/sites/default/files/downloads/powertop/%{name}-v%{version}.tar.gz Source0: https://01.org/sites/default/files/downloads//%{name}-%{version}.tar.gz
Source1: powertop.service Source1: powertop.service
Patch0: powertop-2.7-always-create-params.patch Patch1: backport-powertop-2.7-always-create-params.patch
Patch1: powertop-2.9-cstates-rewrite-fix.patch
Patch2: powertop-2.9-intel-glk-support.patch
Patch3: powertop-2.9-intel-cnluy-support.patch
Patch4: powertop-2.9-intel-cpu-check-aperf.patch
BuildRequires: gcc gcc-c++ git systemd BuildRequires: gcc gcc-c++ git systemd
BuildRequires: gettext-devel ncurses-devel pciutils-devel zlib-devel libnl3-devel BuildRequires: gettext-devel ncurses-devel pciutils-devel zlib-devel libnl3-devel
@ -28,7 +24,7 @@ management settings for cases where the Linux distribution has not enabled these
%package_help %package_help
%prep %prep
%autosetup -n %{name}-v%{version} -p1 -Sgit %autosetup -n %{name}-%{version} -p1 -Sgit
%build %build
%configure %configure
@ -64,12 +60,19 @@ touch %{_localstatedir}/cache/powertop/{saved_parameters.powertop,saved_results.
%dir %{_localstatedir}/cache/powertop %dir %{_localstatedir}/cache/powertop
%ghost %{_localstatedir}/cache/powertop/saved_parameters.powertop %ghost %{_localstatedir}/cache/powertop/saved_parameters.powertop
%ghost %{_localstatedir}/cache/powertop/saved_results.powertop %ghost %{_localstatedir}/cache/powertop/saved_results.powertop
%{_datadir}/bash-completion/completions/powertop
%files help %files help
%{_mandir}/man8/powertop.8* %{_mandir}/man8/powertop.8*
%changelog %changelog
* Thu Jan 21 2021 yixiangzhike <zhangxingliang3@huawei.com> - 2.13-1
- Type:requirement
- ID:NA
- SUG:NA
- DESC:update to 2.13
* Sat Sep 19 2020 liquor <lirui130@huawei.com> - 2.9-12 * Sat Sep 19 2020 liquor <lirui130@huawei.com> - 2.9-12
- Type:bugfix - Type:bugfix
- ID:NA - ID:NA