summaryrefslogtreecommitdiffstats
path: root/extra.h
diff options
context:
space:
mode:
Diffstat (limited to 'extra.h')
-rw-r--r--extra.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/extra.h b/extra.h
index ceaee92..f2ec84e 100644
--- a/extra.h
+++ b/extra.h
@@ -30,7 +30,7 @@ extern int sched_getcpu();
30#endif 30#endif
31 31
32// This is a proxy for "case study mode" now 32// This is a proxy for "case study mode" now
33#define LITMUS 0 33#define LITMUS 1
34#define MMDC_PROF 0 34#define MMDC_PROF 0
35 35
36#if LITMUS 36#if LITMUS
@@ -106,7 +106,7 @@ static void _rt_load_params_itrl(int argc, char **argv) {
106#if LITMUS 106#if LITMUS
107 fprintf(stderr, " <task period> in ms\n"); 107 fprintf(stderr, " <task period> in ms\n");
108 fprintf(stderr, " <task criticality level> 0 for Level-A, 1 for Level-B, 2 for Level-C\n"); 108 fprintf(stderr, " <task criticality level> 0 for Level-A, 1 for Level-B, 2 for Level-C\n");
109 fprintf(stderr, " <task phase> in ms\n"); 109 fprintf(stderr, " <task phase> in ms\n");
110#endif /* LITMUS */ 110#endif /* LITMUS */
111 exit(1); 111 exit(1);
112 } 112 }
@@ -209,6 +209,7 @@ static void _rt_load_params_itrl(int argc, char **argv) {
209 _rt_period = ms2ns(strtoul(argv[end], NULL, 10)); 209 _rt_period = ms2ns(strtoul(argv[end], NULL, 10));
210 _rt_crit = atoi(argv[end+1]); 210 _rt_crit = atoi(argv[end+1]);
211 _rt_phase = ms2ns(strtoul(argv[end+2], NULL, 10)); 211 _rt_phase = ms2ns(strtoul(argv[end+2], NULL, 10));
212 // _rt_phase = 0;
212 unsigned int wait = 1; 213 unsigned int wait = 1;
213 if (be_migrate_to_domain(_rt_core) < 0) { 214 if (be_migrate_to_domain(_rt_core) < 0) {
214 perror("Unable to migrate to specified CPU"); 215 perror("Unable to migrate to specified CPU");
@@ -221,7 +222,8 @@ static void _rt_load_params_itrl(int argc, char **argv) {
221 rt_param.period = _rt_period; 222 rt_param.period = _rt_period;
222 rt_param.relative_deadline = 0; 223 rt_param.relative_deadline = 0;
223 rt_param.phase = _rt_phase; 224 rt_param.phase = _rt_phase;
224 rt_param.priority = LITMUS_LOWEST_PRIORITY; 225 // rt_param.priority = LITMUS_LOWEST_PRIORITY;
226 rt_param.priority = ns2ms(_rt_phase);
225 rt_param.cls = _rt_crit; 227 rt_param.cls = _rt_crit;
226 rt_param.budget_policy = NO_ENFORCEMENT; 228 rt_param.budget_policy = NO_ENFORCEMENT;
227 rt_param.cpu = _rt_core; 229 rt_param.cpu = _rt_core;
@@ -435,10 +437,11 @@ static void _rt_start_loop() {
435 } 437 }
436 if (last == 0) { 438 if (last == 0) {
437 last = now; 439 last = now;
438 } else if (now > last + 60ull * _BILLION && _rt_crit >= 2) { 440 }
439 last = now; 441 // else if (now > last + 60ull * _BILLION && _rt_crit >= 2) {
440 fprintf(stderr, "(%s/%d:%lu) Ping\n", _rt_our_prog_name, gettid(), _rt_cp->job_index); 442 // last = now;
441 } 443 // fprintf(stderr, "(%s/%d:%lu) Ping\n", _rt_our_prog_name, gettid(), _rt_cp->job_index);
444 // }
442 if (sleep_next_period() != 0) { 445 if (sleep_next_period() != 0) {
443 perror("Unable to sleep for next period"); 446 perror("Unable to sleep for next period");
444 } 447 }