diff options
author | Clark Williams <williams@redhat.com> | 2015-02-17 12:59:05 -0600 |
---|---|---|
committer | Clark Williams <williams@redhat.com> | 2015-02-17 12:59:05 -0600 |
commit | ad68a5d91d4b3f391295577015351fe4f1e77a3e (patch) | |
tree | d7cc99896bddb08b162fba8e6854bba5ff2584c8 | |
parent | b690dfed2d0643d27ee72cf5951662f37a1b9468 (diff) | |
download | rt-tests-ad68a5d91d4b3f391295577015351fe4f1e77a3e.tar.gz |
rt-migrate-test: make sure input parameters are converted to correct units
The input parameters for run_interval and interval are specified on the
command line as millisecond values. Convert these to nanosecond values
before we use them.
Signed-off-by: Clark Williams <williams@redhat.com>
-rw-r--r-- | src/rt-migrate-test/rt-migrate-test.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rt-migrate-test/rt-migrate-test.c b/src/rt-migrate-test/rt-migrate-test.c index cf682fe..348a62e 100644 --- a/src/rt-migrate-test/rt-migrate-test.c +++ b/src/rt-migrate-test/rt-migrate-test.c @@ -214,9 +214,9 @@ static void parse_options (int argc, char *argv[]) switch (c) { case 'p': prio_start = atoi(optarg); break; case 'r': - run_interval = atoi(optarg); + run_interval = ms2nano(atoi(optarg)); break; - case 's': interval = atoi(optarg); break; + case 's': interval = ms2nano(atoi(optarg)); break; case 'l': nr_runs = atoi(optarg); break; case 'm': max_err = usec2nano(atoi(optarg)); break; case 'c': check = 1; break; @@ -536,7 +536,7 @@ int main (int argc, char **argv) param.sched_priority = nr_tasks + prio_start; if (sched_setscheduler(0, SCHED_FIFO, ¶m)) fprintf(stderr, "Warning, can't set priority of main thread!\n"); - + intv.tv_sec = nano2sec(interval); |