Changeset 600


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

Cosmetic: improve debug.

Location:
trunk/kernel/libk
Files:
6 edited

Legend:

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

    r580 r600  
    9595
    9696    // display message on kernel TXT0
    97     printk("\n### thread [%x,%x] ACQUIRE lock %s\n",
    98     thread_cxy, thread_ptr, lock_type_str[lock->type] );
     97    printk("\n[%s] thread[%x,%x] ACQUIRE lock %s\n",
     98    __FUNCTION__, this->process->pid, this->trdid, lock_type_str[lock->type] );
    9999}
    100100#endif
     
    137137
    138138    // display message on kernel TXT0
    139     printk("\n### thread [%x,%x] RELEASE lock %s\n",
    140     thread_cxy, thread_ptr, lock_type_str[lock->type] );
     139    printk("\n[%s] thread[%x,%x] RELEASE lock %s\n",
     140    __FUNCTION__, this->process->pid, this->trdid, lock_type_str[lock->type] );
    141141}
    142142#endif
  • trunk/kernel/libk/queuelock.c

    r563 r600  
    6363#if DEBUG_QUEUELOCK
    6464if( DEBUG_QUEUELOCK < (uint32_t)hal_get_cycles() )
    65 {
    66     printk("\n[DBG] %s : thread %x in process %x BLOCK on q_lock %s [%x,%x]\n",
    67     __FUNCTION__, this->trdid, this->process->pid,
    68     lock_type_str[lock->lock.type], local_cxy, lock );
    69 }
     65printk("\n[%s ] thread[%x,%x] BLOCK on q_lock %s [%x,%x]\n",
     66__FUNCTION__, this->process->pid, this->trdid, lock_type_str[lock->lock.type], local_cxy, lock );
    7067#endif
    7168        // get pointer on calling thread
     
    9087#if DEBUG_QUEUELOCK
    9188if( DEBUG_QUEUELOCK < (uint32_t)hal_get_cycles() )
    92 {
    93     printk("\n[DBG] %s : thread %x in process %x ACQUIRE q_lock %s [%x,%x]\n",
    94     __FUNCTION__, this->trdid, this->process->pid,
    95     lock_type_str[lock->lock.type], local_cxy, lock );
    96 }
     89printk("\n[%s] thread[%x,%x] ACQUIRE q_lock %s [%x,%x]\n",
     90__FUNCTION__, this->process->pid, this->trdid, lock_type_str[lock->lock.type], local_cxy, lock );
    9791#endif
    9892
     
    115109
    116110#if DEBUG_QUEUELOCK
     111thread_t * this = CURRENT_THREAD;
    117112if( DEBUG_QUEUELOCK < (uint32_t)hal_get_cycles() )
    118 {
    119     thread_t * this = CURRENT_THREAD;
    120     printk("\n[DBG] %s : thread %x in %x process RELEASE q_lock %s [%x,%x]\n",
    121     __FUNCTION__, this->trdid, this->process->pid,
    122     lock_type_str[lock->lock.type], local_cxy, lock );
    123 }
     113printk("\n[%s] thread[%x,%x] RELEASE q_lock %s [%x,%x]\n",
     114__FUNCTION__, this->process->pid, this->trdid, lock_type_str[lock->lock.type], local_cxy, lock );
    124115#endif
    125116
     
    135126#if DEBUG_QUEUELOCK
    136127if( DEBUG_QUEUELOCK < (uint32_t)hal_get_cycles() )
    137 {
    138     thread_t * this = CURRENT_THREAD;
    139     printk("\n[DBG] %s : thread %x in process %x UNBLOCK thread %x in process %x"
    140     " / q_lock %s [%x,%x]\n",
    141     __FUNCTION__, this->trdid, this->process->pid, thread->trdid, thread->process->pid,
    142     lock_type_str[lock->lock.type], local_cxy, lock );
    143 }
     128printk("\n[%s] thread[%x,%x] UNBLOCK thread [%x,%x] / q_lock %s [%x,%x]\n",
     129__FUNCTION__, this->process->pid, this->trdid, thread->process->pid, thread->trdid,
     130lock_type_str[lock->lock.type], local_cxy, lock );
    144131#endif
    145132        // remove this waiting thread from waiting list
  • trunk/kernel/libk/remote_busylock.c

    r580 r600  
    106106
    107107    // display message on kernel TXT0
    108     printk("\n### thread [%x,%x] ACQUIRE lock %s\n",
    109     thread_cxy, thread_ptr, lock_type_str[type] );
     108    printk("\n[%s] thread[%x,%x] ACQUIRE lock %s\n",
     109    __FUNCTION_, this->process->pid, this->trdid, lock_type_str[type] );
    110110}
    111111#endif
     
    154154
    155155    // display message on kernel TXT0
    156     printk("\n### thread [%x,%x] RELEASE lock %s\n",
    157     thread_cxy, thread_ptr, lock_type_str[type] );
     156    printk("\n[%s] thread[%x,%x] RELEASE lock %s\n",
     157    __FUNCTION__, this->process->pid, this->trdid, lock_type_str[type] );
    158158}
    159159#endif
  • 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
  • trunk/kernel/libk/remote_rwlock.c

    r563 r600  
    11/*
    2  * remote_rwlock.c - kernel remote rwlock implementation.
     2 * remote_rwlock.c - kernel remote read/write lock implementation.
    33 *
    44 * Authors    Alain   Greiner (2016,2017,2018)
     
    6666    cxy_t             lock_cxy = GET_CXY( lock_xp );
    6767
     68#if DEBUG_RWLOCK
     69uint32_t lock_type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) );
     70#endif
     71
    6872    // build useful extended pointers
    6973    xptr_t busylock_xp = XPTR( lock_cxy , &lock_ptr->lock );
     
    8185#if DEBUG_RWLOCK
    8286if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles() )
    83 {
    84     uint32_t   type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) );
    85     printk("\n[DBG] %s : thread %x (%s) READ BLOCK on rwlock %s [%x,%x] / cycle %d\n",
    86     __FUNCTION__, this->trdid, thread_type_str(this->type),
    87     lock_type_str[type], lock_cxy, lock_ptr, (uint32_t)hal_get_cycles() );
    88 }
     87printk("\n[%s] thread[%x,%x] READ BLOCK on rwlock %s [%x,%x]\n",
     88__FUNCTION__, this->process->pid, this->trdid,
     89lock_type_str[lock_type], lock_cxy, lock_ptr );
    8990#endif
    9091        // get pointer on calling thread
     
    109110#if DEBUG_RWLOCK
    110111if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles() )
    111 {
    112     uint32_t   type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) );
    113     printk("\n[DBG] %s : thread %x (%s) READ ACQUIRE on rwlock %s [%x,%x] / cycle %d\n",
    114     __FUNCTION__, this->trdid, thread_type_str(this->type),
    115     lock_type_str[type], lock_cxy, lock_ptr, (uint32_t)hal_get_cycles() );
    116 }
     112printk("\n[%s] thread[%x,%x] READ ACQUIRE rwlock %s [%x,%x]\n",
     113__FUNCTION__, this->process->pid, this->trdid,
     114lock_type_str[lock_type], lock_cxy, lock_ptr );
    117115#endif
    118116
     
    136134    remote_rwlock_t * lock_ptr = GET_PTR( lock_xp );
    137135    cxy_t             lock_cxy = GET_CXY( lock_xp );
     136
     137#if DEBUG_RWLOCK
     138uint32_t lock_type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) );
     139#endif
    138140
    139141    // build useful extended pointers
     
    152154#if DEBUG_RWLOCK
    153155if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles() )
    154 {
    155     uint32_t   type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) );
    156     printk("\n[DBG] %s : thread %x (%s) WRITE BLOCK on rwlock %s [%x,%x] / cycle %d\n",
    157     __FUNCTION__, this->trdid, thread_type_str(this->type),
    158     lock_type_str[type], lock_cxy, lock_ptr, (uint32_t)hal_get_cycles() );
    159 }
     156printk("\n[%s] thread[%x,%x] WRITE BLOCK on rwlock %s [%x,%x]\n",
     157__FUNCTION__, this->process->pid, this->trdid,
     158lock_type_str[lock_type], lock_cxy, lock_ptr );
    160159#endif
    161160        // get local pointer on calling thread
     
    180179#if DEBUG_RWLOCK
    181180if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles() )
    182 {
    183     uint32_t   type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) );
    184     printk("\n[DBG] %s : thread %x (%s) WRITE ACQUIRE on rwlock %s [%x,%x] / cycle %d\n",
    185     __FUNCTION__, this->trdid, thread_type_str(this->type),
    186     lock_type_str[type], lock_cxy, lock_ptr, (uint32_t)hal_get_cycles() );
    187 }
     181printk("\n[%s] thread[%x,%x] WRITE ACQUIRE rwlock %s [%x,%x]\n",
     182__FUNCTION__, this->process->pid, this->trdid,
     183lock_type_str[lock_type], lock_cxy, lock_ptr );
    188184#endif
    189185
     
    217213
    218214#if DEBUG_RWLOCK
    219 if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles() )
    220 {
    221     thread_t * this = CURRENT_THREAD;
    222     uint32_t   type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) );
    223     printk("\n[DBG] %s : thread %x (%s) READ RELEASE on rwlock %s [%x,%x] / cycle %d\n",
    224     __FUNCTION__, this->trdid, thread_type_str(this->type),
    225     lock_type_str[type], lock_cxy, lock_ptr, (uint32_t)hal_get_cycles() );
    226 }
     215thread_t * this      = CURRENT_THREAD;
     216uint32_t   lock_type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) );
     217if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles() )
     218printk("\n[%s] thread[%x,%x] READ RELEASE rwlock %s [%x,%x]\n",
     219__FUNCTION__, this->process->pid, this->trdid,
     220lock_type_str[lock_type], lock_cxy, lock_ptr );
    227221#endif
    228222
     
    248242if( (uint32_t)hal_get_cycles() > DEBUG_RWLOCK )
    249243{
    250     thread_t  * this        = CURRENT_THREAD;
    251     uint32_t    lock_type   = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) );
    252     trdid_t     trdid       = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) );
    253     uint32_t    thread_type = hal_remote_lpt( XPTR( thread_cxy , &thread_ptr->type ) );
    254     printk("\n[DBG] %s : thread %x (%s) UNBLOCK thread %x (%s)"
    255     " / rwlock %s [%x,%x] / cycle %d\n",
    256     __FUNCTION__, this->trdid, thread_type_str(this->type), trdid, thread_type_str(thread_type),
    257     lock_type_str[lock_type], lock_cxy, lock_ptr, (uint32_t)hal_get_cycles() );
     244    trdid_t     trdid     = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) );
     245    process_t * process   = hal_remote_lpt( XPTR( thread_cxy , &thread_ptr->process ) );
     246    uint32_t    pid       = hal_remote_l32( XPTR( thread_cxy , &process->pid ) );
     247    printk("\n[%s] thread[%x,%x] UNBLOCK thread[%x,%x] / rwlock %s [%x,%x]\n",
     248    __FUNCTION__, this->process->pid, this->trdid, pid, trdid,
     249    lock_type_str[lock_type], lock_cxy, lock_ptr );
    258250}
    259251#endif
     
    281273if( (uint32_t)hal_get_cycles() > DEBUG_RWLOCK )
    282274{
    283     thread_t  * this        = CURRENT_THREAD;
    284     uint32_t    lock_type   = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) );
    285     trdid_t     trdid       = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) );
    286     uint32_t    thread_type = hal_remote_lpt( XPTR( thread_cxy , &thread_ptr->type ) );
    287     printk("\n[DBG] %s : thread %x (%s) UNBLOCK thread %x (%s)"
    288     " / rwlock %s [%x,%x] / cycle %d\n",
    289     __FUNCTION__, this->trdid, thread_type_str(this->type), trdid, thread_type_str(thread_type),
    290     lock_type_str[lock_type], lock_cxy, lock_ptr, (uint32_t)hal_get_cycles() );
     275    trdid_t     trdid     = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) );
     276    process_t * process   = hal_remote_lpt( XPTR( thread_cxy , &thread_ptr->process ) );
     277    uint32_t    pid       = hal_remote_l32( XPTR( thread_cxy , &process->pid ) );
     278    printk("\n[%s] thread[%x,%x] UNBLOCK thread[%x,%x] / rwlock %s [%x,%x]\n",
     279    __FUNCTION__, this->process->pid, this->trdid, pid, trdid,
     280    lock_type_str[lock_type], lock_cxy, lock_ptr );
    291281}
    292282#endif
     
    320310
    321311#if DEBUG_RWLOCK
    322 if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles() )
    323 {
    324     thread_t * this = CURRENT_THREAD;
    325     uint32_t   type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) );
    326     printk("\n[DBG] %s : thread %x (%s) WRITE RELEASE on rwlock %s [%x,%x] / cycle %d\n",
    327     __FUNCTION__, this->trdid, thread_type_str(this->type),
    328     lock_type_str[type], lock_cxy, lock_ptr, (uint32_t)hal_get_cycles() );
    329 }
     312thread_t * this      = CURRENT_THREAD;
     313uint32_t   lock_type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) );
     314if( DEBUG_RWLOCK < (uint32_t)hal_get_cycles() )
     315printk("\n[%s] thread[%x,%x] WRITE RELEASE rwlock %s [%x,%x]\n",
     316__FUNCTION__, this->process->pid, this->trdid,
     317lock_type_str[lock_type], lock_cxy, lock_ptr );
    330318#endif
    331319
     
    350338if( (uint32_t)hal_get_cycles() > DEBUG_RWLOCK )
    351339{
    352     thread_t  * this        = CURRENT_THREAD;
    353     uint32_t    lock_type   = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) );
    354     trdid_t     trdid       = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) );
    355     uint32_t    thread_type = hal_remote_lpt( XPTR( thread_cxy , &thread_ptr->type ) );
    356     printk("\n[DBG] %s : thread %x (%s) UNBLOCK thread %x (%s)"
    357     " / rwlock %s [%x,%x] / cycle %d\n",
    358     __FUNCTION__, this->trdid, thread_type_str(this->type), trdid, thread_type_str(thread_type),
    359     lock_type_str[lock_type], lock_cxy, lock_ptr, (uint32_t)hal_get_cycles() );
     340    trdid_t     trdid     = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) );
     341    process_t * process   = hal_remote_lpt( XPTR( thread_cxy , &thread_ptr->process ) );
     342    uint32_t    pid       = hal_remote_l32( XPTR( thread_cxy , &process->pid ) );
     343    printk("\n[%s] thread[%x,%x] UNBLOCK thread[%x,%x] / rwlock %s [%x,%x]\n",
     344    __FUNCTION__, this->process->pid, this->trdid, pid, trdid,
     345    lock_type_str[lock_type], lock_cxy, lock_ptr );
    360346}
    361347#endif
     
    382368if( (uint32_t)hal_get_cycles() > DEBUG_RWLOCK )
    383369{
    384     thread_t  * this        = CURRENT_THREAD;
    385     uint32_t    lock_type   = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) );
    386     trdid_t     trdid       = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) );
    387     uint32_t    thread_type = hal_remote_lpt( XPTR( thread_cxy , &thread_ptr->type ) );
    388     printk("\n[DBG] %s : thread %x (%s) UNBLOCK thread %x (%s)"
    389     " / rwlock %s [%x,%x] / cycle %d\n",
    390     __FUNCTION__, this->trdid, thread_type_str(this->type), trdid, thread_type_str(thread_type),
    391     lock_type_str[lock_type], lock_cxy, lock_ptr, (uint32_t)hal_get_cycles() );
     370    trdid_t     trdid     = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) );
     371    process_t * process   = hal_remote_lpt( XPTR( thread_cxy , &thread_ptr->process ) );
     372    uint32_t    pid       = hal_remote_l32( XPTR( thread_cxy , &process->pid ) );
     373    printk("\n[%s] thread[%x,%x] UNBLOCK thread[%x,%x] / rwlock %s [%x,%x]\n",
     374    __FUNCTION__, this->process->pid, this->trdid, pid, trdid,
     375    lock_type_str[lock_type], lock_cxy, lock_ptr );
    392376}
    393377#endif
  • 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.