diff --git a/tuned-2.4.0-use_cpupower_for_intel_perf_bias.patch b/tuned-2.4.0-use_cpupower_for_intel_perf_bias.patch index a34c4d5..c3c845c 100644 --- a/tuned-2.4.0-use_cpupower_for_intel_perf_bias.patch +++ b/tuned-2.4.0-use_cpupower_for_intel_perf_bias.patch @@ -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 diff --git a/tuned.changes b/tuned.changes index 9e6bdf4..0e2ee65 100644 --- a/tuned.changes +++ b/tuned.changes @@ -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 diff --git a/tuned.spec b/tuned.spec index 6b16b47..2cf60a6 100644 --- a/tuned.spec +++ b/tuned.spec @@ -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