From d3089350da7b483ef80284d42b4114bfc50c2b33 Mon Sep 17 00:00:00 2001 From: Hayden Stainsby Date: Fri, 2 Jun 2023 00:16:07 +0200 Subject: [PATCH] fix(subscriber): fix self wakes count (#430) Self-wakes were not being detected and displayed in the console. The `burn` task in the `app` example - which deliberately has many self-wakes - was not registering any. It appears that a logic error was present in the self-wake counting in `console-subscriber` since it was added in #238. When a self wake was detected, the `wakes` count was incremented a second time (the `wakes` count is incremented for all wakes before checking for a self wake), instead of increamenting the `self_wakes` count. This PR fixes the logic so that when a self wake is detected, the `self_wakes` count is incremented. --- console-subscriber/src/stats.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/console-subscriber/src/stats.rs b/console-subscriber/src/stats.rs index 1ac1e7444..c8b0a942b 100644 --- a/console-subscriber/src/stats.rs +++ b/console-subscriber/src/stats.rs @@ -217,7 +217,7 @@ impl TaskStats { self.wakes.fetch_add(1, Release); if self_wake { - self.wakes.fetch_add(1, Release); + self.self_wakes.fetch_add(1, Release); } self.make_dirty();