Changeset 437 for trunk/kernel/syscalls/sys_thread_create.c
- Timestamp:
- Mar 28, 2018, 2:40:29 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/sys_thread_create.c
r407 r437 2 2 * sys_thread_create.c - creates a new user thread 3 3 * 4 * Author Alain Greiner (2016,2017 )4 * Author Alain Greiner (2016,2017,2018) 5 5 * 6 6 * Copyright (c) UPMC Sorbonne Universites … … 57 57 error_t error; 58 58 59 uint32_t tm_start;60 uint32_t tm_end;61 62 tm_start = hal_get_cycles();63 64 59 // get parent thead pointer, extended pointer, and process 65 60 parent = CURRENT_THREAD; … … 67 62 process = parent->process; 68 63 64 #if CONFIG_DEBUG_SYS_THREAD_CREATE 65 uint64_t tm_start; 66 uint64_t tm_end; 67 tm_start = hal_get_cycles(); 68 if( CONFIG_DEBUG_SYS_THREAD_CREATE < tm_start ) 69 printk("\n[DBG] %s : thread %x enter / process %x / cycle %d\n" 70 __FUNCTION__ , parent , process->pid, (uint32_t)tm_start ); 71 #endif 72 69 73 // check user_attr in user space & copy to kernel space 70 74 if( user_attr != NULL ) … … 74 78 if( error ) 75 79 { 76 printk("\n[ERROR] in %s : user_attr unmapped\n", __FUNCTION__ ); 80 81 #if CONFIG_DEBUG_SYSCALLS_ERROR 82 printk("\n[ERROR] in %s : user_attr unmapped\n", __FUNCTION__ ); 83 #endif 77 84 parent->errno = EINVAL; 78 85 return -1; … … 87 94 if( error ) 88 95 { 89 printk("\n[ERROR] in %s : start_func unmapped\n", __FUNCTION__ ); 96 97 #if CONFIG_DEBUG_SYSCALLS_ERROR 98 printk("\n[ERROR] in %s : start_func unmapped\n", __FUNCTION__ ); 99 #endif 90 100 parent->errno = EINVAL; 91 101 return -1; … … 97 107 if( error ) 98 108 { 99 printk("\n[ERROR] in %s : start_arg unmapped\n", __FUNCTION__ ); 109 110 #if CONFIG_DEBUG_SYSCALLS_ERROR 111 printk("\n[ERROR] in %s : start_arg unmapped\n", __FUNCTION__ ); 112 #endif 100 113 parent->errno = EINVAL; 101 114 return -1; … … 110 123 if( cluster_is_undefined( kern_attr.cxy ) ) 111 124 { 112 printk("\n[ERROR] in %s : illegal target cluster = %x\n", 113 __FUNCTION__ , kern_attr.cxy ); 125 126 #if CONFIG_DEBUG_SYSCALLS_ERROR 127 printk("\n[ERROR] in %s : illegal target cluster = %x\n", __FUNCTION__ , kern_attr.cxy ); 128 #endif 114 129 parent->errno = EINVAL; 115 130 return -1; … … 158 173 if( error ) 159 174 { 160 printk("\n[ERROR] in %s : cannot create thread\n", __FUNCTION__ ); 175 176 #if CONFIG_DEBUG_SYSCALLS_ERROR 177 printk("\n[ERROR] in %s : cannot create thread\n", __FUNCTION__ ); 178 #endif 161 179 return ENOMEM; 162 180 } … … 178 196 hal_fence(); 179 197 180 tm_end = hal_get_cycles(); 181 182 syscall_dmsg("\n[DBG] %s : core[%x,%d] created thread %x for process %x / cycle %d\n" 183 " cluster %x / cost = %d cycles\n", 184 __FUNCTION__ , local_cxy , parent->core->lid , trdid , process->pid , tm_end ,185 target_cxy , tm_end - tm_start ); 198 #if CONFIG_DEBUG_SYS_THREAD_CREATE 199 tm_end = hal_get_cycles(); 200 if( CONFIG_DEBUG_SYS_THREAD_CREATE < tm_end ) 201 printk("\n[DBG] %s : thread %x created thread %x for process %x in cluster %x / cycle %d\n" 202 __FUNCTION__, parent, child_ptr, process->pid, target_cxy, (uint32_t)tm_end ); 203 #endif 186 204 187 205 return 0;
Note: See TracChangeset
for help on using the changeset viewer.