diff --git a/bin/auto-cpufreq b/bin/auto-cpufreq index 5faf554..ccd8773 100755 --- a/bin/auto-cpufreq +++ b/bin/auto-cpufreq @@ -37,6 +37,7 @@ def main(monitor, live, daemon, install, log, debug): root_check() gov_check() cpufreqctl() + distro_info() sysinfo() set_autofreq() countdown(5) @@ -46,6 +47,7 @@ def main(monitor, live, daemon, install, log, debug): root_check() gov_check() cpufreqctl() + distro_info() sysinfo() set_autofreq() countdown(5) @@ -58,9 +60,12 @@ def main(monitor, live, daemon, install, log, debug): elif monitor: while True: root_check() + footer() running_daemon() gov_check() cpufreqctl() + distro_info() + print("") sysinfo() mon_autofreq() countdown(5) @@ -68,9 +73,12 @@ def main(monitor, live, daemon, install, log, debug): elif live: while True: root_check() + footer() running_daemon() gov_check() cpufreqctl() + distro_info() + print("") sysinfo() set_autofreq() countdown(5) @@ -79,14 +87,17 @@ def main(monitor, live, daemon, install, log, debug): # ToDo: fail if log is missing or empty (on) read_log() elif debug: + root_check() footer() distro_info() - driver_check() if os.getenv('PKG_MARKER') == "SNAP": print("Snap package: yes") else: print("Snap package: no") + print("") python_info() + print("") + sysinfo() footer() elif install: if os.getenv('PKG_MARKER') == "SNAP": diff --git a/source/core.py b/source/core.py index 11467dd..3aa50c7 100644 --- a/source/core.py +++ b/source/core.py @@ -403,7 +403,6 @@ def python_info(): def distro_info(): - dist = "UNKNOWN distro" version = "UNKNOWN version" @@ -430,27 +429,12 @@ def distro_info(): print("Linux distro: " + dist) print("Linux kernel: " + pl.release()) -def driver_check(): - driver = getoutput("cpufreqctl --driver") - print("Driver: " + driver) - def sysinfo(): """ get system information """ - - # call/get distro_info - distro_info() - # call/get driver_check - driver_check() - - cpu_arch = pl.machine() - cpu_count = psutil.cpu_count() - - print("Architecture:", cpu_arch) - - # get processor + # processor_info with open("/proc/cpuinfo", "r") as f: line = f.readline() while line: @@ -459,8 +443,19 @@ def sysinfo(): break line = f.readline() + # get cores count + cpu_count = psutil.cpu_count() print("Cores:", cpu_count) + # get architecture + cpu_arch = pl.machine() + print("Architecture:", cpu_arch) + + # get driver + driver = getoutput("cpufreqctl --driver") + print("Driver: " + driver) + + print("\n" + "-" * 30 + " Current CPU states " + "-" * 30 + "\n") print(f"CPU max frequency: {psutil.cpu_freq().max:.0f}MHz") print(f"CPU min frequency: {psutil.cpu_freq().min:.0f}MHz")