diff options
| author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2016-04-17 10:03:15 -0400 |
|---|---|---|
| committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2016-04-17 10:03:15 -0400 |
| commit | e46eb2f93142bdcd59a4987f1ee97b17edc5f5b8 (patch) | |
| tree | 1b8230575f542cd7a4bf7a91379a67a56372bbdc /bin | |
| parent | f7aa7b6c50bfcec67534dbc6a9eec611e155e7fa (diff) | |
Harmonize options between rtspin and rt_launch (-d, -o)
-d -> relative deadline
-o -> offset/phase
Diffstat (limited to 'bin')
| -rw-r--r-- | bin/rt_launch.c | 5 | ||||
| -rw-r--r-- | bin/rtspin.c | 29 |
2 files changed, 30 insertions, 4 deletions
diff --git a/bin/rt_launch.c b/bin/rt_launch.c index ed26a1a..0418102 100644 --- a/bin/rt_launch.c +++ b/bin/rt_launch.c | |||
| @@ -133,6 +133,11 @@ int main(int argc, char** argv) | |||
| 133 | if (wcet <= 0) | 133 | if (wcet <= 0) |
| 134 | usage("The worst-case execution time must be a " | 134 | usage("The worst-case execution time must be a " |
| 135 | "positive number."); | 135 | "positive number."); |
| 136 | |||
| 137 | if (offset_ms < 0) | ||
| 138 | usage("The synchronous release delay must be a " | ||
| 139 | "non-negative number."); | ||
| 140 | |||
| 136 | if (period <= 0) | 141 | if (period <= 0) |
| 137 | usage("The period must be a positive number."); | 142 | usage("The period must be a positive number."); |
| 138 | if (wcet > period) { | 143 | if (wcet > period) { |
diff --git a/bin/rtspin.c b/bin/rtspin.c index 151b545..db982ed 100644 --- a/bin/rtspin.c +++ b/bin/rtspin.c | |||
| @@ -214,13 +214,15 @@ static int job(double exec_time, double program_end, int lock_od, double cs_leng | |||
| 214 | } | 214 | } |
| 215 | } | 215 | } |
| 216 | 216 | ||
| 217 | #define OPTSTR "p:c:wlveo:f:s:m:q:r:X:L:Q:viRu:Bh" | 217 | #define OPTSTR "p:c:wlveo:f:s:m:q:r:X:L:Q:viRu:Bhd:C:" |
| 218 | int main(int argc, char** argv) | 218 | int main(int argc, char** argv) |
| 219 | { | 219 | { |
| 220 | int ret; | 220 | int ret; |
| 221 | lt_t wcet; | 221 | lt_t wcet; |
| 222 | lt_t period; | 222 | lt_t period, deadline; |
| 223 | lt_t phase; | ||
| 223 | double wcet_ms, period_ms, underrun_ms = 0; | 224 | double wcet_ms, period_ms, underrun_ms = 0; |
| 225 | double offset_ms = 0, deadline_ms = 0; | ||
| 224 | unsigned int priority = LITMUS_NO_PRIORITY; | 226 | unsigned int priority = LITMUS_NO_PRIORITY; |
| 225 | int migrate = 0; | 227 | int migrate = 0; |
| 226 | int cluster = 0; | 228 | int cluster = 0; |
| @@ -293,7 +295,7 @@ int main(int argc, char** argv) | |||
| 293 | case 'B': | 295 | case 'B': |
| 294 | background_loop = 1; | 296 | background_loop = 1; |
| 295 | break; | 297 | break; |
| 296 | case 'o': | 298 | case 'C': |
| 297 | column = atoi(optarg); | 299 | column = atoi(optarg); |
| 298 | break; | 300 | break; |
| 299 | case 'f': | 301 | case 'f': |
| @@ -305,6 +307,16 @@ int main(int argc, char** argv) | |||
| 305 | case 's': | 307 | case 's': |
| 306 | scale = atof(optarg); | 308 | scale = atof(optarg); |
| 307 | break; | 309 | break; |
| 310 | case 'o': | ||
| 311 | offset_ms = atof(optarg); | ||
| 312 | break; | ||
| 313 | case 'd': | ||
| 314 | deadline_ms = atof(optarg); | ||
| 315 | if (!deadline_ms || deadline_ms < 0) { | ||
| 316 | usage("The relative deadline must be a positive" | ||
| 317 | " number."); | ||
| 318 | } | ||
| 319 | break; | ||
| 308 | case 'u': | 320 | case 'u': |
| 309 | underrun_ms = atof(optarg); | 321 | underrun_ms = atof(optarg); |
| 310 | if (underrun_ms <= 0) | 322 | if (underrun_ms <= 0) |
| @@ -405,9 +417,15 @@ int main(int argc, char** argv) | |||
| 405 | 417 | ||
| 406 | wcet = ms2ns(wcet_ms); | 418 | wcet = ms2ns(wcet_ms); |
| 407 | period = ms2ns(period_ms); | 419 | period = ms2ns(period_ms); |
| 420 | phase = ms2ns(offset_ms); | ||
| 421 | deadline = ms2ns(deadline_ms); | ||
| 408 | if (wcet <= 0) | 422 | if (wcet <= 0) |
| 409 | usage("The worst-case execution time must be a " | 423 | usage("The worst-case execution time must be a " |
| 410 | "positive number."); | 424 | "positive number."); |
| 425 | if (offset_ms < 0) | ||
| 426 | usage("The synchronous release delay must be a " | ||
| 427 | "non-negative number."); | ||
| 428 | |||
| 411 | if (period <= 0) | 429 | if (period <= 0) |
| 412 | usage("The period must be a positive number."); | 430 | usage("The period must be a positive number."); |
| 413 | if (!file && wcet > period) { | 431 | if (!file && wcet > period) { |
| @@ -430,6 +448,8 @@ int main(int argc, char** argv) | |||
| 430 | init_rt_task_param(¶m); | 448 | init_rt_task_param(¶m); |
| 431 | param.exec_cost = wcet; | 449 | param.exec_cost = wcet; |
| 432 | param.period = period; | 450 | param.period = period; |
| 451 | param.phase = phase; | ||
| 452 | param.relative_deadline = deadline; | ||
| 433 | param.priority = priority == LITMUS_NO_PRIORITY ? LITMUS_LOWEST_PRIORITY : priority; | 453 | param.priority = priority == LITMUS_NO_PRIORITY ? LITMUS_LOWEST_PRIORITY : priority; |
| 434 | param.cls = class; | 454 | param.cls = class; |
| 435 | param.budget_policy = (want_enforcement) ? | 455 | param.budget_policy = (want_enforcement) ? |
| @@ -452,7 +472,8 @@ int main(int argc, char** argv) | |||
| 452 | config.priority = priority; | 472 | config.priority = priority; |
| 453 | config.polling_params.budget = wcet; | 473 | config.polling_params.budget = wcet; |
| 454 | config.polling_params.period = period; | 474 | config.polling_params.period = period; |
| 455 | config.polling_params.relative_deadline = period; | 475 | config.polling_params.offset = phase; |
| 476 | config.polling_params.relative_deadline = deadline; | ||
| 456 | ret = reservation_create(SPORADIC_POLLING, &config); | 477 | ret = reservation_create(SPORADIC_POLLING, &config); |
| 457 | if (ret < 0) | 478 | if (ret < 0) |
| 458 | bail_out("failed to create reservation"); | 479 | bail_out("failed to create reservation"); |
