Ignore:
Timestamp:
Nov 10, 2018, 5:38:51 PM (5 years ago)
Author:
alain
Message:

Cosmetic: improve debug.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/libk/remote_queuelock.c

    r563 r600  
    6767    remote_queuelock_t * lock_ptr = GET_PTR( lock_xp );
    6868
     69#if DEBUG_QUEUELOCK
     70uint32_t lock_type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) );
     71#endif
     72
    6973    // build extended pointer on busylock protecting queuelock
    7074    xptr_t busylock_xp = XPTR( lock_cxy , &lock_ptr->lock );
     
    7983#if DEBUG_QUEUELOCK
    8084if( DEBUG_QUEUELOCK < (uint32_t)hal_get_cycles() )
    81 {
    82     uint32_t   type = hal_remote_l32( XPTR( lock_cxy , &locr_ptr->lock.type ) );
    83     printk("\n[DBG] %s : thread %x in process %x BLOCK on q_lock %s [%x,%x]\n",
    84     __FUNCTION__, this->trdid, this->process->pid,
    85     lock_type_str[type], lock_cxy, lock_ptr );
    86 }
     85printk("\n[%s] thread[%x,%x] BLOCK on q_lock %s [%x,%x]\n",
     86__FUNCTION__, this->process->pid, this->trdid,
     87lock_type_str[lock_type], lock_cxy, lock_ptr );
    8788#endif
    8889        // get pointer on calling thread
     
    108109#if DEBUG_QUEUELOCK
    109110if( DEBUG_QUEUELOCK < (uint32_t)hal_get_cycles() )
    110 {
    111     uint32_t   type = hal_remote_l32( XPTR( lock_cxy , &locr_ptr->lock.type ) );
    112     printk("\n[DBG] %s : thread %x in process %x ACQUIRE q_lock %s [%x,%x]\n",
    113     __FUNCTION__, this->trdid, this->process->pid,
    114     lock_type_str[type], lock_cxy, lock_ptr );
    115 }
     111printk("\n[%s] thread[%x,%x] ACQUIRE q_lock %s [%x,%x]\n",
     112__FUNCTION__, this->process->pid, this->trdid,
     113lock_type_str[lock_type], lock_cxy, lock_ptr );
    116114#endif
    117115
     
    141139
    142140#if DEBUG_QUEUELOCK
     141thread_t * this      = CURRENT_THREAD;
     142uint32_t   lock_type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) );
    143143if( DEBUG_QUEUELOCK < (uint32_t)hal_get_cycles() )
    144 {
    145     thread_t * this = CURRENT_THREAD;
    146     uint32_t   type = hal_remote_l32( XPTR( lock_cxy , &locr_ptr->lock.type ) );
    147     printk("\n[DBG] %s : thread %x in process %x RELEASE q_lock %s (%x,%x)\n",
    148     __FUNCTION__, this->trdid, this->process->pid,
    149     lock_type_str[type], lock_cxy, lock_ptr );
    150 }
     144printk("\n[%s] thread[%x,%x] RELEASE q_lock %s (%x,%x)\n",
     145__FUNCTION__, this->process->pid, this->trdid,
     146lock_type_str[lock_type], lock_cxy, lock_ptr );
    151147#endif
    152148
     
    166162if( DEBUG_QUEUELOCK < (uint32_t)hal_get_cycles() )
    167163{
    168     thread_t  * this    = CURRENT_THREAD;
    169     uint32_t    type    = hal_remote_l32( XPTR( lock_cxy , &locr_ptr->lock.type ) );
    170164    trdid_t     trdid   = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) );
    171165    process_t * process = hal_remote_lpt( XPTR( thread_cxy , &thread_ptr->process ) );
    172166    pid_t       pid     = hal_remote_l32( XPTR( thread_cxy , &process->pid ) );
    173     printk("\n[DBG] %s : thread %x in process %x UNBLOCK thread %x in process %d"
    174     " / q_lock %s [%x,%x]\n",
    175     __FUNCTION__, this->trdid, this->process->pid, trdid, pid,
    176     lock_type_str[type], lock_cxy, lock_ptr );
     167    printk("\n[%s] thread[%x,%x] UNBLOCK thread[%x,%x] / q_lock %s [%x,%x]\n",
     168    __FUNCTION__, this->process->pid, this->trdid, trdid, pid,
     169    lock_type_str[lock_type], lock_cxy, lock_ptr );
    177170}
    178171#endif
Note: See TracChangeset for help on using the changeset viewer.