summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2021-06-22 10:26:11 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2021-06-25 09:30:33 +0200
commitf866f471337e3249e0946764f09841baf73d6c9d (patch)
tree136ba5f3f7bf45e3dc92b3f31353b77a4f4568dc
parent774edc56bf15143050d1002cf5d7fd89ce00135d (diff)
downloadbarebox-f866f471337e3249e0946764f09841baf73d6c9d.tar.gz
barebox-f866f471337e3249e0946764f09841baf73d6c9d.tar.xz
bthread: add debug print for scheduler context switches
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> Link: https://lore.barebox.org/20210622082617.18011-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--common/bthread.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/common/bthread.c b/common/bthread.c
index c811797130..80651344da 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)