Accepting request 588630 from Base:System

- Remove powertop-no-date.patch: upstreamed

- Upgrade to version 2.9
Already mainline:
D powertop-2.8-potential-segfaults.patch
D powertop-no-date.patch
From mainline (after 2.9):
A powertop_cstate_fix.patch
A powertop_libc++_fix.patch

OBS-URL: https://build.opensuse.org/request/show/588630
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/powertop?expand=0&rev=46
This commit is contained in:
Dominique Leuenberger 2018-03-20 21:00:15 +00:00 committed by Git OBS Bridge
commit 536f2e7c1d
8 changed files with 102 additions and 1039 deletions

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -1,12 +0,0 @@
diff -Nru powertop-2.1.orig/src/main.cpp powertop-2.1/src/main.cpp
--- powertop-2.1.orig/src/main.cpp 2012-08-21 01:43:23.616729444 -0400
+++ powertop-2.1/src/main.cpp 2012-08-21 01:44:07.582480500 -0400
@@ -98,7 +98,7 @@
static void print_version()
{
- printf(_("PowerTOP version " POWERTOP_VERSION ", compiled on " __DATE__ "\n"));
+ printf(_("PowerTOP version " POWERTOP_VERSION "\n"));
}
static bool set_refresh_timeout()

3
powertop-v2.9.tar.gz Normal file
View File

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

View File

@ -1,3 +1,20 @@
-------------------------------------------------------------------
Mon Mar 19 14:23:40 UTC 2018 - mvetter@suse.com
- Remove powertop-no-date.patch: upstreamed
-------------------------------------------------------------------
Fri Dec 1 16:16:40 UTC 2017 - trenn@suse.de
- Upgrade to version 2.9
Already mainline:
D powertop-2.8-potential-segfaults.patch
D powertop-no-date.patch
From mainline (after 2.9):
A powertop_cstate_fix.patch
A powertop_libc++_fix.patch
-------------------------------------------------------------------
Mon Jun 12 13:42:07 UTC 2017 - adam.majer@suse.de

View File

@ -1,7 +1,7 @@
#
# spec file for package powertop
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -17,18 +17,17 @@
Name: powertop
Version: 2.8
Version: 2.9
Release: 0
#Git-Clone: git://github.com/fenrus75/powertop
Summary: A Linux Tool to Find out What is Using Power on a Laptop
License: GPL-2.0
Group: System/Monitoring
Url: https://01.org/powertop/
Source0: https://01.org/sites/default/files/downloads/%{name}/%{name}-%{version}.tar.gz
Source0: https://01.org/sites/default/files/downloads/%{name}/%{name}-v%{version}.tar.gz
Source1: powertop.service
Patch0: powertop-no-date.patch
# PATCH-FIX-UPSTREAM powertop-2.8-potential-segfaults.patch zaitor@opensuse.org -- Fix potential segfaults.
Patch1: powertop-2.8-potential-segfaults.patch
Patch1: powertop_cstate_fix.patch
Patch2: powertop_libc++_fix.patch
BuildRequires: gcc-c++
BuildRequires: gettext
BuildRequires: ncurses-devel
@ -50,9 +49,9 @@ doing in terms of power savings.
%lang_package
%prep
%setup -q
%patch0 -p1
%setup -qn powertop-v%{version}
%patch1 -p1
%patch2 -p1
# Delete objects files left in tarball
find . -name '*.o' -delete

38
powertop_cstate_fix.patch Normal file
View File

@ -0,0 +1,38 @@
commit f3f350f138912dc89abb37676f7e65fc6057ec53
Author: Gautam Paranjape <gautam.paranjape@intel.com>
Date: Fri Jul 21 07:02:13 2017 -0700
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>
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++;

37
powertop_libc++_fix.patch Normal file
View File

@ -0,0 +1,37 @@
commit b9c431aad6cc5383c9571007469eee8e64ec85a6
Author: Manoj Gupta <manojgupta@chromium.org>
Date: Sat Nov 4 13:44:04 2017 -0700
Fix powertop build with libc++.
<ctime> header is not automatically included with libc++.
Add it explicitly to make powertop build with libc++.
This fixes the following errors:
devices/gpu_rapl_device.cpp:35:14: error: use of undeclared identifier
'time'; did you mean 'tie'?
last_time = time(NULL);
^~~~
devices/gpu_rapl_device.cpp:45:14: error:use of undeclared identifier
'time'; did you mean 'tie'?
last_time = time(NULL);
^~~~
parameters/learn.cpp:161:10: error: use of undeclared identifier
'time'; did you mean 'tie'?
start = time(NULL);
^~~~
diff --git a/src/lib.h b/src/lib.h
index b64bb0f..6d85eb6 100644
--- a/src/lib.h
+++ b/src/lib.h
@@ -54,7 +54,7 @@ extern const char *kernel_function(uint64_t address);
-
+#include <ctime>
#include <string>
using namespace std;