Changeset 625 for trunk/kernel/syscalls/sys_mutex.c
- Timestamp:
- Apr 10, 2019, 10:09:39 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/sys_mutex.c
r624 r625 2 2 * sys_mutex.c - Access a POSIX mutex. 3 3 * 4 * Author Alain Greiner (2016,2017,2018 )4 * Author Alain Greiner (2016,2017,2018,2019) 5 5 * 6 6 * Copyright (c) UPMC Sorbonne Universites … … 24 24 #include <hal_kernel_types.h> 25 25 #include <hal_special.h> 26 #include <hal_vmm.h> 26 27 #include <errno.h> 27 28 #include <thread.h> … … 56 57 process_t * process = this->process; 57 58 59 #if (DEBUG_SYS_MUTEX || CONFIG_INSTRUMENTATION_SYSCALLS) 60 uint64_t tm_start = hal_get_cycles(); 61 #endif 62 58 63 #if DEBUG_SYS_MUTEX 59 uint64_t tm_start;60 uint64_t tm_end;61 tm_start = hal_get_cycles();62 64 if( DEBUG_SYS_MUTEX < tm_start ) 63 printk("\n[ DBG] %s : thread %x in process %xenter for %s / cycle %d\n",65 printk("\n[%s] thread[%x,%x] enter for %s / cycle %d\n", 64 66 __FUNCTION__, this->trdid, process->pid, sys_mutex_op_str( operation ), (uint32_t)tm_start ); 65 67 #endif … … 221 223 hal_fence(); 222 224 225 #if (DEBUG_SYS_MUTEX || CONFIG_INSTRUMENTATION_SYSCALLS) 226 uint64_t tm_end = hal_get_cycles(); 227 #endif 228 223 229 #if DEBUG_SYS_MUTEX 224 tm_end = hal_get_cycles(); 225 if( DEBUG_SYS_MUTEX < tm_start ) 226 printk("\n[DBG] %s : thread %x in process %x exit for %s / cost %d / cycle %d\n", 227 __FUNCTION__, this->trdid, process->pid, sys_mutex_op_str( operation ), 228 (uint32_t)(tm_end - tm_start), (uint32_t)tm_end ); 230 if( DEBUG_SYS_MUTEX < tm_end ) 231 printk("\n[%s] thread[%x,%x] exit for %s / cycle %d\n", 232 __FUNCTION__, this->trdid, process->pid, sys_mutex_op_str( operation ), (uint32_t)tm_end ); 233 #endif 234 235 #if CONFIG_INSTRUMENTATION_SYSCALLS 236 hal_atomic_add( &syscalls_cumul_cost[SYS_MUTEX] , tm_end - tm_start ); 237 hal_atomic_add( &syscalls_occurences[SYS_MUTEX] , 1 ); 229 238 #endif 230 239
Note: See TracChangeset
for help on using the changeset viewer.