diff options
author | Joshua Bakita <jbakita@cs.unc.edu> | 2021-03-08 17:32:12 -0500 |
---|---|---|
committer | Joshua Bakita <jbakita@cs.unc.edu> | 2021-03-08 17:32:12 -0500 |
commit | efb0e77d08ac9ed8ed116d0ff0f30cf04f577beb (patch) | |
tree | b62156bc42144cd3a8e3dc5ee9ecfe160e9713da | |
parent | 35c9600d29eff1a23791e713dacc60f7d650b75b (diff) |
Case Study: Print liveness messages from Level-C tasks
Printing is too slow for many Level-A and -B tasks, so we limit it
to Level-C.
-rw-r--r-- | extra.h | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -415,6 +415,7 @@ out: | |||
415 | // Start a job | 415 | // Start a job |
416 | static void _rt_start_loop() { | 416 | static void _rt_start_loop() { |
417 | #if LITMUS | 417 | #if LITMUS |
418 | static lt_t last = 0; | ||
418 | lt_t now = litmus_clock(); | 419 | lt_t now = litmus_clock(); |
419 | if (now > _rt_cp->deadline) { | 420 | if (now > _rt_cp->deadline) { |
420 | fprintf(stderr, "(%s/%d:%lu) ", _rt_our_prog_name, gettid(), _rt_cp->job_index); | 421 | fprintf(stderr, "(%s/%d:%lu) ", _rt_our_prog_name, gettid(), _rt_cp->job_index); |
@@ -429,6 +430,12 @@ static void _rt_start_loop() { | |||
429 | now - _rt_cp->deadline, | 430 | now - _rt_cp->deadline, |
430 | (now - _rt_cp->deadline) / (double)_rt_period); | 431 | (now - _rt_cp->deadline) / (double)_rt_period); |
431 | } | 432 | } |
433 | if (last == 0) { | ||
434 | last = now; | ||
435 | } else if (now > last + 60ull * _BILLION && _rt_crit >= 2) { | ||
436 | last = now; | ||
437 | fprintf(stderr, "(%s/%d:%lu) Ping\n", _rt_our_prog_name, gettid(), _rt_cp->job_index); | ||
438 | } | ||
432 | if (sleep_next_period() != 0) { | 439 | if (sleep_next_period() != 0) { |
433 | perror("Unable to sleep for next period"); | 440 | perror("Unable to sleep for next period"); |
434 | } | 441 | } |