aboutsummaryrefslogtreecommitdiffstats
path: root/argparse.c
diff options
context:
space:
mode:
authorPA4WDH2024-07-25 17:27:28 +0200
committerPA4WDH2024-07-25 17:27:28 +0200
commit5a33d25886af8f0996d901fcfc66674a3dc625db (patch)
tree8ad1db0da5a5aa39348d96d71cbea38e3b740c05 /argparse.c
parentFix typos (diff)
downloadcputemp2maxfreq-5a33d25886af8f0996d901fcfc66674a3dc625db.tar.gz
cputemp2maxfreq-5a33d25886af8f0996d901fcfc66674a3dc625db.tar.bz2
cputemp2maxfreq-5a33d25886af8f0996d901fcfc66674a3dc625db.zip
Add commandline parameter to set transition latency0.4
Diffstat (limited to 'argparse.c')
-rw-r--r--argparse.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/argparse.c b/argparse.c
index 37d9176..124f3bc 100644
--- a/argparse.c
+++ b/argparse.c
@@ -14,6 +14,8 @@ void printhelp()
"Usage: %s <options>\n"
"\n"
"Scaling options:\n"
+ "-d <delay> Transition latency in us or \"auto\" for autodetect\n"
+ " Default: auto\n"
"-f <frequency> Fallback frequency in KHz, used when everything fails\n"
" Default: %ld\n"
"-g <governor> cpufreq governor to use, use \"keep\" to keep current governor\n"
@@ -65,7 +67,7 @@ void argparse(int argc, char **argv)
memcpy(&userconfig,&config,sizeof(struct s_config));
// Parse options
- while((opt=getopt(argc,argv,"c:C:f:g:hi:l:mp:s:t:u"))!=-1)
+ while((opt=getopt(argc,argv,"c:C:d:f:g:hi:l:mp:s:t:u"))!=-1)
{
DEBUG1_ARGPARSE("Argument: %c Value: %s\n",opt,optarg);
switch(opt)
@@ -78,6 +80,14 @@ void argparse(int argc, char **argv)
strncpy(userconfig.csvlog,optarg,sizeof(userconfig.csvlog));
userconfig.csvoverwrite=1;
break;
+ case 'd':
+ if (strcmp("auto",optarg)==0)
+ {
+ userconfig.transition_latency=-1;
+ } else {
+ userconfig.transition_latency=strtoll(optarg,NULL,10);
+ }
+ break;
case 'f':
userconfig.fallback_freq=strtoll(optarg,NULL,10);
break;