diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2021-06-22 10:26:11 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2021-06-25 09:30:33 +0200 |
commit | f866f471337e3249e0946764f09841baf73d6c9d (patch) | |
tree | 136ba5f3f7bf45e3dc92b3f31353b77a4f4568dc /common | |
parent | 774edc56bf15143050d1002cf5d7fd89ce00135d (diff) | |
download | barebox-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>
Diffstat (limited to 'common')
-rw-r--r-- | common/bthread.c | 5 |
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) |