Skip to content

Commit

Permalink
Trace wakeup-induced overrun
Browse files Browse the repository at this point in the history
  • Loading branch information
shuhaowu committed Sep 18, 2023
1 parent 9f501e2 commit 79b81f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cactus_rt/cyclic_thread.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void CyclicThread::Run() noexcept {
while (!this->StopRequested()) {
loop_start = NowNs();
if (tracer_config.trace_wakeup_latency) {
Tracer().StartSpan("WakeupLatency", "cactusrt", next_wakeup_time_ns);
Tracer().StartSpan("Wakeup", "cactusrt", next_wakeup_time_ns);
Tracer().EndSpan(loop_start);
}

Expand All @@ -37,7 +37,7 @@ void CyclicThread::Run() noexcept {
loop_latency = loop_end - loop_start;
TrackLatency(wakeup_latency, loop_latency);

if (tracer_config.trace_overrun && static_cast<uint64_t>(loop_latency) >= period_ns_) {
if (tracer_config.trace_overrun && static_cast<uint64_t>(wakeup_latency + loop_latency) >= period_ns_) {
Tracer().InstantEvent("LoopOverrun", "cactusrt");

LOG_WARNING_LIMIT(
Expand Down

0 comments on commit 79b81f3

Please sign in to comment.