Changeset 637 for trunk/kernel/syscalls/sys_get_cycle.c
- Timestamp:
- Jul 18, 2019, 2:06:55 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/sys_get_cycle.c
r635 r637 45 45 process_t * process = this->process; 46 46 47 #if (DEBUG_SYS_GET_CYCLE || CONFIG_INSTRUMENTATION_SYSCALLS) 48 uint64_t tm_start = hal_get_cycles(); 49 #endif 50 47 51 // check buffer in user space 48 52 error = vmm_get_vseg( process , (intptr_t)cycle , &vseg ); … … 63 67 64 68 // copy to user space 65 hal_copy_to_uspace( local_cxy, &k_cycle, cycle, sizeof(uint64_t) ); 69 hal_copy_to_uspace( cycle, 70 XPTR( local_cxy , &k_cycle ), 71 sizeof(uint64_t) ); 72 73 #if (DEBUG_SYS_GET_CYCLE || CONFIG_INSTRUMENTATION_SYSCALLS) 74 uint64_t tm_end = hal_get_cycles(); 75 #endif 76 77 #if DEBUG_SYS_GET_CYCLE 78 if( DEBUG_SYS_GET_CYCLE < tm_end ) 79 printk("\n[%s] thread[%x,%x] exit / cycle %d\n", 80 __FUNCTION__ , process->pid, this->trdid, (uint32_t)tm_end ); 81 #endif 82 83 #if CONFIG_INSTRUMENTATION_SYSCALLS 84 hal_atomic_add( &syscalls_cumul_cost[SYS_GET_CYCLE] , tm_end - tm_start ); 85 hal_atomic_add( &syscalls_occurences[SYS_GET_CYCLE] , 1 ); 86 #endif 66 87 67 88 return 0;
Note: See TracChangeset
for help on using the changeset viewer.