Changeset 640 for trunk/kernel/kern/scheduler.c
- Timestamp:
- Oct 1, 2019, 1:19:00 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/scheduler.c
r635 r640 507 507 #if (DEBUG_SCHED_YIELD & 0x1) 508 508 if( sched->trace || (cycle > DEBUG_SCHED_YIELD) ) 509 sched_ display(lid );509 sched_remote_display( local_cxy , lid ); 510 510 #endif 511 511 … … 593 593 } // end sched_yield() 594 594 595 596 ///////////////////////////////597 void sched_display( lid_t lid )598 {599 list_entry_t * iter;600 thread_t * thread;601 602 core_t * core = &LOCAL_CLUSTER->core_tbl[lid];603 scheduler_t * sched = &core->scheduler;604 605 // get pointers on TXT0 chdev606 xptr_t txt0_xp = chdev_dir.txt_tx[0];607 cxy_t txt0_cxy = GET_CXY( txt0_xp );608 chdev_t * txt0_ptr = GET_PTR( txt0_xp );609 610 // get extended pointer on remote TXT0 lock611 xptr_t lock_xp = XPTR( txt0_cxy , &txt0_ptr->wait_lock );612 613 // get TXT0 lock614 remote_busylock_acquire( lock_xp );615 616 nolock_printk("\n***** threads on core[%x,%d] / current %x / rpc_threads %d / cycle %d\n",617 local_cxy , lid, sched->current, LOCAL_CLUSTER->rpc_threads[lid],618 (uint32_t)hal_get_cycles() );619 620 // display kernel threads621 LIST_FOREACH( &sched->k_root , iter )622 {623 thread = LIST_ELEMENT( iter , thread_t , sched_list );624 if (thread->type == THREAD_DEV)625 {626 nolock_printk(" - %s / pid %X / trdid %X / desc %X / block %X / flags %X / %s\n",627 thread_type_str( thread->type ), thread->process->pid, thread->trdid,628 thread, thread->blocked, thread->flags, thread->chdev->name );629 }630 else631 {632 nolock_printk(" - %s / pid %X / trdid %X / desc %X / block %X / flags %X\n",633 thread_type_str( thread->type ), thread->process->pid, thread->trdid,634 thread, thread->blocked, thread->flags );635 }636 }637 638 // display user threads639 LIST_FOREACH( &sched->u_root , iter )640 {641 thread = LIST_ELEMENT( iter , thread_t , sched_list );642 nolock_printk(" - %s / pid %X / trdid %X / desc %X / block %X / flags %X\n",643 thread_type_str( thread->type ), thread->process->pid, thread->trdid,644 thread, thread->blocked, thread->flags );645 }646 647 // release TXT0 lock648 remote_busylock_release( lock_xp );649 650 } // end sched_display()651 595 652 596 ///////////////////////////////////// … … 684 628 nolock_printk("\n***** threads on core[%x,%d] / current %x / rpc_threads %d / cycle %d\n", 685 629 cxy , lid, current, rpcs, (uint32_t)hal_get_cycles() ); 630 nolock_printk(" type | pid | trdid | desc | block | flags | func\n"); 686 631 687 632 // display kernel threads … … 706 651 hal_remote_strcpy( XPTR( local_cxy , name ), XPTR( cxy , chdev->name ) ); 707 652 708 nolock_printk(" - %s / pid %X / trdid %X / desc %X / block %X / flags %X /%s\n",653 nolock_printk(" - %s | %X | %X | %X | %X | %X | %s\n", 709 654 thread_type_str( type ), pid, trdid, thread, blocked, flags, name ); 710 655 } 711 656 else 712 657 { 713 nolock_printk(" - %s / pid %X / trdid %X / desc %X / block %X / flags %X\n",658 nolock_printk(" - %s | %X | %X | %X | %X | %X |\n", 714 659 thread_type_str( type ), pid, trdid, thread, blocked, flags ); 715 660 } … … 732 677 process_t * process = hal_remote_lpt ( XPTR( cxy , &thread->process ) ); 733 678 pid_t pid = hal_remote_l32 ( XPTR( cxy , &process->pid ) ); 734 735 nolock_printk(" - %s / pid %X / trdid %X / desc %X / block %X / flags %X\n", 736 thread_type_str( type ), pid, trdid, thread, blocked, flags ); 679 void * func = hal_remote_lpt ( XPTR( cxy , &thread->entry_func ) ); 680 681 nolock_printk(" - %s | %X | %X | %X | %X | %X | %x\n", 682 thread_type_str( type ), pid, trdid, thread, blocked, flags, (uint32_t)func ); 737 683 738 684 // get next user thread list_entry
Note: See TracChangeset
for help on using the changeset viewer.