Ignore:
Timestamp:
Nov 10, 2018, 2:33:26 PM (3 years ago)
Author:
alain
Message:

Fix various bugs in sys_stat() and sys_mmap() functions.
Improve debug in other functions.

File:
1 edited

Legend:

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

    r584 r594  
    6565    process_t * process = this->process;
    6666
     67#if (DEBUG_SYS_DISPLAY || CONFIG_INSTRUMENTATION_SYSCALLS)
     68uint64_t     tm_start = hal_get_cycles();
     69#endif
     70
    6771#if DEBUG_SYS_DISPLAY
    68 uint64_t    tm_start;
    69 uint64_t    tm_end;
    7072tm_start = hal_get_cycles();
    7173if( DEBUG_SYS_DISPLAY < tm_start )
    72 printk("\n[DBG] %s : thread %d enter / process %x / type  %s / cycle = %d\n",
    73 __FUNCTION__, this, this->process->pid, display_type_str(type), (uint32_t)tm_start );
     74printk("\n[DBG] %s : thread[%x,%x] enter / type  %s / cycle = %d\n",
     75__FUNCTION__, process->pid, this->trdid, display_type_str(type), (uint32_t)tm_start );
    7476#endif
    7577
     
    257259    else if( type == DISPLAY_BUSYLOCKS )
    258260    {
    259         pid_t   pid   = (cxy_t)arg0;
     261        pid_t   pid   = (pid_t)arg0;
    260262        trdid_t trdid = (trdid_t)arg1;
    261263
     
    267269
    268270#if DEBUG_SYSCALLS_ERROR
    269 printk("\n[ERROR] in %s for BUSYLOCKS : thread %x in process %x not found\n",
    270 __FUNCTION__ , trdid , pid );
     271printk("\n[ERROR] in %s for BUSYLOCKS : thread[%x,%x] not found\n",
     272__FUNCTION__ , pid, trdid );
    271273#endif
    272274            this->errno = EINVAL;
     
    288290    }
    289291
     292#if (DEBUG_SYS_DISPLAY || CONFIG_INSTRUMENTATION_SYSCALLS)
     293uint64_t     tm_end = hal_get_cycles();
     294#endif
     295
    290296#if DEBUG_SYS_DISPLAY
    291 tm_end = hal_get_cycles();
    292297if( DEBUG_SYS_DISPLAY < tm_end )
    293 printk("\n[DBG] %s : thread %x exit / process %x / cost = %d / cycle %d\n",
    294 __FUNCTION__, this, this->process->pid, (uint32_t)(tm_end - tm_start) , (uint32_t)tm_end );
     298printk("\n[DBG] %s : thread[%x,%x] exit / cycle %d\n",
     299__FUNCTION__, process->pid, this->trdid, (uint32_t)tm_end );
     300#endif
     301
     302#if CONFIG_INSTRUMENTATION_SYSCALLS
     303hal_atomic_add( &syscalls_cumul_cost[SYS_DISPLAY] , tm_end - tm_start );
     304hal_atomic_add( &syscalls_occurences[SYS_DISPLAY] , 1 );
    295305#endif
    296306
Note: See TracChangeset for help on using the changeset viewer.