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

Cosmetic: improve debug.

File:
1 edited

Legend:

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

    r563 r600  
    6868#if DEBUG_RWLOCK
    6969if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles() )
    70 {
    71     printk("\n[DBG] %s : thread %x in process %x READ BLOCK on rwlock %s [%x,%x]\n",
    72     __FUNCTION__, this->trdid, this->process->pid,
    73     lock_type_str[lock->lock.type], local_cxy, lock );
    74 }
    75 #endif
    76         // get pointer on calling thread
    77         thread_t * this = CURRENT_THREAD;
    78 
     70printk("\n[%s] thread[%x,%x] READ BLOCK on rwlock %s [%x,%x]\n",
     71__FUNCTION__, this->process->pid, this->trdid,
     72lock_type_str[lock->lock.type], local_cxy, lock );
     73#endif
    7974        // register reader thread in waiting queue
    8075        list_add_last( &lock->rd_root , &this->wait_list );
     
    9590#if DEBUG_RWLOCK
    9691if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles() )
    97 {
    98     printk("\n[DBG] %s : thread %x in process READ ACQUIRE on rwlock %s [%x,%x]\n",
    99     __FUNCTION__, this->trdid, this->process->pid,
    100     lock_type_str[lock->lock.type], local_cxy, lock );
    101 }
     92printk("\n[%s] thread[%x,%x] READ ACQUIRE rwlock %s [%x,%x]\n",
     93__FUNCTION__, this->process->pid, this->trdid,
     94lock_type_str[lock->lock.type], local_cxy, lock );
    10295#endif
    10396
     
    127120#if DEBUG_RWLOCK
    128121if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles() )
    129 {
    130     printk("\n[DBG] %s : thread %x in process WRITE BLOCK on rwlock %s [%x,%x]\n",
    131     __FUNCTION__, this->trdid, this->process->pid,
    132     lock_type_str[lock->lock.type], local_cxy, lock );
    133 }
    134 #endif
    135         // get pointer on calling thread
    136         thread_t * this = CURRENT_THREAD;
    137 
     122printk("\n[%s] thread[%x,%x] WRITE BLOCK on rwlock %s [%x,%x]\n",
     123__FUNCTION__, this->process->pid, this->trdid,
     124lock_type_str[lock->lock.type], local_cxy, lock );
     125#endif
    138126        // register writer in waiting queue
    139127        list_add_last( &lock->wr_root , &this->wait_list );
     
    154142#if DEBUG_RWLOCK
    155143if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles() )
    156 {
    157     printk("\n[DBG] %s : thread %x in process WRITE ACQUIRE on rwlock %s [%x,%x]\n",
    158     __FUNCTION__, this->trdid, this->process->pid,
    159     lock_type_str[lock->lock.type], local_cxy, lock );
    160 }
     144printk("\n[%s] thread[%x,%x] WRITE ACQUIRE rwlock %s [%x,%x]\n",
     145__FUNCTION__, this->process->pid, this->trdid,
     146lock_type_str[lock->lock.type], local_cxy, lock );
    161147#endif
    162148
     
    179165
    180166#if DEBUG_RWLOCK
    181 if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles() )
    182 {
    183     thread_t * this = CURRENT_THREAD;
    184     printk("\n[DBG] %s : thread %x in process READ RELEASE on rwlock %s [%x,%x]\n",
    185     __FUNCTION__, this->trdid, this->process->pid,
    186     lock_type_str[lock->lock.type], local_cxy, lock );
    187 }
     167thread_t * this = CURRENT_THREAD;
     168if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles() )
     169printk("\n[%s] thread[%x,%x] READ RELEASE rwlock %s [%x,%x]\n",
     170__FUNCTION__, this->process->pid, this->trdid,
     171lock_type_str[lock->lock.type], local_cxy, lock );
    188172#endif
    189173
     
    200184#if DEBUG_RWLOCK
    201185if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles() )
    202 {
    203     thread_t * this = CURRENT_THREAD;
    204     printk("\n[DBG] %s : thread %x in process %x UNBLOCK thread %x in process %d"
    205     " / rwlock %s [%x,%x]\n",
    206     __FUNCTION__, this->trdid, this->process->pid, thread->trdid, thread->process->pid,
    207     lock_type_str[lock->lock.type], local_cxy, lock );
    208 }
     186printk("\n[%s] thread[%x,%x] UNBLOCK thread[%x,%x] / rwlock %s [%x,%x]\n",
     187__FUNCTION__, this->process->pid, this->trdid, thread->process->pid, thread->trdid,
     188lock_type_str[lock->lock.type], local_cxy, lock );
    209189#endif
    210190
     
    226206#if DEBUG_RWLOCK
    227207if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles() )
    228 {
    229     thread_t * this = CURRENT_THREAD;
    230     printk("\n[DBG] %s : thread %x in process %x UNBLOCK thread %x in process %d"
    231     " / rwlock %s [%x,%x]\n",
    232     __FUNCTION__, this->trdid, this->process->pid, thread->trdid, thread->process->pid,
    233     lock_type_str[lock->lock.type], local_cxy, lock );
    234 }
     208printk("\n[%s] thread[%x,%x] UNBLOCK thread[%x,%x] / rwlock %s [%x,%x]\n",
     209__FUNCTION__, this->process->pid, this->trdid, thread->process->pid, thread->trdid,
     210lock_type_str[lock->lock.type], local_cxy, lock );
    235211#endif
    236212   
     
    258234
    259235#if DEBUG_RWLOCK
    260 if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles() )
    261 {
    262     thread_t * this = CURRENT_THREAD;
    263     printk("\n[DBG] %s : thread %x in process WRITE RELEASE on rwlock %s [%x,%x]\n",
    264     __FUNCTION__, this->trdid, this->process->pid,
    265     lock_type_str[lock->lock.type], local_cxy, lock );
    266 }
     236thread_t * this = CURRENT_THREAD;
     237if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles() )
     238printk("\n[%s] thread[%x,%x] WRITE RELEASE rwlock %s [%x,%x]\n",
     239__FUNCTION__, this->process->pid, this->trdid,
     240lock_type_str[lock->lock.type], local_cxy, lock );
    267241#endif
    268242
     
    278252#if DEBUG_RWLOCK
    279253if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles() )
    280 {
    281     thread_t * this = CURRENT_THREAD;
    282     printk("\n[DBG] %s : thread %x in process %x UNBLOCK thread %x in process %d"
    283     " / rwlock %s [%x,%x]\n",
    284     __FUNCTION__, this->trdid, this->process->pid, thread->trdid, thread->process->pid,
    285     lock_type_str[lock->lock.type], local_cxy, lock );
    286 }
     254printk("\n[%s] thread[%x,%x] UNBLOCK thread[%x,%x] / rwlock %s [%x,%x]\n",
     255__FUNCTION__, this->process->pid, this->trdid, thread->process->pid, thread->trdid,
     256lock_type_str[lock->lock.type], local_cxy, lock );
    287257#endif
    288258        // remove this waiting thread from waiting list
     
    303273#if DEBUG_RWLOCK
    304274if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles() )
    305 {
    306     thread_t * this = CURRENT_THREAD;
    307     printk("\n[DBG] %s : thread %x in process %x UNBLOCK thread %x in process %d"
    308     " / rwlock %s [%x,%x]\n",
    309     __FUNCTION__, this->trdid, this->process->pid, thread->trdid, thread->process->pid,
    310     lock_type_str[lock->lock.type], local_cxy, lock );
    311 }
     275printk("\n[%s] thread[%x,%x] UNBLOCK thread[%x,%x] / rwlock %s [%x,%x]\n",
     276__FUNCTION__, this->process->pid, this->trdid, thread->process->pid, thread->trdid,
     277lock_type_str[lock->lock.type], local_cxy, lock );
    312278#endif
    313279            // remove this waiting thread from waiting list
Note: See TracChangeset for help on using the changeset viewer.