Ignore:
Timestamp:
Jan 4, 2018, 10:05:47 AM (6 years ago)
Author:
alain
Message:

Improve sys_exec.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/syscalls/sys_fork.c

    r409 r416  
    5656        error_t           error;
    5757   
    58         uint64_t          tm_start;
    59         uint64_t          tm_end;
    60 
    61         tm_start = hal_get_cycles();
    6258
    6359    // get pointers on local parent process and thread
     
    6763    parent_pid         = parent_process_ptr->pid;
    6864
    69 fork_dmsg("\n[DBG] %s : core[%x,%d] parent process %x enters / cycle %d\n",
    70 __FUNCTION__, local_cxy, parent_thread_ptr->core->lid, parent_pid, (uint32_t)tm_start );
     65#if CONFIG_SYSCALL_DEBUG
     66uint64_t          tm_start;
     67uint64_t          tm_end;
     68tm_start = hal_get_cycles();
     69printk("\n[DBG] %s : core[%x,%d] enter / process %x / cycle =  %d\n",
     70__FUNCTION__, local_cxy, parent_thread_ptr->core->lid, parent_pid,
     71(uint32_t)tm_start );
     72#endif
    7173
    7274    // get infos on reference process
     
    146148        thread_unblock( XPTR( target_cxy , child_thread_ptr ) , THREAD_BLOCKED_GLOBAL );
    147149
    148         tm_end = hal_get_cycles();
    149 
    150 fork_dmsg("\n[DBG] %s : core[%x,%d] parent_process %x exit / cycle %d\n"
    151 "     child_process %x / child_thread = %x / cost = %d\n",
    152 __FUNCTION__, local_cxy, parent_thread_ptr->core->lid,  parent_pid, (uint32_t)tm_end,
    153 child_pid, child_thread_ptr->trdid , (uint32_t)(tm_end - tm_start) );
     150#if CONFIG_SYSCALL_DEBUG
     151tm_end = hal_get_cycles();
     152printk("\n[DBG] %s : core[%x,%d] parent_process %x exit / cost = %d\n",
     153__FUNCTION__, local_cxy, parent_thread_ptr->core->lid,  parent_pid,
     154(uint32_t)(tm_end - tm_start) );
     155#endif
    154156
    155157        return child_pid;
     
    158160    {
    159161
    160         tm_end = hal_get_cycles();
    161 
    162 fork_dmsg("\n[DBG] %s : core[%x,%d] child process %x exit / cycle %d\n",
    163 __FUNCTION__, local_cxy, parent_thread_ptr->core->lid, child_pid, (uint32_t)tm_end );
     162#if CONFIG_SYSCALL_DEBUG
     163tm_end = hal_get_cycles();
     164printk("\n[DBG] %s : core[%x,%d] child process %x exit / cost =  %d\n",
     165__FUNCTION__, local_cxy, parent_thread_ptr->core->lid, child_pid,
     166(uint32_t)(tm_end - tm_start) );
     167#endif
    164168
    165169        return 0;
Note: See TracChangeset for help on using the changeset viewer.