Changeset 637 for trunk/kernel/syscalls/sys_trace.c
- Timestamp:
- Jul 18, 2019, 2:06:55 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/sys_trace.c
r566 r637 2 2 * sys_trace.c - activate / desactivate the context switches trace for a given core 3 3 * 4 * Author Alain Greiner (c) (2016,2017,2018 )4 * Author Alain Greiner (c) (2016,2017,2018,2019) 5 5 * 6 6 * Copyright (c) UPMC Sorbonne Universites … … 40 40 process_t * process = this->process; 41 41 42 #if (DEBUG_SYS_TRACE || CONFIG_INSTRUMENTATION_SYSCALLS) 43 uint64_t tm_start = hal_get_cycles(); 44 #endif 45 42 46 #if DEBUG_SYS_TRACE 43 uint64_t tm_start;44 uint64_t tm_end;45 tm_start = hal_get_cycles();46 47 if( DEBUG_SYS_TRACE < tm_start ) 47 printk("\n[ DBG] %s : thread %d enter / process %x/ cycle = %d\n",48 __FUNCTION__, this , this->process->pid, (uint32_t)tm_start );48 printk("\n[%s] thread[%x,%x] enters / cycle = %d\n", 49 __FUNCTION__, this->process->pid, this->trdid, (uint32_t)tm_start ); 49 50 #endif 50 51 51 52 // check cluster identifier 52 if( cluster_is_ undefined( cxy ))53 if( cluster_is_active( cxy ) == false ) 53 54 { 54 55 … … 85 86 hal_fence(); 86 87 87 #if DEBUG_SYS_TRACE 88 tm_end = hal_get_cycles(); 89 if( DEBUG_SYS_TRACE < tm_end ) 90 printk("\n[DBG] %s : thread %x exit / process %x / cost = %d / cycle %d\n", 91 __FUNCTION__, this, this->process->pid, (uint32_t)(tm_end - tm_start) , (uint32_t)tm_end ); 88 #if (DEBUG_SYS_TRACE || CONFIG_INSTRUMENTATION_SYSCALLS) 89 uint64_t tm_end = hal_get_cycles(); 92 90 #endif 93 91 92 #if DEBUG_SYS_TRACE 93 if( DEBUG_SYS_TRACE < tm_end ) 94 printk("\n[%s] thread[%x,%x] exit / cycle %d\n", 95 __FUNCTION__, this->process->pid, this->trdid, (uint32_t)tm_end ); 96 #endif 97 98 #if CONFIG_INSTRUMENTATION_SYSCALLS 99 hal_atomic_add( &syscalls_cumul_cost[SYS_TRACE] , tm_end - tm_start ); 100 hal_atomic_add( &syscalls_occurences[SYS_TRACE] , 1 ); 101 #endif 94 102 return 0; 95 103
Note: See TracChangeset
for help on using the changeset viewer.