From dde9cd213320378c226ca2e886dcf77fdeff2bdb Mon Sep 17 00:00:00 2001 From: Adnan Hodzic Date: Wed, 9 Sep 2020 20:02:45 +0200 Subject: [PATCH] func refactor/add distro info, kernel, driver, snap to debug --- bin/auto-cpufreq | 6 ++++++ source/core.py | 20 +++++++++++++------- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/bin/auto-cpufreq b/bin/auto-cpufreq index d88404b..7c649cf 100755 --- a/bin/auto-cpufreq +++ b/bin/auto-cpufreq @@ -81,6 +81,12 @@ def main(monitor, live, daemon, install, log, debug): read_log() elif debug: footer() + distro_info() + driver_check() + if os.getenv('PKG_MARKER') == "SNAP": + print("Snap package: yes") + else: + print("Snap package: no") print(get_sys_info()) footer() elif install: diff --git a/source/core.py b/source/core.py index 18a0bd2..4b5f00d 100644 --- a/source/core.py +++ b/source/core.py @@ -427,12 +427,7 @@ def mon_autofreq(): mon_powersave() -def sysinfo(): - """ - get system information - """ - print("\n" + "-" * 29 + " System information " + "-" * 30 + "\n") - +def distro_info(): import distro dist = "UNKNOWN distro" @@ -461,10 +456,21 @@ def sysinfo(): print("Linux distro: " + dist) print("Linux kernel: " + pl.release()) - # driver check +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()