SHA256
1
0
forked from pool/tuned

Accepting request 315866 from home:bmwiedemann:branches:Base:System

fix syntax (bnc#937647)

OBS-URL: https://build.opensuse.org/request/show/315866
OBS-URL: https://build.opensuse.org/package/show/Base:System/tuned?expand=0&rev=32
This commit is contained in:
Denisart Benjamin 2015-07-10 20:35:28 +00:00 committed by Git OBS Bridge
parent 7cf0298290
commit f4273c4f86
3 changed files with 15 additions and 10 deletions

View File

@ -1,8 +1,8 @@
Index: tuned-2.3.0/tuned/plugins/plugin_cpu.py
Index: tuned-2.4.1/tuned/plugins/plugin_cpu.py
===================================================================
--- tuned-2.3.0.orig/tuned/plugins/plugin_cpu.py
+++ tuned-2.3.0/tuned/plugins/plugin_cpu.py
@@ -91,7 +91,8 @@
--- tuned-2.4.1.orig/tuned/plugins/plugin_cpu.py
+++ tuned-2.4.1/tuned/plugins/plugin_cpu.py
@@ -91,7 +91,8 @@ class CPULatencyPlugin(base.Plugin):
# Check for cpupower, use workaround if not available
self._check_cpupower()
# Check for x86_energy_perf_policy, ignore if not available / supported
@ -12,7 +12,7 @@ Index: tuned-2.3.0/tuned/plugins/plugin_cpu.py
# Check for intel_pstate
self._check_intel_pstate()
else:
@@ -207,7 +208,17 @@
@@ -207,7 +208,17 @@ class CPULatencyPlugin(base.Plugin):
@command_set("energy_perf_bias", per_device=True)
def _set_energy_perf_bias(self, energy_perf_bias, device):
@ -26,19 +26,19 @@ Index: tuned-2.3.0/tuned/plugins/plugin_cpu.py
+ elif bias_str == "normal":
+ bias_str = "6"
+ cpu_id = device.lstrip("cpu")
+ tuned.utils.commands.execute(["cpupower", "-c", cpu_id, "set", "-b", bias_str])
+ self._cmd.execute(["cpupower", "-c", cpu_id, "set", "-b", bias_str])
+ elif self._has_energy_perf_bias:
log.info("setting energy_perf_bias '%s' on cpu '%s'" % (energy_perf_bias, device))
cpu_id = device.lstrip("cpu")
self._cmd.execute(["x86_energy_perf_policy", "-c", cpu_id, str(energy_perf_bias)])
@@ -215,14 +226,21 @@
@@ -215,14 +226,21 @@ class CPULatencyPlugin(base.Plugin):
@command_get("energy_perf_bias")
def _get_energy_perf_bias(self, device):
energy_perf_bias = None
- if self._has_energy_perf_bias:
+ if self._has_cpupower is True:
+ cpu_id = device.lstrip("cpu")
+ retcode, lines = tuned.utils.commands.execute(["cpupower", "-c", cpu_id, "info", "-b"])
+ retcode, lines = self._cmd.execute(["cpupower", "-c", cpu_id, "info", "-b"])
+ elif self._has_energy_perf_bias:
cpu_id = device.lstrip("cpu")
retcode, lines = self._cmd.execute(["x86_energy_perf_policy", "-c", cpu_id, "-r"])
@ -48,7 +48,7 @@ Index: tuned-2.3.0/tuned/plugins/plugin_cpu.py
- if len(l) == 2:
- energy_perf_bias = l[1]
- break
+ else:
+ else:
+ return None
+ if retcode == 0:
+ for line in lines.splitlines():

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Fri Jul 10 12:08:42 UTC 2015 - bwiedemann@suse.com
- fix syntax (bnc#937647)
-------------------------------------------------------------------
Mon Jan 5 15:07:22 UTC 2015 - p.drouand@gmail.com

View File

@ -1,7 +1,7 @@
#
# spec file for package tuned
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2015 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