aboutsummaryrefslogtreecommitdiffstats
path: root/cputemp2maxfreq.c
diff options
context:
space:
mode:
authorPA4WDH2023-05-24 10:08:01 +0200
committerPA4WDH2023-05-24 10:08:01 +0200
commit39f72042fb3e9398a2f3a56bc5bc7a8ad0f92681 (patch)
tree3d4f8816c7b3b356accd09b2f40b8cd043e28aaa /cputemp2maxfreq.c
parentRedirect all output to logging functions (diff)
downloadcputemp2maxfreq-39f72042fb3e9398a2f3a56bc5bc7a8ad0f92681.tar.gz
cputemp2maxfreq-39f72042fb3e9398a2f3a56bc5bc7a8ad0f92681.tar.bz2
cputemp2maxfreq-39f72042fb3e9398a2f3a56bc5bc7a8ad0f92681.zip
Add data log option
Diffstat (limited to 'cputemp2maxfreq.c')
-rw-r--r--cputemp2maxfreq.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/cputemp2maxfreq.c b/cputemp2maxfreq.c
index 88d9a5d..dd58e16 100644
--- a/cputemp2maxfreq.c
+++ b/cputemp2maxfreq.c
@@ -23,6 +23,7 @@ struct s_config config={
10, // Interval
"stdout", // Logger name
&logger_stdout, // Logger function
+ 0, // Don't log measurement data
};
struct s_cpudata cpudata;
@@ -49,6 +50,7 @@ int main(int argc,char **argv)
config.logger("Fallback frquency: %ld",config.fallback_freq);
config.logger("Interval: %d",config.interval);
config.logger("Logger: %s (%p)",config.logger_name,config.logger);
+ config.logger("Log measurement data: %d",config.log_data);
if ((config.max_temp<VALID_TEMP_MIN) || (config.max_temp>VALID_TEMP_MAX))
{
@@ -134,6 +136,10 @@ int main(int argc,char **argv)
}
DEBUG1_MAIN("Data: %ld %ld %ld %ld %ld\n",cpudata.cur_temp,config.max_temp,cpudata.max_freq,cpudata.scale_max,cpudata.cur_freq);
+ if (config.log_data>0)
+ {
+ config.logger("CPU Temperature: %ld, CPU Frequency: %ld",cpudata.cur_temp/1000,cpudata.cur_freq);
+ }
// Check if we should increase
if ((cpudata.cur_temp<config.max_temp) && (cpudata.scale_max<cpudata.max_freq))