Skip to content

Commit 2993ef5

Browse files
committed
Remove set_platform_profile
1 parent af5c836 commit 2993ef5

File tree

2 files changed

+4
-27
lines changed

2 files changed

+4
-27
lines changed

backend/cpu.py

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -133,16 +133,14 @@ def set_cpuTDP(self, value: int):
133133

134134
command = f"{sys_ryzenadj_path} -a {stapm_limit} -b {fast_minit} -c {slow_limit} -f {tctl_temp}"
135135
command_args = command.split()
136-
logging.debug(f"set_cpuTDP command: {command}")
137-
logging.debug(f"set_cpuTDP {value}")
136+
logging.info(f"set_cpuTDP command: {command}")
137+
logging.info(f"set_cpuTDP {value}")
138138
process = subprocess.run(command_args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
139139
stdout, stderr = process.stdout.decode('utf-8'), process.stderr.decode('utf-8')
140-
logging.debug(f"set_cpuTDP result:\n{stdout}")
140+
logging.info(f"set_cpuTDP result:\n{stdout}")
141141
if stderr:
142142
logging.error(f"set_cpuTDP error:\n{stderr}")
143143

144-
self.set_platform_profile(value)
145-
146144
return True
147145
else:
148146
return False
@@ -394,26 +392,5 @@ def get_ryzenadj_info(self):
394392
except Exception as e:
395393
logging.error(e)
396394
return f"get_ryzenadj_info error:\n{e}"
397-
398-
def set_platform_profile(self, tdp):
399-
# if PLATFORM_PROFILE_PATH is not a file
400-
if not os.path.exists(PLATFORM_PROFILE_PATH) or not os.path.isfile(PLATFORM_PROFILE_CHOICES_PATH):
401-
return
402-
try:
403-
# read platform_profile_choices
404-
with open(PLATFORM_PROFILE_CHOICES_PATH, 'r') as file:
405-
choices = file.read().strip().split()
406-
logging.debug(f"platform_profile_choices {choices}")
407-
if tdp <= 12:
408-
profile = choices[0]
409-
elif tdp < 20:
410-
profile = choices[1]
411-
else:
412-
profile = choices[len(choices) - 1]
413-
with open(PLATFORM_PROFILE_PATH, 'w') as file:
414-
logging.debug(f"set_platform_profile {profile}")
415-
file.write(profile)
416-
except Exception as e:
417-
logging.error(f"set_platform_profile error:\n{e}")
418395

419396
cpuManager = CPUManager()

src/util/backend.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ export class Backend {
243243
}
244244

245245
public static applyTDP = (tdp: number) => {
246-
// console.log("Applying tdp " + tdp.toString());
246+
console.log("Applying tdp " + tdp.toString());
247247
this.serverAPI!.callPluginMethod("set_cpuTDP", { value: tdp });
248248
};
249249

0 commit comments

Comments
 (0)