From 7d82ba6b18c550bcb7e036093291874b76644832 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Wed, 29 Oct 2014 11:35:18 +0100 Subject: [PATCH] powerd.8: Fix incomplete -p / -u commit. --- usr.sbin/powerd/powerd.8 | 16 +++++++++------- usr.sbin/powerd/powerd.c | 12 ++++++------ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/usr.sbin/powerd/powerd.8 b/usr.sbin/powerd/powerd.8 index 428311c8ae..a966e6a4a2 100644 --- a/usr.sbin/powerd/powerd.8 +++ b/usr.sbin/powerd/powerd.8 @@ -9,7 +9,9 @@ .Nd simple ACPI based CPU/power control .Sh SYNOPSIS .Nm -.Op Fl d +.Op Fl dt +.Op Fl p Ar hysteresis +.Op Fl u Ar trigger_up .Sh DESCRIPTION The .Nm @@ -23,23 +25,23 @@ minimum frequency when the 10 second machine load drops below 12% of one CPU. .Pp The options are as follows: -.Bl -tag -width Fl +.Bl -tag -width ".Fl p Ar hysteresis" .It Fl d Debug option. Causes .Nm to not go to the background and prints some debug output to .Va stdout . +.It Fl p Ar hysteresis +Percent of the upper limit to subtract as an hysteresis value to scale +down to the min frequency. .It Fl t Turbo mode. Disables switching to turbo mode as maximum frequency completely. Switching to turbo mode as maximum frequency is enabled by default, if the CPU supports it. -.It Fl u -Per cpu load limit in percent to force max frequency. -.It Fl p -Percent of the upper limit to substract as an hysteresis value to scale -down to the min frequency. +.It Fl u Ar trigger_up +Per CPU load limit in percent to force maximum frequency. .El .Sh DIAGNOSTICS The diff --git a/usr.sbin/powerd/powerd.c b/usr.sbin/powerd/powerd.c index 4508ad9ed3..3733d349ec 100644 --- a/usr.sbin/powerd/powerd.c +++ b/usr.sbin/powerd/powerd.c @@ -78,19 +78,19 @@ main(int ac, char **av) int nstate; char buf[64]; - while ((ch = getopt(ac, av, "dtp:u:")) != -1) { + while ((ch = getopt(ac, av, "dp:tu:")) != -1) { switch(ch) { case 'd': DebugOpt = 1; break; - case 't': - TurboOpt = 0; - break; case 'p': Hysteresis = (int)strtol(optarg, NULL, 10); break; + case 't': + TurboOpt = 0; + break; case 'u': - TriggerUp = (double) strtol(optarg, NULL, 10) / 100; + TriggerUp = (double)strtol(optarg, NULL, 10) / 100; break; default: usage(); @@ -415,6 +415,6 @@ static void usage(void) { - fprintf(stderr, "usage: powerd [-dt]\n"); + fprintf(stderr, "usage: powerd [-dt] [-p hysteresis] [-u trigger_up]\n"); exit(1); } -- 2.41.0