Subversion Repositories HelenOS

Rev

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

Rev 2504 Rev 2712
Line 584... Line 584...
584
    t = avltree_get_instance(node, thread_t, threads_tree_node);
584
    t = avltree_get_instance(node, thread_t, threads_tree_node);
585
 
585
 
586
    uint64_t cycles;
586
    uint64_t cycles;
587
    char suffix;
587
    char suffix;
588
    order(t->cycles, &cycles, &suffix);
588
    order(t->cycles, &cycles, &suffix);
589
           
589
   
-
 
590
    if (sizeof(void *) == 4)
590
    printf("%-6llu %-10s %#10zx %-8s %#10zx %-3ld %#10zx %#10zx %9llu%c ",
591
        printf("%-6llu %-10s %#10zx %-8s %#10zx %-3ld %#10zx %#10zx %9llu%c ",
-
 
592
            t->tid, t->name, t, thread_states[t->state], t->task,
-
 
593
            t->task->context, t->thread_code, t->kstack, cycles, suffix);
-
 
594
    else
-
 
595
        printf("%-6llu %-10s %#18zx %-8s %#18zx %-3ld %#18zx %#18zx %9llu%c ",
591
        t->tid, t->name, t, thread_states[t->state], t->task,
596
            t->tid, t->name, t, thread_states[t->state], t->task,
592
        t->task->context, t->thread_code, t->kstack, cycles, suffix);
597
            t->task->context, t->thread_code, t->kstack, cycles, suffix);
593
           
598
           
594
    if (t->cpu)
599
    if (t->cpu)
595
        printf("%-4zd", t->cpu->id);
600
        printf("%-4zd", t->cpu->id);
596
    else
601
    else
597
        printf("none");
602
        printf("none");
598
           
603
           
599
    if (t->state == Sleeping)
604
    if (t->state == Sleeping) {
-
 
605
        if (sizeof(uintptr_t) == 4)
600
        printf(" %#10zx", t->sleep_queue);
606
            printf(" %#10zx", t->sleep_queue);
-
 
607
        else
-
 
608
            printf(" %#18zx", t->sleep_queue);
-
 
609
    }
601
           
610
           
602
    printf("\n");
611
    printf("\n");
603
 
612
 
604
    return true;
613
    return true;
605
}
614
}
Line 611... Line 620...
611
   
620
   
612
    /* Messing with thread structures, avoid deadlock */
621
    /* Messing with thread structures, avoid deadlock */
613
    ipl = interrupts_disable();
622
    ipl = interrupts_disable();
614
    spinlock_lock(&threads_lock);
623
    spinlock_lock(&threads_lock);
615
   
624
   
-
 
625
    if (sizeof(uintptr_t) == 4) {
616
    printf("tid    name       address    state    task       ctx code    "
626
        printf("tid    name       address    state    task       "
617
        "   stack      cycles     cpu  waitqueue\n");
627
            "ctx code       stack      cycles     cpu  "
-
 
628
            "waitqueue\n");
618
    printf("------ ---------- ---------- -------- ---------- --- --------"
629
        printf("------ ---------- ---------- -------- ---------- "
619
        "-- ---------- ---------- ---- ---------\n");
630
            "--- ---------- ---------- ---------- ---- "
-
 
631
            "----------\n");
-
 
632
    } else {
-
 
633
        printf("tid    name       address            state    task               "
-
 
634
            "ctx code               stack              cycles     cpu  "
-
 
635
            "waitqueue\n");
-
 
636
        printf("------ ---------- ------------------ -------- ------------------ "
-
 
637
            "--- ------------------ ------------------ ---------- ---- "
-
 
638
            "------------------\n");
-
 
639
    }
620
 
640
 
621
    avltree_walk(&threads_tree, thread_walker, NULL);
641
    avltree_walk(&threads_tree, thread_walker, NULL);
622
 
642
 
623
    spinlock_unlock(&threads_lock);
643
    spinlock_unlock(&threads_lock);
624
    interrupts_restore(ipl);
644
    interrupts_restore(ipl);