Changeset 473 for trunk/kernel/kern
- Timestamp:
- Aug 21, 2018, 6:01:01 PM (6 years ago)
- Location:
- trunk/kernel/kern
- Files:
-
- 2 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/do_syscall.c
r457 r473 180 180 181 181 // update user time 182 thread_ user_time_update( this );182 thread_time_update( this , 1 ); 183 183 184 184 // check syscall index … … 204 204 205 205 // update kernel time 206 thread_ kernel_time_update( this);206 thread_time_update( this , 0 ); 207 207 208 208 return error; -
trunk/kernel/kern/rpc.c
r459 r473 1108 1108 rpc_send( cxy , &rpc ); 1109 1109 1110 // get output argument from RPC descriptor 1111 *error = (error_t)rpc.args[1]; 1112 1110 1113 #if DEBUG_RPC_VFS_INODE_DESTROY 1111 1114 uint32_t cycle = (uint32_t)hal_get_cycles(); … … 1248 1251 ///////////////////////////////////////////////////////////////////////////////////////// 1249 1252 1250 1251 1253 /////////////////////////////////////////////////////// 1252 1254 void rpc_vfs_dentry_destroy_client( cxy_t cxy, … … 1274 1276 // register RPC request in remote RPC fifo 1275 1277 rpc_send( cxy , &rpc ); 1278 1279 // get output argument from RPC descriptor 1280 *error = (error_t)rpc.args[1]; 1276 1281 1277 1282 #if DEBUG_RPC_VFS_DENTRY_DESTROY -
trunk/kernel/kern/thread.c
r469 r473 528 528 if( error ) 529 529 { 530 vseg_detach( &child_process->vmm ,vseg );530 vseg_detach( vseg ); 531 531 vseg_free( vseg ); 532 532 thread_release( child_ptr ); … … 549 549 // increment the forks counter 550 550 remote_spinlock_lock( lock_xp ); 551 hal_remote_atomic_add( XPTR( page_cxy , &page_ptr->forks ), 1 );551 hal_remote_atomic_add( forks_xp , 1 ); 552 552 remote_spinlock_unlock( lock_xp ); 553 553 … … 1130 1130 1131 1131 1132 ///////////////////////////////////////////////// 1133 void thread_user_time_update( thread_t * thread ) 1134 { 1135 // TODO 1136 // printk("\n[WARNING] function %s not implemented\n", __FUNCTION__ ); 1137 } 1138 1139 /////////////////////////////////////////////////// 1140 void thread_kernel_time_update( thread_t * thread ) 1141 { 1142 // TODO 1143 // printk("\n[WARNING] function %s not implemented\n", __FUNCTION__ ); 1132 /////////////////////////////////////////// 1133 void thread_time_update( thread_t * thread, 1134 uint32_t is_user ) 1135 { 1136 cycle_t current_cycle; // current cycle counter value 1137 cycle_t last_cycle; // last cycle counter value 1138 1139 // get pointer on thread_info structure 1140 thread_info_t * info = &thread->info; 1141 1142 // get last cycle counter value 1143 last_cycle = info->last_cycle; 1144 1145 // get current cycle counter value 1146 current_cycle = hal_get_cycles(); 1147 1148 // update thread_info structure 1149 info->last_cycle = current_cycle; 1150 1151 // update time in thread_info 1152 if( is_user ) info->usr_cycles += (current_cycle - last_cycle); 1153 else info->sys_cycles += (current_cycle - last_cycle); 1144 1154 } 1145 1155 -
trunk/kernel/kern/thread.h
r459 r473 103 103 uint32_t u_err_nr; /*! TODO ??? [AG] */ 104 104 uint32_t m_err_nr; /*! TODO ??? [AG] */ 105 uint32_t tm_tmp; /*! temp date to compute execution duration */ 106 uint32_t tm_exec; /*! TODO ??? [AG] */ 107 uint32_t tm_create; /*! date of the creation */ 108 uint32_t tm_born; /*! date of the thread loading */ 109 uint32_t tm_dead; /*! date of the death */ 110 cycle_t tm_sleep; /*! TODO ??? [AG] */ 111 cycle_t tm_wait; /*! TODO ??? [AG] */ 112 cycle_t tm_usr; /*! user execution duration */ 113 cycle_t tm_sys; /*! system execution duration */ 105 cycle_t last_cycle; /*! last cycle counter value (date) */ 106 cycle_t usr_cycles; /*! user execution duration (cycles) */ 107 cycle_t sys_cycles; /*! system execution duration (cycles) */ 114 108 } 115 109 thread_info_t; … … 435 429 436 430 /*************************************************************************************** 437 * This function updates the calling thread user_time counter, and resets the thread 438 * cycles counter. 439 * TODO This function is not implemented. 431 * This function updates the calling thread user_time or kernel_time counters. 440 432 *************************************************************************************** 441 433 * @ thread : local pointer on target thread. 442 **************************************************************************************/ 443 void thread_user_time_update( thread_t * thread ); 444 445 /**************************************************************************************n 446 * This function updates the calling thread kernel_time counter, and resets the thread 447 * cycles counter. 448 * TODO This function is not implemented. 449 *************************************************************************************** 450 * @ thread : local pointer on target thread. 451 **************************************************************************************/ 452 void thread_kernel_time_update( thread_t * thread ); 434 * @ is_user : update user time if non zero / update kernel time if zero 435 **************************************************************************************/ 436 void thread_time_update( thread_t * thread, 437 uint32_t is_user ); 453 438 454 439 /***************************************************************************************
Note: See TracChangeset
for help on using the changeset viewer.