From 6ad5d4edc06fe9d3124c6a142739d18f1622d5f9 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Sun, 29 Mar 2009 18:11:28 +0000 Subject: [PATCH] dump_run_queue() now outputs the average quantum usage for threads as well. Not quite formatted properly due to what appear to be limitations in kprintf's handling of float format specifiers. Need to investigate. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29789 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/scheduler/scheduler_affine.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/system/kernel/scheduler/scheduler_affine.cpp b/src/system/kernel/scheduler/scheduler_affine.cpp index df37435734..1f1e788f8a 100644 --- a/src/system/kernel/scheduler/scheduler_affine.cpp +++ b/src/system/kernel/scheduler/scheduler_affine.cpp @@ -88,15 +88,17 @@ dump_run_queue(int argc, char **argv) { struct thread *thread = NULL; - for (int32 i = 0; i < smp_get_num_cpus(); i++) { + for (int32 i = 0; i < smp_get_num_cpus(); i++) { thread = sRunQueue[i]; - if (!thread) - kprintf("Run queue for cpu %ld is empty!\n", i); - else { - kprintf("thread id priority name\n"); + kprintf("Run queue for cpu %ld (%ld threads)\n", i, + sRunQueueSize[i]); + if (sRunQueueSize[i] > 0) { + kprintf("thread id priority avg. quantum name\n"); while (thread) { - kprintf("%p %-7ld %-8ld %s\n", thread, thread->id, - thread->priority, thread->name); + kprintf("%p %-7ld %-8ld %-12.2f %s\n", thread, thread->id, + thread->priority, + thread->scheduler_data->GetAverageQuantumUsage(), + thread->name); thread = thread->queue_next; } }