diff options
author | PA4WDH | 2023-05-24 08:33:53 +0200 |
---|---|---|
committer | PA4WDH | 2023-05-24 08:33:53 +0200 |
commit | fa20f603834ef9febe396c058c9d775038f4a28b (patch) | |
tree | dbe5ad3e978f562c4709b66653a5efd9bbdcc2f3 /cputemp2maxfreq.c | |
parent | Add keep feature for governor (diff) | |
download | cputemp2maxfreq-fa20f603834ef9febe396c058c9d775038f4a28b.tar.gz cputemp2maxfreq-fa20f603834ef9febe396c058c9d775038f4a28b.tar.bz2 cputemp2maxfreq-fa20f603834ef9febe396c058c9d775038f4a28b.zip |
Add logging functions
Diffstat (limited to 'cputemp2maxfreq.c')
-rw-r--r-- | cputemp2maxfreq.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/cputemp2maxfreq.c b/cputemp2maxfreq.c index aabb99f..9e20848 100644 --- a/cputemp2maxfreq.c +++ b/cputemp2maxfreq.c @@ -11,9 +11,19 @@ #include "failsafe.h" #include "version.h" #include "argparse.h" +#include "logger.h" // Set default config -struct s_config config={"conservative",70000,"/sys/devices/virtual/thermal/thermal_zone0/temp",100000,2000000,10}; +struct s_config config={ + "conservative", // Governor + 70000, // Temperature + "/sys/devices/virtual/thermal/thermal_zone0/temp", // Temperature input + 100000, // Frequency step + 2000000, // Fallback frequency + 10, // Interval + "stdout", // Logger name + &logger_stdout, // Logger function +}; struct s_cpudata cpudata; void signal_handler(int signum) @@ -38,8 +48,12 @@ int main(int argc,char **argv) printf("Frequency step: %ld\n",config.freq_step); printf("Fallback frquency: %ld\n",config.fallback_freq); printf("Interval: %d\n",config.interval); + printf("Logger: %s (%p)\n",config.logger_name,config.logger); printf("\n"); + config.logger("Log test1"); + config.logger("Log test2"); + if ((config.max_temp<VALID_TEMP_MIN) || (config.max_temp>VALID_TEMP_MAX)) { printf("Invalid temperature, range is %d-%d\n",VALID_TEMP_MIN,VALID_TEMP_MAX); |