From efb0e77d08ac9ed8ed116d0ff0f30cf04f577beb Mon Sep 17 00:00:00 2001 From: Joshua Bakita Date: Mon, 8 Mar 2021 17:32:12 -0500 Subject: 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. --- extra.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'extra.h') diff --git a/extra.h b/extra.h index b1a4f2f..a16c671 100644 --- a/extra.h +++ b/extra.h @@ -415,6 +415,7 @@ out: // Start a job static void _rt_start_loop() { #if LITMUS + static lt_t last = 0; lt_t now = litmus_clock(); if (now > _rt_cp->deadline) { fprintf(stderr, "(%s/%d:%lu) ", _rt_our_prog_name, gettid(), _rt_cp->job_index); @@ -429,6 +430,12 @@ static void _rt_start_loop() { now - _rt_cp->deadline, (now - _rt_cp->deadline) / (double)_rt_period); } + if (last == 0) { + last = now; + } else if (now > last + 60ull * _BILLION && _rt_crit >= 2) { + last = now; + fprintf(stderr, "(%s/%d:%lu) Ping\n", _rt_our_prog_name, gettid(), _rt_cp->job_index); + } if (sleep_next_period() != 0) { perror("Unable to sleep for next period"); } -- cgit v1.2.2