Skip to content

Commit 6ec30c6

Browse files
committed
Fix spam error message when setting energy_performance_preference
The 'intel_pstate' driver does not allow the EPP to be set to anything but 'performance', previously auto-cpufreq tried to set this to 'balance-performance' which caused a spam of write error messages in journalctl and also the 'balance-performance' preference was ignored. This commit just changes the 'balance-performance' preference to 'performance'.
1 parent 8bb7478 commit 6ec30c6

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

auto_cpufreq/core.py

+12-13
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,14 @@ def set_override(override):
122122
# Current work-around for Pop!_OS where symlink causes permission issues
123123
print("[!] Warning: Cannot get distro name")
124124
if os.path.exists("/etc/pop-os/os-release"):
125-
# Check if using a Snap
125+
# Check if using a Snap
126126
if os.getenv("PKG_MARKER") == "SNAP":
127-
print("[!] Snap install on PopOS detected, you must manually run the following"
128-
" commands in another terminal:\n")
127+
print("[!] Snap install on PopOS detected, you must manually run the following"
128+
" commands in another terminal:\n")
129129
print("[!] Backup the /etc/os-release file:")
130-
print("sudo mv /etc/os-release /etc/os-release-backup\n")
130+
print("sudo mv /etc/os-release /etc/os-release-backup\n")
131131
print("[!] Create hardlink to /etc/os-release:")
132-
print("sudo ln /etc/pop-os/os-release /etc/os-release\n")
132+
print("sudo ln /etc/pop-os/os-release /etc/os-release\n")
133133
print("[!] Aborting. Restart auto-cpufreq when you created the hardlink")
134134
sys.exit(1)
135135
else:
@@ -182,7 +182,7 @@ def check_for_update():
182182
print("Error fetching recent release!")
183183
if message is not None and message.startswith("API rate limit exceeded"):
184184
print("GitHub Rate limit exceeded. Please try again later within 1 hour or use different network/VPN.")
185-
else:
185+
else:
186186
print("Unexpected status code:", response.status_code)
187187
return False
188188
except (requests.exceptions.ConnectionError, requests.exceptions.Timeout,
@@ -215,8 +215,8 @@ def check_for_update():
215215
# Handle the case where "tag_name" key doesn't exist
216216
print("Malformed Released data!\nReinstall manually or Open an issue on GitHub for help!")
217217

218-
219-
218+
219+
220220
def new_update(custom_dir):
221221
os.chdir(custom_dir)
222222
print(f"Cloning the latest release to {custom_dir}")
@@ -247,7 +247,7 @@ def get_formatted_version():
247247
literal_version = get_literal_version("auto-cpufreq")
248248
splitted_version = literal_version.split("+")
249249
formatted_version = splitted_version[0]
250-
250+
251251
if len(splitted_version) > 1:
252252
formatted_version += " (git: " + splitted_version[1] + ")"
253253

@@ -571,7 +571,7 @@ def countdown(s):
571571
os.environ["TERM"] = "xterm"
572572

573573
print("\t\t\"auto-cpufreq\" is about to refresh ", end = "")
574-
574+
575575
# empty log file if size is larger then 10mb
576576
if auto_cpufreq_stats_file is not None:
577577
log_size = os.path.getsize(auto_cpufreq_stats_path)
@@ -942,8 +942,8 @@ def set_performance():
942942
run(f"cpufreqctl.auto-cpufreq --epp --set={epp}", shell=True)
943943
print(f'Setting to use: "{epp}" EPP')
944944
else:
945-
run("cpufreqctl.auto-cpufreq --epp --set=balance_performance", shell=True)
946-
print('Setting to use: "balance_performance" EPP')
945+
run("cpufreqctl.auto-cpufreq --epp --set=performance", shell=True)
946+
print('Setting to use: "performance" EPP')
947947

948948
# set frequencies
949949
set_frequencies()
@@ -1382,4 +1382,3 @@ def not_running_daemon_check():
13821382
elif os.getenv("PKG_MARKER") == "SNAP" and dcheck == "disabled":
13831383
daemon_not_running_msg()
13841384
exit(1)
1385-

0 commit comments

Comments
 (0)