Thread (11 messages) 11 messages, 2 authors, 2021-06-25
STALE1842d

[PATCH v4 2/8] bthread: add debug print for scheduler context switches

From: Ahmad Fatoum <a.fatoum@pengutronix.de>
Date: 2021-06-22 08:27:49
Subsystem: the rest · Maintainer: Linus Torvalds

When debugging around bthreads, it's often useful to log context
switches. Make this easier by adding a ready-to-use pr_debug at the
correct location.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 common/bthread.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/common/bthread.c b/common/bthread.c
index c811797130eb..80651344da64 100644
--- a/common/bthread.c
+++ b/common/bthread.c
@@ -163,7 +163,10 @@ void bthread_info(void)
 
 void bthread_reschedule(void)
 {
-	bthread_schedule(list_next_entry(current, list));
+	struct bthread *next = list_next_entry(current, list);
+	if (current != next)
+		pr_debug("switch %s -> %s\n", current->name, next->name);
+	bthread_schedule(next);
 }
 
 void bthread_schedule(struct bthread *to)
-- 
2.29.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help