From 8ce9e523e039d3dccce47c5acf63ef2ba5447ca5 Mon Sep 17 00:00:00 2001 From: Ali Mashtizadeh Date: Wed, 30 Aug 2023 15:50:41 -0400 Subject: [PATCH] Print currently running threads as well for debugging. --- sys/kern/thread.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/kern/thread.c b/sys/kern/thread.c index 0ac88fb..51f5d8a 100644 --- a/sys/kern/thread.c +++ b/sys/kern/thread.c @@ -315,6 +315,13 @@ Debug_Threads(int argc, const char *argv[]) //Spinlock_Lock(&threadLock); + for (int i = 0; i < MAX_CPUS; i++) { + thr = curProc[i]; + if (thr) { + kprintf("Running Thread CPU %d: %d(%016llx) %d\n", i, thr->tid, thr, thr->ctxSwitches); + Thread_Dump(thr); + } + } TAILQ_FOREACH(thr, &runnableQueue, schedQueue) { kprintf("Runnable Thread: %d(%016llx) %d\n", thr->tid, thr, thr->ctxSwitches);