Subversion Repositories HelenOS-historic

Rev

Rev 703 | Rev 779 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 703 Rev 775
Line 624... Line 624...
624
    atomic_set(&CPU->kcpulbstarted,0);
624
    atomic_set(&CPU->kcpulbstarted,0);
625
    goto loop;
625
    goto loop;
626
}
626
}
627
 
627
 
628
#endif /* CONFIG_SMP */
628
#endif /* CONFIG_SMP */
-
 
629
 
-
 
630
 
-
 
631
/** Print information about threads & scheduler queues */
-
 
632
void sched_print_list(void)
-
 
633
{
-
 
634
    ipl_t ipl;
-
 
635
    int cpu,i;
-
 
636
    runq_t *r;
-
 
637
    thread_t *t;
-
 
638
    link_t *cur;
-
 
639
 
-
 
640
    /* We are going to mess with scheduler structures,
-
 
641
     * let's not be interrupted */
-
 
642
    ipl = interrupts_disable();
-
 
643
    printf("*********** Scheduler dump ***********\n");
-
 
644
    for (cpu=0;cpu < config.cpu_count; cpu++) {
-
 
645
        if (!cpus[cpu].active)
-
 
646
            continue;
-
 
647
        spinlock_lock(&cpus[cpu].lock);
-
 
648
        printf("cpu%d: nrdy: %d needs_relink: %d\n",
-
 
649
               cpus[cpu].id, cpus[cpu].nrdy, cpus[cpu].needs_relink);
-
 
650
       
-
 
651
        for (i=0; i<RQ_COUNT; i++) {
-
 
652
            r = &cpus[cpu].rq[i];
-
 
653
            spinlock_lock(&r->lock);
-
 
654
            if (!r->n) {
-
 
655
                spinlock_unlock(&r->lock);
-
 
656
                continue;
-
 
657
            }
-
 
658
            printf("Rq %d: ", i);
-
 
659
            for (cur=r->rq_head.next; cur!=&r->rq_head; cur=cur->next) {
-
 
660
                t = list_get_instance(cur, thread_t, rq_link);
-
 
661
                printf("%d(%s) ", t->tid,
-
 
662
                       thread_states[t->state]);
-
 
663
            }
-
 
664
            printf("\n");
-
 
665
            spinlock_unlock(&r->lock);
-
 
666
        }
-
 
667
        spinlock_unlock(&cpus[cpu].lock);
-
 
668
    }
-
 
669
   
-
 
670
    interrupts_restore(ipl);
-
 
671
}