Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugin_cpu: allow raw energy_performance_preference values #715

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion tuned/plugins/plugin_cpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,13 @@ def _set_energy_performance_preference(self, energy_performance_preference, devi
if not sim:
avail_vals = set(self._cmd.read_file(self._pstate_preference_path(cpu_id, True)).split())
for val in vals:
if val in avail_vals:
try:
val = int(val)
valid = 0 <= val < 256
val = str(val)
except ValueError:
valid = val in avail_vals
if valid:
self._cmd.write_to_file(self._pstate_preference_path(cpu_id), val, \
no_error = [errno.ENOENT] if remove else False, ignore_same=True)
log.info("Setting energy_performance_preference value '%s' for cpu '%s'" % (val, device))
Expand Down