diff --git a/.gitignore b/.gitignore index 3094c20..1cbfdf2 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/powertop-v2.9.tar.gz +SOURCES/powertop-2.11.tar.gz diff --git a/.powertop.metadata b/.powertop.metadata index d7851c2..7515135 100644 --- a/.powertop.metadata +++ b/.powertop.metadata @@ -1 +1 @@ -0b49a0fe9fd8a1026faf731a959146ed93d83153 SOURCES/powertop-v2.9.tar.gz +c39cec7fcb8a491f4e1bd26f1a7e6c28bb38f3c2 SOURCES/powertop-2.11.tar.gz diff --git a/SOURCES/powertop-2.9-cstates-rewrite-fix.patch b/SOURCES/powertop-2.9-cstates-rewrite-fix.patch deleted file mode 100644 index 3119bc8..0000000 --- a/SOURCES/powertop-2.9-cstates-rewrite-fix.patch +++ /dev/null @@ -1,41 +0,0 @@ -From f3f350f138912dc89abb37676f7e65fc6057ec53 Mon Sep 17 00:00:00 2001 -From: Gautam Paranjape -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 ---- - 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 - diff --git a/SOURCES/powertop-2.9-intel-cnluy-support.patch b/SOURCES/powertop-2.9-intel-cnluy-support.patch deleted file mode 100644 index 7e3a3b4..0000000 --- a/SOURCES/powertop-2.9-intel-cnluy-support.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 0d3a1cda2a95484fa41cc4c35294a4153b3a5e97 Mon Sep 17 00:00:00 2001 -From: Nivedita Swaminathan -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 ---- - 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 - diff --git a/SOURCES/powertop-2.9-intel-cpu-check-aperf.patch b/SOURCES/powertop-2.9-intel-cpu-check-aperf.patch deleted file mode 100644 index 4793685..0000000 --- a/SOURCES/powertop-2.9-intel-cpu-check-aperf.patch +++ /dev/null @@ -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(); diff --git a/SOURCES/powertop-2.9-intel-glk-support.patch b/SOURCES/powertop-2.9-intel-glk-support.patch deleted file mode 100644 index fa086ab..0000000 --- a/SOURCES/powertop-2.9-intel-glk-support.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 523b15bd892f036bb6b777ad6c88f334f0980347 Mon Sep 17 00:00:00 2001 -From: Nivedita Swaminathan -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 ---- - 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 - diff --git a/SPECS/powertop.spec b/SPECS/powertop.spec index 1fd92e4..9f2aa1d 100644 --- a/SPECS/powertop.spec +++ b/SPECS/powertop.spec @@ -1,22 +1,18 @@ Name: powertop -Version: 2.9 -Release: 8%{?dist} +Version: 2.11 +Release: 1%{?dist} Summary: Power consumption monitor Group: Applications/System License: GPLv2 URL: http://01.org/powertop/ -Source0: http://01.org/sites/default/files/downloads/powertop/%{name}-v%{version}.tar.gz +Source0: http://github.com/fenrus75/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz Source1: powertop.service # Sent upstream Patch0: 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: gettext-devel, ncurses-devel, pciutils-devel, zlib-devel, libnl3-devel -BuildRequires: systemd +BuildRequires: automake, libtool, systemd BuildRequires: gcc, gcc-c++ Requires(post): systemd, coreutils Requires(preun): systemd @@ -28,18 +24,14 @@ PowerTOP is a tool that finds the software component(s) that make your computer use more power than necessary while it is idle. %prep -%setup -q -n %{name}-v%{version} +%setup -q %patch0 -p1 -b .always-create-params -# https://github.com/fenrus75/powertop/commit/f3f350f138912dc89abb37676f7e65fc6057ec53 -%patch1 -p1 -b .cstates-rewrite-fix -# https://github.com/fenrus75/powertop/commit/523b15bd892f036bb6b777ad6c88f334f0980347 -%patch2 -p1 -b .intel-glk-support -# https://github.com/fenrus75/powertop/commit/0d3a1cda2a95484fa41cc4c35294a4153b3a5e97 -%patch3 -p1 -b .intel-cnluy-support -# sent upstream -%patch4 -p1 -b .intel-cpu-check-aperf + +echo "v%{version}" > version-long +echo '"v%{version}"' > version-short %build +autoreconf -fi %configure make %{?_smp_mflags} CFLAGS="%{optflags}" @@ -73,8 +65,17 @@ touch %{_localstatedir}/cache/powertop/{saved_parameters.powertop,saved_results. %{_sbindir}/powertop %{_mandir}/man8/powertop.8* %{_unitdir}/powertop.service +%{_datadir}/bash-completion/completions/powertop %changelog +* Fri Nov 1 2019 Jaroslav Škarvada - 2.11-1 +- New version + Resolves: rhbz#1716721 +- Changed source to github and bootstraps sources +- Dropped cstates-rewrite-fix, intel-glk-support, intel-cnluy-support, + intel-cpu-check-aperf patches (all upstreamed) +- Added bash completion + * Fri May 4 2018 Jaroslav Škarvada - 2.9-8 - Use intel_cpu only if APERF MSR is supported, it fixes powertop on KVM (by intel-cpu-check-aperf patch)