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
This commit is contained in:
Rene Gollent 2009-03-29 18:11:28 +00:00
parent b2e4e08493
commit 6ad5d4edc0
1 changed files with 9 additions and 7 deletions

View File

@ -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;
}
}