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

Cosmetic: improve debug.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/kern/chdev.c

    r583 r593  
    174174uint32_t rx_cycle = (uint32_t)hal_get_cycles();
    175175if( (is_rx) && (DEBUG_CHDEV_CMD_RX < rx_cycle) )
    176 printk("\n[DBG] %s : client_thread %x (%s) enter for RX / server = %x / cycle %d\n",
    177 __FUNCTION__, this, thread_type_str(this->type) , server_ptr, rx_cycle );
     176printk("\n[%s] client[%x,%x] enter for RX / server[%x,%x] / cycle %d\n",
     177__FUNCTION__, this->process->pid, this->trdid, server_ptr->process->pid, server_ptr->trdid, rx_cycle );
    178178#endif
    179179
     
    181181uint32_t tx_cycle = (uint32_t)hal_get_cycles();
    182182if( (is_rx == 0) && (DEBUG_CHDEV_CMD_TX < tx_cycle) )
    183 printk("\n[DBG] %s : client_thread %x (%s) enter for TX / server = %x / cycle %d\n",
    184 __FUNCTION__, this, thread_type_str(this->type) , server_ptr, tx_cycle );
     183printk("\n[%s] client[%x,%x] enter for TX / server[%x,%x] / cycle %d\n",
     184__FUNCTION__, this->process->pid, this->trdid, server_ptr->process->pid, server_ptr->trdid, tx_cycle );
    185185#endif
    186186
     
    222222#if (DEBUG_CHDEV_CMD_TX & 1)
    223223if( (is_rx == 0) && (DEBUG_CHDEV_CMD_TX < tx_cycle) )
    224 printk("\n[DBG] in %s : client thread %x blocked\n", __FUNCTION__, this );
     224printk("\n[%s] client thread[%x,%x] blocked\n",
     225__FUNCTION__, this->process_pid, this->trdid );
    225226#endif
    226227
    227228#if (DEBUG_CHDEV_CMD_RX & 1)
    228229if( (is_rx) && (DEBUG_CHDEV_CMD_RX < rx_cycle) )
    229 printk("\n[DBG] in %s : client thread %x blocked\n", __FUNCTION__, this );
     230printk("\n[%s] client thread[%x,%x] blocked\n",
     231__FUNCTION__, this->process_pid, this->trdid );
    230232#endif
    231233
     
    236238#if (DEBUG_CHDEV_CMD_TX & 1)
    237239if( (is_rx == 0) && (DEBUG_CHDEV_CMD_TX < tx_cycle) )
    238 printk("\n[DBG] in %s : TX server thread %x unblocked\n", __FUNCTION__, server_ptr );
     240printk("\n[%s] TX server thread[%x,%x] unblocked\n",
     241__FUNCTION__, server_ptr->process->pid, server_ptr->trdid );
    239242#endif
    240243
    241244#if (DEBUG_CHDEV_CMD_RX & 1)
    242245if( (is_rx) && (DEBUG_CHDEV_CMD_RX < rx_cycle) )
    243 printk("\n[DBG] in %s : RX server thread %x unblocked\n", __FUNCTION__, server_ptr );
     246printk("\n[%s] RX server thread[%x,%x] unblocked\n",
     247__FUNCTION__, server_ptr->process->pid, server_ptr->trdid );
    244248#endif
    245249
     
    249253#if (DEBUG_CHDEV_CMD_TX & 1)
    250254if( (is_rx == 0)  && (DEBUG_CHDEV_CMD_TX < tx_cycle) )
    251 printk("\n[DBG] in %s : thread %x registered write request in chdev\n", __FUNCTION__, this );
     255printk("\n[%s] client thread[%x,%x] registered write request in chdev\n",
     256__FUNCTION__, this->process->pid, this->trdid );
    252257#endif
    253258 
    254259#if (DEBUG_CHDEV_CMD_RX & 1)
    255260if( (is_rx)  && (DEBUG_CHDEV_CMD_RX < rx_cycle) )
    256 printk("\n[DBG] in %s : thread %x registered read request in chdev\n", __FUNCTION__, this );
     261printk("\n[%s] client thread[%x,%x] registered read request in chdev\n",
     262__FUNCTION__, this->process->pid, this->trdid );
    257263#endif
    258264 
     
    264270#if (DEBUG_CHDEV_CMD_TX & 1)
    265271if( (is_rx == 0)  && (DEBUG_CHDEV_CMD_TX < tx_cycle) )
    266 printk("\n[DBG] in %s : client thread %x sent IPI to TX server thread %x\n",
    267 __FUNCTION__, this, server_ptr );
     272printk("\n[%s] client thread[%x,%x] sent IPI to TX server thread[%x,%x]\n",
     273__FUNCTION__, this->process->pid, this->trdid, server_ptr->process->pid, server_ptr->trdid );
    268274#endif
    269275
    270276#if (DEBUG_CHDEV_CMD_RX & 1)
    271277if( (is_rx)  && (DEBUG_CHDEV_CMD_RX < rx_cycle) )
    272 printk("\n[DBG] in %s : client thread %x sent IPI to RX server thread %x\n",
    273 __FUNCTION__, this, server_ptr );
     278printk("\n[%s] client thread[%x,%x] sent IPI to RX server thread[%x,%x]\n",
     279__FUNCTION__, this->process->pid, this->trdid, server_ptr->process->pid, server_ptr->trdid );
    274280#endif
    275281
     
    288294rx_cycle = (uint32_t)hal_get_cycles();
    289295if( (is_rx) && (DEBUG_CHDEV_CMD_RX < rx_cycle) )
    290 printk("\n[DBG] %s : client_thread %x (%s) exit for RX / cycle %d\n",
    291 __FUNCTION__, this, thread_type_str(this->type) , rx_cycle );
     296printk("\n[%s] client_thread[%x,%x] exit for RX / cycle %d\n",
     297__FUNCTION__, this->process->pid, this->trdid, rx_cycle );
    292298#endif
    293299
     
    295301tx_cycle = (uint32_t)hal_get_cycles();
    296302if( (is_rx == 0) && (DEBUG_CHDEV_CMD_TX < tx_cycle) )
    297 printk("\n[DBG] %s : client_thread %x (%s) exit for TX / cycle %d\n",
    298 __FUNCTION__, this, thread_type_str(this->type) , tx_cycle );
     303printk("\n[%s] client_thread[%x,%x] exit for TX / cycle %d\n",
     304__FUNCTION__, this->process->pid, this->trdid, tx_cycle );
    299305#endif
    300306
     
    335341uint32_t rx_cycle = (uint32_t)hal_get_cycles();
    336342if( (chdev->is_rx) && (DEBUG_CHDEV_SERVER_RX < rx_cycle) )
    337 printk("\n[DBG] %s : dev_thread %x start RX / cycle %d\n",
    338 __FUNCTION__ , server->trdid , rx_cycle );
     343printk("\n[%s] dev_thread[%x,%x] start RX / cycle %d\n",
     344__FUNCTION__ , server->process->pid, server->trdid, rx_cycle );
    339345#endif
    340346
     
    342348uint32_t tx_cycle = (uint32_t)hal_get_cycles();
    343349if( (chdev->is_rx == 0) && (DEBUG_CHDEV_SERVER_TX < tx_cycle) )
    344 printk("\n[DBG] %s : dev_thread %x start TX / cycle %d\n",
    345 __FUNCTION__ , server->trdid , tx_cycle );
     350printk("\n[%s] dev_thread[%x,%x] start TX / cycle %d\n",
     351__FUNCTION__ , server->process->pid, server->trdid, tx_cycle );
    346352#endif
    347353
     
    356362rx_cycle = (uint32_t)hal_get_cycles();
    357363if( (chdev->is_rx) && (DEBUG_CHDEV_SERVER_RX < rx_cycle) )
    358 printk("\n[DBG] %s : dev_thread %x found RX queue empty => blocks / cycle %d\n",
    359 __FUNCTION__ , server->trdid , rx_cycle );
     364printk("\n[%s] dev_thread[%x,%x] found RX queue empty => blocks / cycle %d\n",
     365__FUNCTION__ , server->process->pid, server->trdid, rx_cycle );
    360366#endif
    361367
     
    363369tx_cycle = (uint32_t)hal_get_cycles();
    364370if( (chdev->is_rx == 0) && (DEBUG_CHDEV_SERVER_TX < tx_cycle) )
    365 printk("\n[DBG] %s : dev_thread %x found TX queue empty => blocks / cycle %d\n",
    366 __FUNCTION__ , server->trdid , tx_cycle );
     371printk("\n[%s] dev_thread[%x,%x] found TX queue empty => blocks / cycle %d\n",
     372__FUNCTION__ , server->process->pid, server->trdid, tx_cycle );
    367373#endif
    368374
     
    398404rx_cycle = (uint32_t)hal_get_cycles();
    399405if( (chdev->is_rx) && (DEBUG_CHDEV_SERVER_RX < rx_cycle) )
    400 printk("\n[DBG] %s : dev_thread %x for RX found client thread %x in process %x / cycle %d\n",
    401 __FUNCTION__, server->trdid ,client_ptr->trdid ,client_ptr->process->pid, rx_cycle );
     406printk("\n[%s] dev_thread[%x,%x] for RX get client thread[%x,%x] / cycle %d\n",
     407__FUNCTION__, server->process->pid, server->trdid,
     408client_ptr->process->pid, client_ptr->trdid, rx_cycle );
    402409#endif
    403410
     
    405412tx_cycle = (uint32_t)hal_get_cycles();
    406413if( (chdev->is_rx == 0) && (DEBUG_CHDEV_SERVER_TX < tx_cycle) )
    407 printk("\n[DBG] %s : dev_thread %x for TX found client thread %x in process %x / cycle %d\n",
    408 __FUNCTION__, server->trdid ,client_ptr->trdid ,client_ptr->process->pid, tx_cycle );
     414printk("\n[%s] dev_thread[%x,%x] for TX get client thread[%x,%x] / cycle %d\n",
     415__FUNCTION__, server->process->pid, server->trdid,
     416client_ptr->process->pid, client_ptr->trdid, tx_cycle );
    409417#endif
    410418
     
    426434rx_cycle = (uint32_t)hal_get_cycles();
    427435if( (chdev->is_rx) && (DEBUG_CHDEV_SERVER_RX < rx_cycle) )
    428 printk("\n[DBG] %s : dev_thread %x completes RX for client %x in process %x / cycle %d\n",
    429 __FUNCTION__, server->trdid, client_ptr->trdid, client_ptr->process->pid, rx_cycle );
     436printk("\n[%s] dev_thread[%x,%x] completes RX for client thread[%x,%x] / cycle %d\n",
     437__FUNCTION__, server->process->pid, server->trdid,
     438client_ptr->process->pid, client_ptr->trdid, rx_cycle );
    430439#endif
    431440
     
    433442tx_cycle = (uint32_t)hal_get_cycles();
    434443if( (chdev->is_rx == 0) && (DEBUG_CHDEV_SERVER_TX < tx_cycle) )
    435 printk("\n[DBG] %s : dev_thread %x completes TX for client %x in process %x / cycle %d\n",
    436 __FUNCTION__, server->trdid, client_ptr->trdid, client_ptr->process->pid, tx_cycle );
     444printk("\n[%s] dev_thread[%x,%x] completes TX for client thread[%x,%x] / cycle %d\n",
     445__FUNCTION__, server->process->pid, server->trdid,
     446client_ptr->process->pid, client_ptr->trdid, tx_cycle );
    437447#endif
    438448
Note: See TracChangeset for help on using the changeset viewer.