diff options
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); |