Ignore:
Timestamp:
Feb 14, 2018, 3:40:19 PM (4 years ago)
Author:
alain
Message:

blip

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/kern/scheduler.c

    r428 r433  
    178178
    179179///////////////////////////////////////////
    180 void sched_handle_requests( core_t * core )
     180void sched_handle_signals( core_t * core )
    181181{
    182182    list_entry_t * iter;
     
    231231            thread_destroy( thread );
    232232
    233 sched_dmsg("\n[DBG] %s : thread %x deleted thread %x / cycle %d\n",
    234 __FUNCTION__ , CURRENT_THREAD , thread , (uint32_t)hal_get_cycles() );
    235 
     233#if CONFIG_DEBUG_SCHED_HANDLE_SIGNALS
     234uint32_t cycle = (uint32_t)hal_get_cycles();
     235if( CONFIG_DEBUG_SCHED_HANDLE_SIGNALS < cycle )
     236printk("\n[DBG] %s : thread %x deleted thread %x / cycle %d\n",
     237__FUNCTION__ , CURRENT_THREAD , thread , cycle );
     238#endif
    236239            // destroy process descriptor if no more threads
    237240            if( process->th_nr == 0 )
     
    240243                process_destroy( process );
    241244
    242 sched_dmsg("\n[DBG] %s : thread %x deleted process %x / cycle %d\n",
    243 __FUNCTION__ , CURRENT_THREAD , process , (uint32_t)hal_get_cycles() );
     245#if CONFIG_DEBUG_SCHED_HANDLE_SIGNALS
     246cycle = (uint32_t)hal_get_cycles();
     247if( CONFIG_DEBUG_SCHED_HANDLE_SIGNALS < cycle )
     248printk("\n[DBG] %s : thread %x deleted process %x / cycle %d\n",
     249__FUNCTION__ , CURRENT_THREAD , process , cycle );
     250#endif
    244251
    245252            }
     
    251258    spinlock_unlock( &sched->lock );
    252259
    253 } // end sched_handle_requests()
     260} // end sched_handle_signals()
    254261
    255262////////////////////////////////
     
    261268    scheduler_t * sched   = &core->scheduler;
    262269 
    263 #if( CONFIG_SCHED_DEBUG & 0x1 )
    264 if( hal_time_stamp() > CONFIG_SCHED_DEBUG ) sched_display( core->lid );
     270#if (CONFIG_DEBUG_SCHED_YIELD & 0x1)
     271if( CONFIG_DEBUG_SCHED_YIELD < (uint32_t)hal_get_cycles() )
     272sched_display( core->lid );
    265273#endif
    266274
     
    291299    {
    292300
    293 sched_dmsg("\n[DBG] %s : core[%x,%d] / cause = %s\n"
     301#if CONFIG_DEBUG_SCHED_YIELD
     302uint32_t cycle = (uint32_t)hal_get_cycles();
     303if( CONFIG_DEBUG_SCHED_YIELD < cycle )
     304printk("\n[DBG] %s : core[%x,%d] / cause = %s\n"
    294305"      thread %x (%s) (%x,%x) => thread %x (%s) (%x,%x) / cycle %d\n",
    295306__FUNCTION__, local_cxy, core->lid, cause,
    296307current, thread_type_str(current->type), current->process->pid, current->trdid,
    297 next   , thread_type_str(next->type)   , next->process->pid   , next->trdid,
    298 (uint32_t)hal_get_cycles() );
     308next , thread_type_str(next->type) , next->process->pid , next->trdid , cycle );
     309#endif
    299310
    300311        // update scheduler
     
    316327    {
    317328
    318 #if( CONFIG_SCHED_DEBUG & 0x1 )
    319 if( hal_time_stamp() > CONFIG_SCHED_DEBUG )
    320 printk("\n[DBG] %s : core[%x,%d] / cause = %s\n"
    321 "      thread %x (%s) (%x,%x) continue / cycle %d\n",
     329#if( CONFIG_DEBUG_SCHED_YIELD & 0x1 )
     330uint32_t cycle = (uint32_t)hal_get_cycles();
     331if( CONFIG_DEBUG_SCHED_YIELD < cycle )
     332printk("\n[DBG] %s : core[%x,%d] / cause = %s / thread %x (%s) (%x,%x) continue / cycle %d\n",
    322333__FUNCTION__, local_cxy, core->lid, cause,
    323 current, thread_type_str(current->type), current->process->pid, current->trdid,
    324 (uint32_t)hal_get_cycles() );
     334current, thread_type_str(current->type), current->process->pid, current->trdid, cycle );
    325335#endif
    326336
     
    328338
    329339    // handle pending requests for all threads executing on this core.
    330     sched_handle_requests( core );
     340    sched_handle_signals( core );
    331341
    332342    // exit critical section / restore SR from next thread context
Note: See TracChangeset for help on using the changeset viewer.