Accepting request 316844 from home:pluskalm:branches:Base:System

- tuned-2.4.0-use_cpupower_for_intel_perf_bias.patch
  * fixed indentation and tabs usage

OBS-URL: https://build.opensuse.org/request/show/316844
OBS-URL: https://build.opensuse.org/package/show/Base:System/tuned?expand=0&rev=35
This commit is contained in:
Thomas Renninger 2015-07-15 11:30:42 +00:00 committed by Git OBS Bridge
parent 11670d30c6
commit ae2ed4568c
3 changed files with 32 additions and 26 deletions

View File

@ -17,17 +17,17 @@ Index: tuned-2.5.0/tuned/plugins/plugin_cpu.py
log.debug("%s is not online, skipping" % device)
return None
- if self._has_energy_perf_bias:
+ if self._has_cpupower is True:
+ bias_str = str(energy_perf_bias)
+ if bias_str == "performance":
+ bias_str = "0"
+ elif bias_str == "powersave":
+ bias_str = "15"
+ elif bias_str == "normal":
+ bias_str = "6"
+ cpu_id = device.lstrip("cpu")
+ self._cmd.execute(["cpupower", "-c", cpu_id, "set", "-b", bias_str])
+ elif self._has_energy_perf_bias:
+ if self._has_cpupower is True:
+ bias_str = str(energy_perf_bias)
+ if bias_str == "performance":
+ bias_str = "0"
+ elif bias_str == "powersave":
+ bias_str = "15"
+ elif bias_str == "normal":
+ bias_str = "6"
+ cpu_id = device.lstrip("cpu")
+ self._cmd.execute(["cpupower", "-c", cpu_id, "set", "-b", bias_str])
+ elif self._has_energy_perf_bias:
if not sim:
cpu_id = device.lstrip("cpu")
log.info("setting energy_perf_bias '%s' on cpu '%s'" % (energy_perf_bias, device))
@ -36,10 +36,10 @@ Index: tuned-2.5.0/tuned/plugins/plugin_cpu.py
log.debug("%s is not online, skipping" % device)
return None
- if self._has_energy_perf_bias:
+ if self._has_cpupower is True:
+ cpu_id = device.lstrip("cpu")
+ retcode, lines = self._cmd.execute(["cpupower", "-c", cpu_id, "info", "-b"])
+ elif self._has_energy_perf_bias:
+ if self._has_cpupower is True:
+ cpu_id = device.lstrip("cpu")
+ 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"])
- if retcode == 0:
@ -48,15 +48,15 @@ Index: tuned-2.5.0/tuned/plugins/plugin_cpu.py
- if len(l) == 2:
- energy_perf_bias = self._energy_perf_policy_to_human(l[1])
- break
+ else:
+ return None
+ if retcode == 0:
+ for line in lines.splitlines():
+ if line.startswith("analyzing CPU"):
+ continue
+ l = line.split()
+ if len(l) == 2:
+ energy_perf_bias = l[1]
+ break
+ else:
+ return None
+ if retcode == 0:
+ for line in lines.splitlines():
+ if line.startswith("analyzing CPU"):
+ continue
+ l = line.split()
+ if len(l) == 2:
+ energy_perf_bias = l[1]
+ break
return energy_perf_bias

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Jul 14 22:21:45 UTC 2015 - mpluskal@suse.com
- tuned-2.4.0-use_cpupower_for_intel_perf_bias.patch
* fixed indentation and tabs usage
-------------------------------------------------------------------
Sun Jul 12 12:48:16 UTC 2015 - mpluskal@suse.com

View File

@ -142,7 +142,7 @@ instead of fewer large ones).
%patch2 -p1
%build
#The tuned daemon is written in pure Python. Nothing requires to be built.
# The tuned daemon is written in pure Python. Nothing requires to be built.
# Just a hack to avoid installation in a wrong directory
sed -i 's|usr/libexec/tuned|%{_libexecdir}/%{name}|' Makefile