diff options
author | leochanj105 <leochanj@live.unc.edu> | 2020-10-24 03:00:32 -0400 |
---|---|---|
committer | leochanj105 <leochanj@live.unc.edu> | 2020-10-24 03:00:32 -0400 |
commit | 1b7c4fc59a726caf90ab0e3c11aa09844b6ff2ba (patch) | |
tree | bdbedadd32f40513478e7886468ff0154cfce636 | |
parent | 450ce6915597da9f06442be6cc3235b53f30d59c (diff) | |
parent | 91ba319fffa36885abc777c54266860f947fed16 (diff) |
wip
-rwxr-xr-x | all_pairs/bin/anagram | bin | 184928 -> 190768 bytes | |||
-rwxr-xr-x | all_pairs/bin/audiobeam | bin | 128912 -> 138840 bytes | |||
-rwxr-xr-x | all_pairs/bin/g723_enc | bin | 101664 -> 107496 bytes | |||
-rwxr-xr-x | all_pairs/bin/huff_dec | bin | 95960 -> 109984 bytes | |||
-rw-r--r-- | extra.h | 26 |
5 files changed, 21 insertions, 5 deletions
diff --git a/all_pairs/bin/anagram b/all_pairs/bin/anagram index 1a40ee7..341f73d 100755 --- a/all_pairs/bin/anagram +++ b/all_pairs/bin/anagram | |||
Binary files differ | |||
diff --git a/all_pairs/bin/audiobeam b/all_pairs/bin/audiobeam index efc4584..d6054c9 100755 --- a/all_pairs/bin/audiobeam +++ b/all_pairs/bin/audiobeam | |||
Binary files differ | |||
diff --git a/all_pairs/bin/g723_enc b/all_pairs/bin/g723_enc index afe3837..0b14f8d 100755 --- a/all_pairs/bin/g723_enc +++ b/all_pairs/bin/g723_enc | |||
Binary files differ | |||
diff --git a/all_pairs/bin/huff_dec b/all_pairs/bin/huff_dec index f777646..0bcb0af 100755 --- a/all_pairs/bin/huff_dec +++ b/all_pairs/bin/huff_dec | |||
Binary files differ | |||
@@ -77,7 +77,9 @@ char _rt_shm_name[_ID_SZ] = "/_libextra_barrier-"; | |||
77 | #endif /* PAIRED */ | 77 | #endif /* PAIRED */ |
78 | 78 | ||
79 | #if LITMUS | 79 | #if LITMUS |
80 | long unsigned int _rt_period; | 80 | lt_t _rt_period; |
81 | int _rt_crit; | ||
82 | struct control_page *_rt_cp; | ||
81 | #endif | 83 | #endif |
82 | 84 | ||
83 | static void _rt_load_params_itrl(int argc, char **argv) { | 85 | static void _rt_load_params_itrl(int argc, char **argv) { |
@@ -202,8 +204,8 @@ static void _rt_load_params_itrl(int argc, char **argv) { | |||
202 | _rt_jobs_complete = 0; | 204 | _rt_jobs_complete = 0; |
203 | mlockall(MCL_CURRENT || MCL_FUTURE); | 205 | mlockall(MCL_CURRENT || MCL_FUTURE); |
204 | #if LITMUS | 206 | #if LITMUS |
205 | _rt_period = strtoul(argv[end], NULL, 10); | 207 | _rt_period = ms2ns(strtoul(argv[end], NULL, 10)); |
206 | unsigned int crit = atoi(argv[end+1]); | 208 | _rt_crit = atoi(argv[end+1]); |
207 | unsigned int wait = 1; | 209 | unsigned int wait = 1; |
208 | if (be_migrate_to_domain(_rt_core) < 0) { | 210 | if (be_migrate_to_domain(_rt_core) < 0) { |
209 | perror("Unable to migrate to specified CPU"); | 211 | perror("Unable to migrate to specified CPU"); |
@@ -213,11 +215,11 @@ static void _rt_load_params_itrl(int argc, char **argv) { | |||
213 | init_rt_task_param(&rt_param); | 215 | init_rt_task_param(&rt_param); |
214 | // Fake exec cost - this value ignored by the MC^2 scheduler | 216 | // Fake exec cost - this value ignored by the MC^2 scheduler |
215 | rt_param.exec_cost = _rt_period; | 217 | rt_param.exec_cost = _rt_period; |
216 | rt_param.period = ms2ns(_rt_period); | 218 | rt_param.period = _rt_period; |
217 | rt_param.relative_deadline = 0; | 219 | rt_param.relative_deadline = 0; |
218 | rt_param.phase = 0; | 220 | rt_param.phase = 0; |
219 | rt_param.priority = LITMUS_LOWEST_PRIORITY; | 221 | rt_param.priority = LITMUS_LOWEST_PRIORITY; |
220 | rt_param.cls = crit; | 222 | rt_param.cls = _rt_crit; |
221 | rt_param.budget_policy = NO_ENFORCEMENT; | 223 | rt_param.budget_policy = NO_ENFORCEMENT; |
222 | rt_param.cpu = _rt_core; | 224 | rt_param.cpu = _rt_core; |
223 | rt_param.release_policy = TASK_PERIODIC; | 225 | rt_param.release_policy = TASK_PERIODIC; |
@@ -233,6 +235,7 @@ static void _rt_load_params_itrl(int argc, char **argv) { | |||
233 | perror("Unable to become real-time task"); | 235 | perror("Unable to become real-time task"); |
234 | exit(1); | 236 | exit(1); |
235 | } | 237 | } |
238 | _rt_cp = get_ctrl_page(); | ||
236 | if (wait && wait_for_ts_release() != 0) { | 239 | if (wait && wait_for_ts_release() != 0) { |
237 | perror("Unable to wait for taskset release"); | 240 | perror("Unable to wait for taskset release"); |
238 | exit(1); | 241 | exit(1); |
@@ -412,6 +415,19 @@ out: | |||
412 | // Start a job | 415 | // Start a job |
413 | static void _rt_start_loop() { | 416 | static void _rt_start_loop() { |
414 | #if LITMUS | 417 | #if LITMUS |
418 | lt_t now = litmus_clock(); | ||
419 | if (now > _rt_cp->deadline) { | ||
420 | if (_rt_crit == 0) | ||
421 | fprintf(stderr, "CATASTROPHIC: Level-A"); | ||
422 | else if (_rt_crit == 1) | ||
423 | fprintf(stderr, "HAZARDOUS: Level-B"); | ||
424 | else | ||
425 | fprintf(stderr, "MAJOR: Level-C"); | ||
426 | fprintf(stderr, " task %s tardy %llu ns, " | ||
427 | "relative tardiness %f\n", | ||
428 | _rt_our_prog_name, now - _rt_cp->deadline, | ||
429 | (now - _rt_cp->deadline) / (double)_rt_period); | ||
430 | } | ||
415 | if (sleep_next_period() != 0) { | 431 | if (sleep_next_period() != 0) { |
416 | perror("Unable to sleep for next period"); | 432 | perror("Unable to sleep for next period"); |
417 | } | 433 | } |