Changeset 433 for trunk/kernel/kern/scheduler.c
- Timestamp:
- Feb 14, 2018, 3:40:19 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/scheduler.c
r428 r433 178 178 179 179 /////////////////////////////////////////// 180 void sched_handle_ requests( core_t * core )180 void sched_handle_signals( core_t * core ) 181 181 { 182 182 list_entry_t * iter; … … 231 231 thread_destroy( thread ); 232 232 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 234 uint32_t cycle = (uint32_t)hal_get_cycles(); 235 if( CONFIG_DEBUG_SCHED_HANDLE_SIGNALS < cycle ) 236 printk("\n[DBG] %s : thread %x deleted thread %x / cycle %d\n", 237 __FUNCTION__ , CURRENT_THREAD , thread , cycle ); 238 #endif 236 239 // destroy process descriptor if no more threads 237 240 if( process->th_nr == 0 ) … … 240 243 process_destroy( process ); 241 244 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 246 cycle = (uint32_t)hal_get_cycles(); 247 if( CONFIG_DEBUG_SCHED_HANDLE_SIGNALS < cycle ) 248 printk("\n[DBG] %s : thread %x deleted process %x / cycle %d\n", 249 __FUNCTION__ , CURRENT_THREAD , process , cycle ); 250 #endif 244 251 245 252 } … … 251 258 spinlock_unlock( &sched->lock ); 252 259 253 } // end sched_handle_ requests()260 } // end sched_handle_signals() 254 261 255 262 //////////////////////////////// … … 261 268 scheduler_t * sched = &core->scheduler; 262 269 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) 271 if( CONFIG_DEBUG_SCHED_YIELD < (uint32_t)hal_get_cycles() ) 272 sched_display( core->lid ); 265 273 #endif 266 274 … … 291 299 { 292 300 293 sched_dmsg("\n[DBG] %s : core[%x,%d] / cause = %s\n" 301 #if CONFIG_DEBUG_SCHED_YIELD 302 uint32_t cycle = (uint32_t)hal_get_cycles(); 303 if( CONFIG_DEBUG_SCHED_YIELD < cycle ) 304 printk("\n[DBG] %s : core[%x,%d] / cause = %s\n" 294 305 " thread %x (%s) (%x,%x) => thread %x (%s) (%x,%x) / cycle %d\n", 295 306 __FUNCTION__, local_cxy, core->lid, cause, 296 307 current, 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() ); 308 next , thread_type_str(next->type) , next->process->pid , next->trdid , cycle ); 309 #endif 299 310 300 311 // update scheduler … … 316 327 { 317 328 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 ) 330 uint32_t cycle = (uint32_t)hal_get_cycles(); 331 if( CONFIG_DEBUG_SCHED_YIELD < cycle ) 332 printk("\n[DBG] %s : core[%x,%d] / cause = %s / thread %x (%s) (%x,%x) continue / cycle %d\n", 322 333 __FUNCTION__, local_cxy, core->lid, cause, 323 current, thread_type_str(current->type), current->process->pid, current->trdid, 324 (uint32_t)hal_get_cycles() ); 334 current, thread_type_str(current->type), current->process->pid, current->trdid, cycle ); 325 335 #endif 326 336 … … 328 338 329 339 // handle pending requests for all threads executing on this core. 330 sched_handle_ requests( core );340 sched_handle_signals( core ); 331 341 332 342 // exit critical section / restore SR from next thread context
Note: See TracChangeset
for help on using the changeset viewer.