Changeset 437 for trunk/kernel/kern


Ignore:
Timestamp:
Mar 28, 2018, 2:40:29 PM (7 years ago)
Author:
alain
Message:

Fix various bugs

Location:
trunk/kernel/kern
Files:
15 edited

Legend:

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

    r436 r437  
    140140    thread_t * this = CURRENT_THREAD;
    141141
    142 #if CONFIG_DEBUG_CHDEV_REGISTER_COMMAND
    143 uint32_t cycle = (uint32_t)hal_get_cycles();
    144 if( CONFIG_DEBUG_CHDEV_REGISTER_COMMAND < cycle )
    145 printk("\n[DBG] %s : client_thread %x (%s) enter / cycle %d\n",
    146 __FUNCTION__, this, thread_type_str(this->type) , cycle );
    147 #endif
    148 
    149142    // get device descriptor cluster and local pointer
    150143    cxy_t     chdev_cxy = GET_CXY( chdev_xp );
    151144    chdev_t * chdev_ptr = (chdev_t *)GET_PTR( chdev_xp );
     145
     146#if (CONFIG_DEBUG_CHDEV_CMD_RX || CONFIG_DEBUG_CHDEV_CMD_TX)
     147bool_t is_rx = hal_remote_lw( XPTR( chdev_cxy , &chdev_ptr->is_rx ) );
     148#endif
     149   
     150#if CONFIG_DEBUG_CHDEV_CMD_RX
     151uint32_t rx_cycle = (uint32_t)hal_get_cycles();
     152if( (is_rx) && (CONFIG_DEBUG_CHDEV_CMD_RX < rx_cycle) )
     153printk("\n[DBG] %s : client_thread %x (%s) enter for RX / cycle %d\n",
     154__FUNCTION__, this, thread_type_str(this->type) , rx_cycle );
     155#endif
     156
     157#if CONFIG_DEBUG_CHDEV_CMD_TX
     158uint32_t tx_cycle = (uint32_t)hal_get_cycles();
     159if( (is_rx == 0) && (CONFIG_DEBUG_CHDEV_CMD_TX < tx_cycle) )
     160printk("\n[DBG] %s : client_thread %x (%s) enter for TX / cycle %d\n",
     161__FUNCTION__, this, thread_type_str(this->type) , tx_cycle );
     162#endif
    152163
    153164    // build extended pointers on client thread xlist and device root
     
    196207    hal_restore_irq( save_sr );
    197208
    198 #if CONFIG_DEBUG_CHDEV_REGISTER_COMMAND
    199 cycle = (uint32_t)hal_get_cycles();
    200 if( CONFIG_DEBUG_CHDEV_REGISTER_COMMAND < cycle )
    201 printk("\n[DBG] %s : client_thread %x (%s) exit / cycle %d\n",
    202 __FUNCTION__, this, thread_type_str(this->type) , cycle );
     209#if CONFIG_DEBUG_CHDEV_CMD_RX
     210rx_cycle = (uint32_t)hal_get_cycles();
     211if( (is_rx) && (CONFIG_DEBUG_CHDEV_CMD_RX < rx_cycle) )
     212printk("\n[DBG] %s : client_thread %x (%s) exit for RX / cycle %d\n",
     213__FUNCTION__, this, thread_type_str(this->type) , rx_cycle );
     214#endif
     215
     216#if CONFIG_DEBUG_CHDEV_CMD_TX
     217tx_cycle = (uint32_t)hal_get_cycles();
     218if( (is_rx == 0) && (CONFIG_DEBUG_CHDEV_CMD_TX < tx_cycle) )
     219printk("\n[DBG] %s : client_thread %x (%s) exit for TX / cycle %d\n",
     220__FUNCTION__, this, thread_type_str(this->type) , tx_cycle );
    203221#endif
    204222
     
    225243    server = CURRENT_THREAD;
    226244
    227 #if CONFIG_DEBUG_CHDEV_SEQUENCIAL_SERVER
    228 uint32_t cycle = (uint32_t)hal_get_cycles();
    229 if( CONFIG_DEBUG_CHDEV_SEQUENCIAL_SERVER < cycle )
    230 printk("\n[DBG] %s : server_thread %x enter / chdev = %x / cycle %d\n",
    231 __FUNCTION__ , server , chdev , cycle );
    232 #endif
    233 
     245    // get root and lock on command queue
    234246    root_xp = XPTR( local_cxy , &chdev->wait_root );
    235247    lock_xp = XPTR( local_cxy , &chdev->wait_lock );
     
    253265        else                            // waiting queue not empty
    254266        {
    255 
    256 #if (CONFIG_DEBUG_SYS_READ & 1)
    257 enter_chdev_server_read = (uint32_t)hal_get_cycles();
    258 #endif
    259 
    260 #if (CONFIG_DEBUG_SYS_WRITE & 1)
    261 enter_chdev_server_write = (uint32_t)hal_get_cycles();
    262 #endif
    263 
    264267            // release lock
    265268            remote_spinlock_unlock( lock_xp );
     
    271274            client_cxy = GET_CXY( client_xp );
    272275            client_ptr = (thread_t *)GET_PTR( client_xp );
     276
     277#if CONFIG_DEBUG_CHDEV_SERVER_RX
     278uint32_t rx_cycle = (uint32_t)hal_get_cycles();
     279if( (chdev->is_rx) && (CONFIG_DEBUG_CHDEV_SERVER_RX < rx_cycle) )
     280printk("\n[DBG] %s : server_thread %x start RX / client %x / cycle %d\n",
     281__FUNCTION__ , server , client_ptr , rx_cycle );
     282#endif
     283
     284#if CONFIG_DEBUG_CHDEV_SERVER_TX
     285uint32_t tx_cycle = (uint32_t)hal_get_cycles();
     286if( (chdev->is_rx == 0) && (CONFIG_DEBUG_CHDEV_SERVER_TX < tx_cycle) )
     287printk("\n[DBG] %s : server_thread %x start TX / client %x / cycle %d\n",
     288__FUNCTION__ , server , client_ptr , tx_cycle );
     289#endif
     290
     291#if (CONFIG_DEBUG_SYS_READ & 1)
     292enter_chdev_server_read = (uint32_t)hal_get_cycles();
     293#endif
     294
     295#if (CONFIG_DEBUG_SYS_WRITE & 1)
     296enter_chdev_server_write = (uint32_t)hal_get_cycles();
     297#endif
    273298
    274299            // call driver command function to execute I/O operation
     
    283308            thread_unblock( client_xp , THREAD_BLOCKED_IO );
    284309
    285 #if CONFIG_DEBUG_CHDEV_SEQUENCIAL_SERVER
    286 cycle = (uint32_t)hal_get_cycles();
    287 if( CONFIG_DEBUG_CHDEV_SEQUENCIAL_SERVER < cycle )
    288 printk("\n[DBG] %s : server_thread %x complete operation for client %x / cycle %d\n",
    289 __FUNCTION__ , server , client_ptr , cycle );
     310#if CONFIG_DEBUG_CHDEV_SERVER_RX
     311rx_cycle = (uint32_t)hal_get_cycles();
     312if( (chdev->is_rx) && (CONFIG_DEBUG_CHDEV_SERVER_RX < rx_cycle) )
     313printk("\n[DBG] %s : server_thread %x completes RX / client %x / cycle %d\n",
     314__FUNCTION__ , server , client_ptr , rx_cycle );
     315#endif
     316
     317#if CONFIG_DEBUG_CHDEV_SERVER_TX
     318tx_cycle = (uint32_t)hal_get_cycles();
     319if( (chdev->is_rx == 0) && (CONFIG_DEBUG_CHDEV_SERVER_TX < tx_cycle) )
     320printk("\n[DBG] %s : server_thread %x completes TX / client %x / cycle %d\n",
     321__FUNCTION__ , server , client_ptr , tx_cycle );
    290322#endif
    291323
  • trunk/kernel/kern/cluster.c

    r436 r437  
    44 * Author  Ghassan Almaless (2008,2009,2010,2011,2012)
    55 *         Mohamed Lamine Karaoui (2015)
    6  *         Alain Greiner (2016,2017)
     6 *         Alain Greiner (2016,2017,2018)
    77 *
    88 * Copyright (c) UPMC Sorbonne Universites
     
    9292uint32_t cycle = (uint32_t)hal_get_cycles();
    9393if( CONFIG_DEBUG_CLUSTER_INIT < cycle )
    94 printk("\n[DBG] %s enters for cluster %x / cycle %d\n",
    95 __FUNCTION__ , local_cxy , cycle );
     94printk("\n[DBG] %s : thread %x enters for cluster %x / cycle %d\n",
     95__FUNCTION__ , CURRENT_THREAD , local_cxy , cycle );
    9696#endif
    9797
     
    113113    }
    114114
    115 #if CONFIG_DEBUG_CLUSTER_INIT
     115#if( CONFIG_DEBUG_CLUSTER_INIT & 1 )
    116116cycle = (uint32_t)hal_get_cycles();
    117117if( CONFIG_DEBUG_CLUSTER_INIT < cycle )
    118 cluster_dmsg("\n[DBG] %s : PPM initialized in cluster %x / cycle %d\n",
     118printk("\n[DBG] %s : PPM initialized in cluster %x / cycle %d\n",
    119119__FUNCTION__ , local_cxy , cycle );
    120120#endif
     
    123123        khm_init( &cluster->khm );
    124124
    125     cluster_dmsg("\n[DBG] %s : KHM initialized in cluster %x at cycle %d\n",
    126                  __FUNCTION__ , local_cxy , hal_get_cycles() );
     125#if( CONFIG_DEBUG_CLUSTER_INIT & 1 )
     126uint32_t cycle = (uint32_t)hal_get_cycles();
     127if( CONFIG_DEBUG_CLUSTER_INIT < cycle )
     128printk("\n[DBG] %s : KHM initialized in cluster %x at cycle %d\n",
     129__FUNCTION__ , local_cxy , hal_get_cycles() );
     130#endif
    127131
    128132    // initialises embedded KCM
    129133        kcm_init( &cluster->kcm , KMEM_KCM );
    130134
    131     cluster_dmsg("\n[DBG] %s : KCM initialized in cluster %x at cycle %d\n",
    132                  __FUNCTION__ , local_cxy , hal_get_cycles() );
     135#if( CONFIG_DEBUG_CLUSTER_INIT & 1 )
     136uint32_t cycle = (uint32_t)hal_get_cycles();
     137if( CONFIG_DEBUG_CLUSTER_INIT < cycle )
     138printk("\n[DBG] %s : KCM initialized in cluster %x at cycle %d\n",
     139__FUNCTION__ , local_cxy , hal_get_cycles() );
     140#endif
    133141
    134142    // initialises all cores descriptors
     
    140148        }
    141149
    142 #if CONFIG_DEBUG_CLUSTER_INIT
     150#if( CONFIG_DEBUG_CLUSTER_INIT & 1 )
    143151cycle = (uint32_t)hal_get_cycles();
    144152if( CONFIG_DEBUG_CLUSTER_INIT < cycle )
    145 cluster_dmsg("\n[DBG] %s : cores initialized in cluster %x / cycle %d\n",
     153printk("\n[DBG] %s : cores initialized in cluster %x / cycle %d\n",
    146154__FUNCTION__ , local_cxy , cycle );
    147155#endif
     
    151159    cluster->rpc_threads = 0;
    152160
    153 cluster_dmsg("\n[DBG] %s : RPC fifo inialized in cluster %x at cycle %d\n",
     161#if( CONFIG_DEBUG_CLUSTER_INIT & 1 )
     162cycle = (uint32_t)hal_get_cycles();
     163if( CONFIG_DEBUG_CLUSTER_INIT < cycle )
     164printk("\n[DBG] %s : RPC fifo inialized in cluster %x at cycle %d\n",
    154165__FUNCTION__ , local_cxy , hal_get_cycles() );
     166#endif
    155167
    156168    // initialise pref_tbl[] in process manager
     
    179191cycle = (uint32_t)hal_get_cycles();
    180192if( CONFIG_DEBUG_CLUSTER_INIT < cycle )
    181 cluster_dmsg("\n[DBG] %s Process Manager initialized in cluster %x / cycle %d\n",
    182 __FUNCTION__ , local_cxy , cycle );
     193printk("\n[DBG] %s , thread %x exit for cluster %x / cycle %d\n",
     194__FUNCTION__ , CURRENT_THREAD , local_cxy , cycle );
    183195#endif
    184196
  • trunk/kernel/kern/cluster.h

    r433 r437  
    44 * authors  Ghassan Almaless (2008,2009,2010,2011,2012)
    55 *          Mohamed Lamine Karaoui (2015)
    6  *          Alain Greiner (2016,2017)
     6 *          Alain Greiner (2016,2017,2018)
    77 *
    88 * Copyright (c) UPMC Sorbonne Universites
  • trunk/kernel/kern/do_syscall.c

    r428 r437  
    7878    sys_closedir,           // 25
    7979    sys_getcwd,             // 26
    80     sys_undefined,          // 27 
     80    sys_isatty,             // 27 
    8181    sys_alarm,              // 28
    8282    sys_rmdir,              // 29
  • trunk/kernel/kern/dqdt.c

    r406 r437  
    22 * dqdt.c - Distributed Quaternary Decision Tree implementation.
    33 *
    4  * Author : Alain Greiner (2016)
     4 * Author : Alain Greiner (2016,2017,2018)
    55 *
    66 * Copyright (c)  UPMC Sorbonne Universites
  • trunk/kernel/kern/dqdt.h

    r19 r437  
    22 * kern/dqdt.h - Distributed Quad Decision Tree
    33 *
    4  * Author : Alain Greiner (2016)
     4 * Author : Alain Greiner (2016,2017,2018)
    55 *
    66 * Copyright (c)  UPMC Sorbonne Universites
     
    4040 *
    4141 * - If both Y_SIZE and Y_SIZE are larger than 1, it makes the assumption that
    42  *   the cluster topology is a 2D mesh. The [X,Y] coordinates of a cluster are
     42 *   the clusters topology is a 2D mesh. The [X,Y] coordinates of a cluster are
    4343 *   obtained from the CXY identifier using the following rules :
    4444 *      X = CXY >> Y_WIDTH   /  Y = CXY & ((1<<Y_WIDTH)-1)
     
    9393
    9494/****************************************************************************************
    95  * This recursive function displays usage information for all DQDT nodes in the subtree
    96  * defined by the node argument. It traverses the quadtree from root to bottom.
    97  ****************************************************************************************
    98  * @ node_xp   : extended pointer on a DQDT node.
    99  ***************************************************************************************/
    100 void dqdt_global_print( xptr_t  node_xp );
    101 
    102 /****************************************************************************************
    103  * This function displays summary usage information in a given DQDT local node.
    104  ****************************************************************************************
    105  * @ node   : local pointer on a DQDT node.
    106  ***************************************************************************************/
    107 void dqdt_local_print( dqdt_node_t * node );
    108 
    109 /****************************************************************************************
    11095 * This recursive function traverses the DQDT quad-tree from bottom to root, to propagate
    11196 * the change in the threads number and allocated pages number in a leaf cluster,
     
    153138cxy_t dqdt_get_cluster_for_memory();
    154139
     140/****************************************************************************************
     141 * This recursive function displays usage information for all DQDT nodes in the subtree
     142 * defined by the node argument. It traverses the quadtree from root to bottom.
     143 ****************************************************************************************
     144 * @ node_xp   : extended pointer on a DQDT node.
     145 ***************************************************************************************/
     146void dqdt_global_print( xptr_t  node_xp );
     147
     148/****************************************************************************************
     149 * This function displays summary usage information in a given DQDT local node.
     150 ****************************************************************************************
     151 * @ node   : local pointer on a DQDT node.
     152 ***************************************************************************************/
     153void dqdt_local_print( dqdt_node_t * node );
     154
    155155
    156156#endif  /* _DQDT_H_ */
  • trunk/kernel/kern/kernel_init.c

    r436 r437  
    324324            }
    325325
    326 #if( CONFIG_KINIT_DEBUG & 0x1 )
    327 if( hal_time_stamp() > CONFIG_KINIT_DEBUG )
     326#if( CONFIG_DEBUG_KERNEL_INIT & 0x1 )
     327if( hal_time_stamp() > CONFIG_DEBUG_KERNEL_INIT )
    328328printk("\n[DBG] %s : created MMC in cluster %x / chdev = %x\n",
    329329__FUNCTION__ , local_cxy , chdev_ptr );
     
    353353                chdev_dir.dma[channel] = XPTR( local_cxy , chdev_ptr );
    354354
    355 #if( CONFIG_KINIT_DEBUG & 0x1 )
    356 if( hal_time_stamp() > CONFIG_KINIT_DEBUG )
     355#if( CONFIG_DEBUG_KERNEL_INIT & 0x1 )
     356if( hal_time_stamp() > CONFIG_DEBUG_KERNEL_INIT )
    357357printk("\n[DBG] %s : created DMA[%d] in cluster %x / chdev = %x\n",
    358358__FUNCTION__ , channel , local_cxy , chdev_ptr );
     
    488488                    }
    489489
    490 #if( CONFIG_KINIT_DEBUG & 0x1 )
    491 if( hal_time_stamp() > CONFIG_KINIT_DEBUG )
     490#if( CONFIG_DEBUG_KERNEL_INIT & 0x1 )
     491if( hal_time_stamp() > CONFIG_DEBUG_KERNEL_INIT )
    492492printk("\n[DBG] %s : create chdev %s / channel = %d / rx = %d / cluster %x / chdev = %x\n",
    493493__FUNCTION__ , chdev_func_str( func ), channel , rx , local_cxy , chdev );
     
    623623    }
    624624
    625 #if( CONFIG_KINIT_DEBUG & 0x1 )
    626 if( hal_time_stamp() > CONFIG_KINIT_DEBUG )
     625#if( CONFIG_DEBUG_KERNEL_INIT & 0x1 )
     626if( hal_time_stamp() > CONFIG_DEBUG_KERNEL_INIT )
    627627{
    628628    printk("\n[DBG] %s created PIC chdev in cluster %x at cycle %d\n",
     
    792792    thread->core = &LOCAL_CLUSTER->core_tbl[core_lid];
    793793
    794 #if CONFIG_LOCKS_DEBUG
     794    // each core initializes the idle thread lists of locks
    795795    list_root_init( &thread->locks_root );
    796796    xlist_root_init( XPTR( local_cxy , &thread->xlocks_root ) );
    797 #endif
     797    thread->local_locks = 0;
     798    thread->remote_locks = 0;
    798799
    799800    // CP0 in I/O cluster initialises TXT0 chdev descriptor
     
    804805                                        (info->x_size * info->y_size) );
    805806    barrier_wait( &local_barrier , info->cores_nr );
    806 
    807     if( (core_lid ==  0) && (local_cxy == 0) )
    808     kinit_dmsg("\n[DBG] %s : exit barrier 0 : TXT0 initialized / cycle %d\n",
    809     __FUNCTION__, hal_time_stamp() );
     807    /////////////////////////////////////////////////////////////////////////////////
     808
     809#if CONFIG_DEBUG_KERNEL_INIT
     810if( (core_lid ==  0) && (local_cxy == 0) )
     811printk("\n[DBG] %s : exit barrier 0 : TXT0 initialized / cycle %d\n",
     812__FUNCTION__, (uint32_t)hal_get_cycles() );
     813#endif
    810814
    811815    /////////////////////////////////////////////////////////////////////////////
     
    841845    /////////////////////////////////////////////////////////////////////////////////
    842846
    843     if( (core_lid ==  0) && (local_cxy == 0) )
    844     kinit_dmsg("\n[DBG] %s : exit barrier 1 : clusters initialised / cycle %d\n",
    845     __FUNCTION__, hal_time_stamp() );
     847#if CONFIG_DEBUG_KERNEL_INIT
     848if( (core_lid ==  0) && (local_cxy == 0) )
     849printk("\n[DBG] %s : exit barrier 1 : clusters initialised / cycle %d\n",
     850__FUNCTION__, (uint32_t)hal_get_cycles() );
     851#endif
    846852
    847853    /////////////////////////////////////////////////////////////////////////////////
     
    866872    ////////////////////////////////////////////////////////////////////////////////
    867873
    868     if( (core_lid ==  0) && (local_cxy == 0) )
    869     kinit_dmsg("\n[DBG] %s : exit barrier 2 : PIC initialised / cycle %d\n",
    870     __FUNCTION__, hal_time_stamp() );
     874#if CONFIG_DEBUG_KERNEL_INIT
     875if( (core_lid ==  0) && (local_cxy == 0) )
     876printk("\n[DBG] %s : exit barrier 2 : PIC initialised / cycle %d\n",
     877__FUNCTION__, (uint32_t)hal_get_cycles() );
     878#endif
    871879
    872880    ////////////////////////////////////////////////////////////////////////////////
     
    897905    /////////////////////////////////////////////////////////////////////////////////
    898906
    899     if( (core_lid ==  0) && (local_cxy == 0) )
    900     kinit_dmsg("\n[DBG] %s : exit barrier 3 : all chdev initialised / cycle %d\n",
    901                __FUNCTION__, hal_time_stamp());
    902 
     907#if CONFIG_DEBUG_KERNEL_INIT
     908if( (core_lid ==  0) && (local_cxy == 0) )
     909printk("\n[DBG] %s : exit barrier 3 : all chdev initialised / cycle %d\n",
     910__FUNCTION__, (uint32_t)hal_get_cycles() );
     911#endif
     912
     913#if( CONFIG_DEBUG_KERNEL_INIT & 1 )
     914chdev_dir_display();
     915#endif
     916   
    903917    /////////////////////////////////////////////////////////////////////////////////
    904918    // STEP 4 : All cores enable IPI (Inter Procesor Interrupt),
     
    908922    /////////////////////////////////////////////////////////////////////////////////
    909923
    910 #if CONFIG_KINIT_DEBUG
    911 chdev_dir_display();
    912 #endif
    913    
    914924    // All cores enable the shared IPI channel
    915925    dev_pic_enable_ipi();
     
    932942    core->scheduler.idle = thread;
    933943
    934 #if CONFIG_KINIT_DEBUG
     944#if( CONFIG_DEBUG_KERNEL_INIT & 1 )
    935945sched_display( core_lid );
    936946#endif
     
    10041014    /////////////////////////////////////////////////////////////////////////////////
    10051015
    1006     if( (core_lid ==  0) && (local_cxy == 0) )
    1007     kinit_dmsg("\n[DBG] %s : exit barrier 4 : VFS_root = %l in cluster 0 / cycle %d\n",
    1008                __FUNCTION__, vfs_root_inode_xp , hal_time_stamp());
     1016#if CONFIG_DEBUG_KERNEL_INIT
     1017if( (core_lid ==  0) && (local_cxy == 0) )
     1018printk("\n[DBG] %s : exit barrier 4 : VFS_root = %l in cluster 0 / cycle %d\n",
     1019__FUNCTION__, vfs_root_inode_xp , (uint32_t)hal_get_cycles());
     1020#endif
    10091021
    10101022    /////////////////////////////////////////////////////////////////////////////////
     
    10631075    /////////////////////////////////////////////////////////////////////////////////
    10641076
    1065     if( (core_lid ==  0) && (local_cxy == 0) )
    1066     kinit_dmsg("\n[DBG] %s : exit barrier 5 : VFS_root = %l in cluster IO / cycle %d\n",
    1067     __FUNCTION__, vfs_root_inode_xp , hal_time_stamp() );
     1077#if CONFIG_DEBUG_KERNEL_INIT
     1078if( (core_lid ==  0) && (local_cxy == io_cxy) )
     1079printk("\n[DBG] %s : exit barrier 5 : VFS_root = %l in cluster %x / cycle %d\n",
     1080__FUNCTION__, vfs_root_inode_xp , io_cxy , (uint32_t)hal_get_cycles());
     1081#endif
    10681082
    10691083    /////////////////////////////////////////////////////////////////////////////////
     
    10961110    /////////////////////////////////////////////////////////////////////////////////
    10971111
    1098     if( (core_lid ==  0) && (local_cxy == 0) )
    1099     kinit_dmsg("\n[DBG] %s : exit barrier 6 : dev_root = %l in cluster IO / cycle %d\n",
    1100     __FUNCTION__, devfs_dev_inode_xp , hal_time_stamp() );
     1112#if CONFIG_DEBUG_KERNEL_INIT
     1113if( (core_lid ==  0) && (local_cxy == io_cxy) )
     1114printk("\n[DBG] %s : exit barrier 6 : dev_root = %l in cluster %x / cycle %d\n",
     1115__FUNCTION__, devfs_dev_inode_xp , io_cxy , (uint32_t)hal_get_cycles() );
     1116#endif
    11011117
    11021118    /////////////////////////////////////////////////////////////////////////////////
     
    11331149    /////////////////////////////////////////////////////////////////////////////////
    11341150
     1151#if CONFIG_DEBUG_KERNEL_INIT
     1152if( (core_lid ==  0) && (local_cxy == 0) )
     1153printk("\n[DBG] %s : exit barrier 7 : dev_root = %l in cluster 0 / cycle %d\n",
     1154__FUNCTION__, devfs_dev_inode_xp , (uint32_t)hal_get_cycles() );
     1155#endif
     1156
     1157    /////////////////////////////////////////////////////////////////////////////////
     1158    // STEP 8 : CP0 in cluster 0 creates the first user process (process_init)
     1159    /////////////////////////////////////////////////////////////////////////////////
     1160
    11351161    if( (core_lid ==  0) && (local_cxy == 0) )
    1136     kinit_dmsg("\n[DBG] %s : exit barrier 7 : dev_root = %l in cluster 0 / cycle %d\n",
    1137     __FUNCTION__, devfs_dev_inode_xp , hal_time_stamp() );
    1138 
    1139     /////////////////////////////////////////////////////////////////////////////////
    1140     // STEP 8 : CP0 in cluster 0 creates the first user process (process_init)
    1141     /////////////////////////////////////////////////////////////////////////////////
    1142 
    1143     if( (core_lid ==  0) && (local_cxy == 0) )
    1144     {
    1145 
    1146 #if CONFIG_KINIT_DEBUG
     1162    {
     1163
     1164#if( CONFIG_DEBUG_KERNEL_INIT & 1 )
    11471165vfs_display( vfs_root_inode_xp );
    11481166#endif
     
    11571175    /////////////////////////////////////////////////////////////////////////////////
    11581176
    1159     if( (core_lid ==  0) && (local_cxy == 0) )
    1160     kinit_dmsg("\n[DBG] %s : exit barrier 8 : process init created / cycle %d\n",
    1161     __FUNCTION__ , hal_time_stamp() );
     1177#if CONFIG_DEBUG_KERNEL_INIT
     1178if( (core_lid ==  0) && (local_cxy == 0) )
     1179printk("\n[DBG] %s : exit barrier 8 : process init created / cycle %d\n",
     1180__FUNCTION__ , (uint32_t)hal_get_cycles() );
     1181#endif
    11621182
    11631183    /////////////////////////////////////////////////////////////////////////////////
     
    11691189        print_banner( (info->x_size * info->y_size) , info->cores_nr );
    11701190
    1171 #if CONFIG_KINIT_DEBUG
    1172 
    1173         printk("\n\n***** memory fooprint for main kernel objects\n\n"
     1191#if( CONFIG_DEBUG_KERNEL_INIT & 1 )
     1192printk("\n\n***** memory fooprint for main kernel objects\n\n"
    11741193                   " - thread descriptor  : %d bytes\n"
    11751194                   " - process descriptor : %d bytes\n"
  • trunk/kernel/kern/printk.c

    r428 r437  
    22 * printk.c - Kernel Log & debug messages API implementation.
    33 *
    4  * authors  Alain Greiner (2016)
     4 * authors  Alain Greiner (2016,2017,2018)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
  • trunk/kernel/kern/printk.h

    r428 r437  
    22 * printk.h - Kernel Log & debug messages API definition.
    33 *
    4  * authors  Alain Greiner (2016)
     4 * authors  Alain Greiner (2016,2017,2018)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
     
    120120
    121121
    122 ///////////////////////////////////////////////////////////////////////////////////
    123 //       Conditional debug macros
    124 ///////////////////////////////////////////////////////////////////////////////////
     122
     123/*  deprecated march 2018 [AG]
    125124
    126125#if CONFIG_CHDEV_DEBUG
     
    364363#endif
    365364
     365*/
    366366
    367367#endif  // _PRINTK_H
  • trunk/kernel/kern/process.c

    r436 r437  
    366366    xptr_t      children_lock_xp;
    367367
     368    pid_t       pid = process->pid;
     369
    368370        assert( (process->th_nr == 0) , __FUNCTION__ ,
    369     "process %x in cluster %x has still active threads", process->pid , local_cxy );
     371    "process %x in cluster %x has still active threads", pid , local_cxy );
    370372
    371373#if CONFIG_DEBUG_PROCESS_DESTROY
     
    373375if( CONFIG_DEBUG_PROCESS_DESTROY )
    374376printk("\n[DBG] %s : thread %x enter to destroy process %x (pid = %x) / cycle %d\n",
    375 __FUNCTION__ , CURRENT_THREAD , process, process->pid , cycle );
     377__FUNCTION__ , CURRENT_THREAD , process, pid , cycle );
     378#endif
     379
     380#if CONFIG_DEBUG_PROCESS_DESTROY
     381if( CONFIG_DEBUG_PROCESS_DESTROY  & 1 )
     382cluster_processes_display( CXY_FROM_PID( pid ) );
    376383#endif
    377384
     
    383390
    384391    // remove process from children_list if process is in owner cluster
    385     if( CXY_FROM_PID( process->pid ) == local_cxy )
     392    if( CXY_FROM_PID( pid ) == local_cxy )
    386393    {
    387394        // get pointers on parent process
     
    400407
    401408    // release the process PID to cluster manager
    402     cluster_pid_release( process->pid );
     409    cluster_pid_release( pid );
    403410
    404411    // FIXME close all open files and update dirty [AG]
     
    419426if( CONFIG_DEBUG_PROCESS_DESTROY )
    420427printk("\n[DBG] %s : thread %x exit / destroyed process %x (pid = %x) / cycle %d\n",
    421 __FUNCTION__ , CURRENT_THREAD , process, process->pid, cycle );
     428__FUNCTION__ , CURRENT_THREAD , process, pid, cycle );
    422429#endif
    423430
  • trunk/kernel/kern/rpc.c

    r436 r437  
    11/*
    2  * rpc.c - RPC related operations implementation.
     2 * rpc.c - RPC operations implementation.
    33 *
    4  * Author    Alain Greiner (2016,2017)
     4 * Author    Alain Greiner (2016,2017,2018)
    55 *
    66 * Copyright (c)  UPMC Sorbonne Universites
     
    5252if( cycle > CONFIG_DEBUG_RPC_MARSHALING )                                              \
    5353printk("\n[DBG] %s : enter thread %x on core[%x,%d] / cycle %d\n",                     \
    54 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, CURRENT_THREAD->core->lid , cycle );
     54__FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );
    5555
    5656#define RPC_DEBUG_EXIT                                                                 \
     
    5858if( cycle > CONFIG_DEBUG_RPC_MARSHALING )                                              \
    5959printk("\n[DBG] %s : exit thread %x on core[%x,%d] / cycle %d\n",                      \
    60 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy, CURRENT_THREAD->core->lid , cycle );
     60__FUNCTION__ , CURRENT_THREAD , local_cxy, CURRENT_THREAD->core->lid , cycle );
    6161
    6262#else
     
    129129uint32_t cycle = (uint32_t)hal_get_cycles();
    130130if( CONFIG_DEBUG_RPC_SEND < cycle )
    131 printk("\n[DBG] %s : thread %x enter for rpc[%d] / rpc_ptr %x / cycle %d\n",
    132 __FUNCTION__, CURRENT_THREAD, rpc->index, rpc, cycle );
     131printk("\n[DBG] %s : thread %x in cluster %x enter for rpc[%d] / rpc_ptr %x / cycle %d\n",
     132__FUNCTION__, CURRENT_THREAD, local_cxy, rpc->index, rpc, cycle );
    133133#endif
    134134
     
    174174cycle = (uint32_t)hal_get_cycles();
    175175if( CONFIG_DEBUG_RPC_SEND < cycle )
    176 printk("\n[DBG] %s : thread %x busy waiting / rpc[%d] / server = %x / cycle %d\n",
    177 __FUNCTION__, CURRENT_THREAD, rpc->index , server_cxy , cycle );
     176printk("\n[DBG] %s : thread %x in cluster %x busy waiting / rpc[%d] / cycle %d\n",
     177__FUNCTION__, CURRENT_THREAD, local_cxy, rpc->index , cycle );
    178178#endif
    179179
     
    183183cycle = (uint32_t)hal_get_cycles();
    184184if( CONFIG_DEBUG_RPC_SEND < cycle )
    185 printk("\n[DBG] %s : thread % resume / rpc[%d] / cycle %d\n",
    186 __FUNCTION__, CURRENT_THREAD, rpc->index, cycle );
     185printk("\n[DBG] %s : thread % in cluster %x resume / rpc[%d] / cycle %d\n",
     186__FUNCTION__, CURRENT_THREAD, local_cxy, rpc->index, cycle );
    187187#endif
    188188        }
     
    193193cycle = (uint32_t)hal_get_cycles();
    194194if( CONFIG_DEBUG_RPC_SEND < cycle )
    195 printk("\n[DBG] %s : thread %x block & deschedule / rpc[%d] / server = %x / cycle %d\n",
    196 __FUNCTION__, CURRENT_THREAD, rpc->index , server_cxy , cycle );
     195printk("\n[DBG] %s : thread %x in cluster %x deschedule / rpc[%d] / cycle %d\n",
     196__FUNCTION__, CURRENT_THREAD, local_cxy, rpc->index , cycle );
    197197#endif
    198198            thread_block( XPTR( local_cxy , this ) , THREAD_BLOCKED_RPC );
     
    202202cycle = (uint32_t)hal_get_cycles();
    203203if( CONFIG_DEBUG_RPC_SEND < cycle )
    204 printk("\n[DBG] %s : thread % resume / rpcr[%d] / cycle %d\n",
    205 __FUNCTION__, CURRENT_THREAD, rpc->index, cycle );
     204printk("\n[DBG] %s : thread % in cluster %x resume / rpcr[%d] / cycle %d\n",
     205__FUNCTION__, CURRENT_THREAD, local_cxy, rpc->index, cycle );
    206206#endif
    207207        }
     
    219219cycle = (uint32_t)hal_get_cycles();
    220220if( CONFIG_DEBUG_RPC_SEND < cycle )
    221 printk("\n[DBG] %s : non blocking rpc[%d] => thread return  / cycle %d\n",
     221printk("\n[DBG] %s : non blocking rpc[%d] => thread %x return  / cycle %d\n",
    222222__FUNCTION__, rpc->index, CURRENT_THREAD, cycle );
    223223#endif
     
    355355uint32_t cycle = (uint32_t)hal_get_cycles();
    356356if( CONFIG_DEBUG_RPC_SERVER < cycle )
    357 printk("\n[DBG] %s : RPC thread %x takes RPC fifo ownership / cluster %x / cycle %d\n",
     357printk("\n[DBG] %s : RPC thread %x in cluster %x takes RPC fifo ownership / cycle %d\n",
    358358__FUNCTION__, this, local_cxy, cycle );
    359359#endif
     
    378378                    desc_ptr = GET_PTR( desc_xp );
    379379
    380                         index    = desc_ptr->index;
    381                     blocking = desc_ptr->blocking;
     380                        index    = hal_remote_lw( XPTR( desc_cxy , &desc_ptr->index ) );
     381                    blocking = hal_remote_lw( XPTR( desc_cxy , &desc_ptr->blocking ) );
    382382
    383383#if CONFIG_DEBUG_RPC_SERVER
    384384cycle = (uint32_t)hal_get_cycles();
    385385if( CONFIG_DEBUG_RPC_SERVER < cycle )
    386 printk("\n[DBG] %s : RPC thread %x got rpc[%d] / rpc_ptr %x / cycle %d\n",
    387 __FUNCTION__, this, index, desc_ptr, cycle );
     386printk("\n[DBG] %s : RPC thread %x in cluster %x got rpc[%d] / rpc_ptr %x / cycle %d\n",
     387__FUNCTION__, this, local_cxy, index, desc_ptr, cycle );
    388388#endif
    389389                    // call the relevant server function
     
    393393cycle = (uint32_t)hal_get_cycles();
    394394if( CONFIG_DEBUG_RPC_SERVER < cycle )
    395 printk("\n[DBG] %s : RPC thread %x completes rpc %d in cluster %x / cycle %d\n",
    396 __FUNCTION__, this, index, local_cxy, cycle );
     395printk("\n[DBG] %s : RPC thread %x in cluster %x completes rpc[%d] / rpc_ptr %x / cycle %d\n",
     396__FUNCTION__, this, local_cxy, index, cycle );
    397397#endif
    398398                    // increment handled RPCs counter
     
    435435uint32_t cycle = (uint32_t)hal_get_cycles();
    436436if( CONFIG_DEBUG_RPC_SERVER < cycle )
    437 printk("\n[DBG] %s : RPC thread %x suicides in cluster %x / cycle %d\n",
     437printk("\n[DBG] %s : RPC thread %x in cluster %x suicides / cycle %d\n",
    438438__FUNCTION__, this, local_cxy, cycle );
    439439#endif
     
    450450uint32_t cycle = (uint32_t)hal_get_cycles();
    451451if( CONFIG_DEBUG_RPC_SERVER < cycle )
    452 printk("\n[DBG] %s : RPC thread %x deschedules in cluster %x / cycle %d\n",
     452printk("\n[DBG] %s : RPC thread %x in cluster %x deschedules / cycle %d\n",
    453453__FUNCTION__, this, local_cxy, cycle );
    454454#endif
     
    460460cycle = (uint32_t)hal_get_cycles();
    461461if( CONFIG_DEBUG_RPC_SERVER < cycle )
    462 printk("\n[DBG] %s : RPC thread %x resumes in cluster %x / cycle %d\n",
     462printk("\n[DBG] %s : RPC thread %x in cluster %x resumes / cycle %d\n",
    463463__FUNCTION__, this, local_cxy, cycle );
    464464#endif
     
    478478                                page_t  ** page )      // out
    479479{
    480 rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    481 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    482 CURRENT_THREAD->core->lid , hal_time_stamp() );
    483480
    484481    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
     
    499496    *page = (page_t *)(intptr_t)rpc.args[1];
    500497
    501 rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    502 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    503 CURRENT_THREAD->core->lid , hal_time_stamp() );
    504498}
    505499
     
    507501void rpc_pmem_get_pages_server( xptr_t xp )
    508502{
    509 rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    510 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    511 CURRENT_THREAD->core->lid , hal_time_stamp() );
    512503
    513504    // get client cluster identifier and pointer on RPC descriptor
     
    524515    hal_remote_swd( XPTR( cxy , &desc->args[1] ) , (uint64_t)(intptr_t)page );
    525516
    526 rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    527 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    528 CURRENT_THREAD->core->lid , hal_time_stamp() );
    529517}
    530518
     
    537525                                    page_t  * page )      // out
    538526{
    539 rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    540 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    541 CURRENT_THREAD->core->lid , hal_time_stamp() );
    542527
    543528    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
     
    555540    rpc_send( cxy , &rpc );
    556541
    557 rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    558 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    559 CURRENT_THREAD->core->lid , hal_time_stamp() );
    560542}
    561543
     
    563545void rpc_pmem_release_pages_server( xptr_t xp )
    564546{
    565 rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    566 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    567 CURRENT_THREAD->core->lid , hal_time_stamp() );
    568547
    569548    // get client cluster identifier and pointer on RPC descriptor
     
    580559    kmem_free( &req );
    581560
    582 rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    583 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    584 CURRENT_THREAD->core->lid , hal_time_stamp() );
    585561}
    586562
     
    601577                                   error_t   * error )              // out
    602578{
    603 rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    604 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    605 CURRENT_THREAD->core->lid , hal_time_stamp() );
    606 
    607579    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    608580
     
    625597    *error             = (error_t)rpc.args[4];     
    626598
    627 rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    628 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    629 CURRENT_THREAD->core->lid , hal_time_stamp() );
    630599}
    631600
     
    633602void rpc_process_make_fork_server( xptr_t xp )
    634603{
    635 rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    636 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    637 CURRENT_THREAD->core->lid , hal_time_stamp() );
    638604
    639605    xptr_t     ref_process_xp;     // extended pointer on reference parent process
     
    662628    hal_remote_swd( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)error );
    663629
    664 rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    665 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    666 CURRENT_THREAD->core->lid , hal_time_stamp() );
    667630}
    668631
     
    688651                                    error_t        * error )      // out
    689652{
    690 rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    691 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    692 CURRENT_THREAD->core->lid , hal_time_stamp() );
    693 
    694653    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    695654
     
    713672    *error     = (error_t)rpc.args[5];
    714673
    715 rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    716 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    717 CURRENT_THREAD->core->lid , hal_time_stamp() );
    718674}
    719675
     
    721677void rpc_thread_user_create_server( xptr_t xp )
    722678{
    723 rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    724 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    725 CURRENT_THREAD->core->lid , hal_time_stamp() );
    726679
    727680    pthread_attr_t * attr_ptr;   // pointer on attributes structure in client cluster
     
    764717    hal_remote_swd( XPTR( client_cxy , &desc->args[5] ) , (uint64_t)error );
    765718
    766 rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    767 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    768 CURRENT_THREAD->core->lid , hal_time_stamp() );
    769719}
    770720
     
    781731                                      error_t * error )      // out
    782732{
    783 rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    784 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    785 CURRENT_THREAD->core->lid , hal_time_stamp() );
    786 
    787733    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    788734
     
    805751    *error     = (error_t)rpc.args[4];
    806752
    807 rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    808 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    809 CURRENT_THREAD->core->lid , hal_time_stamp() );
    810753}
    811754
     
    813756void rpc_thread_kernel_create_server( xptr_t xp )
    814757{
    815 rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    816 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    817 CURRENT_THREAD->core->lid , hal_time_stamp() );
    818 
    819758    thread_t       * thread_ptr;  // local pointer on thread descriptor
    820759    xptr_t           thread_xp;   // extended pointer on thread descriptor
     
    842781    hal_remote_swd( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)thread_xp );
    843782
    844 rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    845 __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    846 CURRENT_THREAD->core->lid , hal_time_stamp() );
    847783}
    848784
     
    962898                                  error_t      * error )     // out
    963899{
    964     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    965     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    966     CURRENT_THREAD->core->lid , hal_time_stamp() );
    967 
    968900    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    969901
     
    991923    *error    = (error_t)rpc.args[9];
    992924
    993     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    994     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    995     CURRENT_THREAD->core->lid , hal_time_stamp() );
    996925}
    997926
     
    1010939    error_t          error;
    1011940
    1012     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1013     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1014     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1015 
    1016941    // get client cluster identifier and pointer on RPC descriptor
    1017942    cxy_t        client_cxy  = GET_CXY( xp );
     
    1043968    hal_remote_swd( XPTR( client_cxy , &desc->args[9] ) , (uint64_t)error );
    1044969
    1045     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1046     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1047     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1048970}
    1049971
     
    1056978                                   struct vfs_inode_s * inode )
    1057979{
    1058     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1059     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1060     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1061 
    1062980    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    1063981
     
    1074992    rpc_send( cxy , &rpc );
    1075993
    1076     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1077     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1078     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1079994}
    1080995
     
    1083998{
    1084999    vfs_inode_t * inode;
    1085 
    1086     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1087     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1088     CURRENT_THREAD->core->lid , hal_time_stamp() );
    10891000
    10901001    // get client cluster identifier and pointer on RPC descriptor
     
    10981009    vfs_inode_destroy( inode );
    10991010
    1100     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1101     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1102     CURRENT_THREAD->core->lid , hal_time_stamp() );
    11031011}
    11041012
     
    11151023                                   error_t              * error )       // out
    11161024{
    1117     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1118     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1119     CURRENT_THREAD->core->lid , hal_time_stamp() );
     1025    RPC_DEBUG_ENTER
    11201026
    11211027    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
     
    11391045    *error     = (error_t)rpc.args[4];
    11401046
    1141     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1142     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1143     CURRENT_THREAD->core->lid , hal_time_stamp() );
     1047    RPC_DEBUG_EXIT
    11441048}
    11451049
     
    11531057    error_t       error;
    11541058
     1059    RPC_DEBUG_ENTER
     1060
    11551061    char          name_copy[CONFIG_VFS_MAX_NAME_LENGTH];
    1156 
    1157     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1158     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1159     CURRENT_THREAD->core->lid , hal_time_stamp() );
    11601062
    11611063    // get client cluster identifier and pointer on RPC descriptor
     
    11811083    hal_remote_swd( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)error );
    11821084
    1183     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1184     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1185     CURRENT_THREAD->core->lid , hal_time_stamp() );
     1085    RPC_DEBUG_EXIT
    11861086}
    11871087
     
    11951095                                    vfs_dentry_t * dentry )
    11961096{
    1197     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1198     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1199     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1200 
    12011097    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    12021098
     
    12131109    rpc_send( cxy , &rpc );
    12141110
    1215     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1216     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1217     CURRENT_THREAD->core->lid , hal_time_stamp() );
    12181111}
    12191112
     
    12221115{
    12231116    vfs_dentry_t * dentry;
    1224 
    1225     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1226     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1227     CURRENT_THREAD->core->lid , hal_time_stamp() );
    12281117
    12291118    // get client cluster identifier and pointer on RPC descriptor
     
    12371126    vfs_dentry_destroy( dentry );
    12381127
    1239     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1240     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1241     CURRENT_THREAD->core->lid , hal_time_stamp() );
    12421128}
    12431129
     
    12541140                                 error_t              * error )      // out
    12551141{
    1256     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1257     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1258     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1259 
    12601142    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    12611143
     
    12771159    *error   = (error_t)rpc.args[3];
    12781160
    1279     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1280     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1281     CURRENT_THREAD->core->lid , hal_time_stamp() );
    12821161}
    12831162
     
    12891168    xptr_t        file_xp;
    12901169    error_t       error;
    1291 
    1292     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1293     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1294     CURRENT_THREAD->core->lid , hal_time_stamp() );
    12951170
    12961171    // get client cluster identifier and pointer on RPC descriptor
     
    13111186    hal_remote_swd( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );
    13121187
    1313     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1314     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1315     CURRENT_THREAD->core->lid , hal_time_stamp() );
    13161188}
    13171189
     
    13241196                                  vfs_file_t * file )
    13251197{
    1326     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1327     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1328     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1329 
    13301198    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    13311199
     
    13421210    rpc_send( cxy , &rpc );
    13431211
    1344     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1345     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1346     CURRENT_THREAD->core->lid , hal_time_stamp() );
    13471212}
    13481213
     
    13511216{
    13521217    vfs_file_t * file;
    1353 
    1354     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1355     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1356     CURRENT_THREAD->core->lid , hal_time_stamp() );
    13571218
    13581219    // get client cluster identifier and pointer on RPC descriptor
     
    13661227    vfs_file_destroy( file );
    13671228
    1368     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1369     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1370     CURRENT_THREAD->core->lid , hal_time_stamp() );
    13711229}
    13721230
     
    13821240                                error_t     * error )          // out
    13831241{
    1384     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1385     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1386     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1387 
    13881242    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    13891243
     
    14051259    *error   = (error_t)rpc.args[3];
    14061260
    1407     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1408     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1409     CURRENT_THREAD->core->lid , hal_time_stamp() );
    14101261}
    14111262
     
    14201271    char          name_copy[CONFIG_VFS_MAX_NAME_LENGTH];
    14211272
    1422     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1423     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1424     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1425 
    14261273    // get client cluster identifier and pointer on RPC descriptor
    14271274    cxy_t        client_cxy  = GET_CXY( xp );
     
    14431290    hal_remote_swd( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );
    14441291
    1445     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1446     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1447     CURRENT_THREAD->core->lid , hal_time_stamp() );
    14481292}
    14491293
     
    14571301                                     error_t     * error )     // out
    14581302{
    1459     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1460     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1461     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1462 
    14631303    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    14641304
     
    14781318    *error   = (error_t)rpc.args[1];
    14791319
    1480     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1481     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1482     CURRENT_THREAD->core->lid , hal_time_stamp() );
    14831320}
    14841321
     
    14891326    vfs_inode_t * inode;
    14901327
    1491     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1492     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1493     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1494 
    14951328    // get client cluster identifier and pointer on RPC descriptor
    14961329    cxy_t        client_cxy  = GET_CXY( xp );
     
    15061339    hal_remote_swd( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error );
    15071340
    1508     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1509     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1510     CURRENT_THREAD->core->lid , hal_time_stamp() );
    15111341}
    15121342
     
    15231353                                   error_t  * error )    // out
    15241354{
    1525     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1526     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1527     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1528 
    15291355    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    15301356
     
    15471373    *error   = (error_t)rpc.args[4];
    15481374
    1549     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1550     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1551     CURRENT_THREAD->core->lid , hal_time_stamp() );
    15521375}
    15531376
     
    15611384    error_t       error;
    15621385
    1563     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1564     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1565     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1566 
    15671386    // get client cluster identifier and pointer on RPC descriptor
    15681387    cxy_t        client_cxy  = GET_CXY( xp );
     
    15811400    hal_remote_swd( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)error );
    15821401
    1583     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1584     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1585     CURRENT_THREAD->core->lid , hal_time_stamp() );
    15861402}
    15871403
     
    15971413                              error_t   * error )      // out
    15981414{
    1599     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1600     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1601     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1602 
    16031415    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    16041416
     
    16201432    *error   = (error_t)rpc.args[3];
    16211433
    1622     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1623     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1624     CURRENT_THREAD->core->lid , hal_time_stamp() );
    16251434}
    16261435
     
    16331442    xptr_t        vseg_xp;
    16341443    error_t       error;
    1635 
    1636     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1637     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1638     CURRENT_THREAD->core->lid , hal_time_stamp() );
    16391444
    16401445    // get client cluster identifier and pointer on RPC descriptor
     
    16541459    hal_remote_swd( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );
    16551460
    1656     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1657     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1658     CURRENT_THREAD->core->lid , hal_time_stamp() );
    16591461}
    16601462
     
    16731475                             error_t   * error )   // out
    16741476{
    1675     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1676     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1677     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1678 
    16791477    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    16801478
     
    16981496    *error = (error_t)rpc.args[5];
    16991497
    1700     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1701     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1702     CURRENT_THREAD->core->lid , hal_time_stamp() );
    17031498}
    17041499
     
    17121507    ppn_t         ppn;
    17131508    error_t       error;
    1714 
    1715     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1716     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1717     CURRENT_THREAD->core->lid , hal_time_stamp() );
    17181509
    17191510    // get client cluster identifier and pointer on RPC descriptor
     
    17341525    hal_remote_swd( XPTR( client_cxy , &desc->args[5] ) , (uint64_t)error );
    17351526
    1736     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1737     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1738     CURRENT_THREAD->core->lid , hal_time_stamp() );
    17391527}
    17401528
     
    17481536                           xptr_t *   buf_xp )     // out
    17491537{
    1750     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1751     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1752     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1753 
    17541538    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    17551539
     
    17691553    *buf_xp = (xptr_t)rpc.args[1];
    17701554
    1771     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1772     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1773     CURRENT_THREAD->core->lid , hal_time_stamp() );
    17741555}
    17751556
     
    17771558void rpc_kcm_alloc_server( xptr_t xp )
    17781559{
    1779     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1780     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1781     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1782 
    17831560    // get client cluster identifier and pointer on RPC descriptor
    17841561    cxy_t        client_cxy  = GET_CXY( xp );
     
    17981575    hal_remote_swd( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)buf_xp );
    17991576
    1800     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1801     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1802     CURRENT_THREAD->core->lid , hal_time_stamp() );
    18031577}   
    18041578
     
    18121586                          uint32_t   kmem_type )   // in
    18131587{
    1814     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1815     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1816     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1817 
    18181588    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    18191589
     
    18311601    rpc_send( cxy , &rpc );
    18321602
    1833     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1834     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1835     CURRENT_THREAD->core->lid , hal_time_stamp() );
    18361603}
    18371604
     
    18391606void rpc_kcm_free_server( xptr_t xp )
    18401607{
    1841     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1842     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1843     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1844 
    18451608    // get client cluster identifier and pointer on RPC descriptor
    18461609    cxy_t        client_cxy  = GET_CXY( xp );
     
    18571620    kmem_free( &req );
    18581621
    1859     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1860     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1861     CURRENT_THREAD->core->lid , hal_time_stamp() );
    18621622}   
    18631623
     
    18761636                                    error_t  * error )        // out
    18771637{
    1878     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1879     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1880     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1881 
    18821638    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    18831639
     
    19021658    *error     = (error_t)rpc.args[6];
    19031659
    1904     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1905     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1906     CURRENT_THREAD->core->lid , hal_time_stamp() );
    19071660}
    19081661
     
    19181671    uint32_t   size;
    19191672    error_t    error;
    1920 
    1921     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1922     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1923     CURRENT_THREAD->core->lid , hal_time_stamp() );
    19241673
    19251674    // get client cluster identifier and pointer on RPC descriptor
     
    19591708    hal_remote_swd( XPTR( client_cxy , &desc->args[6] ) , (uint64_t)error );
    19601709
    1961     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1962     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1963     CURRENT_THREAD->core->lid , hal_time_stamp() );
    19641710}
    19651711
     
    19741720                                 page_t         ** page )      // out
    19751721{
    1976     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    1977     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    1978     CURRENT_THREAD->core->lid , hal_time_stamp() );
    1979 
    19801722    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    19811723
     
    19961738    *page = (page_t *)(intptr_t)rpc.args[2];
    19971739
    1998     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    1999     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    2000     CURRENT_THREAD->core->lid , hal_time_stamp() );
    20011740}
    20021741
     
    20041743void rpc_mapper_get_page_server( xptr_t xp )
    20051744{
    2006     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    2007     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    2008     CURRENT_THREAD->core->lid , hal_time_stamp() );
    2009 
    20101745    // get client cluster identifier and pointer on RPC descriptor
    20111746    cxy_t        cxy  = GET_CXY( xp );
     
    20221757    hal_remote_swd( XPTR( cxy , &desc->args[1] ) , (uint64_t)(intptr_t)page );
    20231758
    2024     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    2025     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    2026     CURRENT_THREAD->core->lid , hal_time_stamp() );
    20271759}
    20281760
     
    20431775                                 struct vseg_s   ** vseg )
    20441776{
    2045     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    2046     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    2047     CURRENT_THREAD->core->lid , hal_time_stamp() );
    2048 
    20491777    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    20501778
     
    20711799    *vseg = (vseg_t *)(intptr_t)rpc.args[8];
    20721800
    2073     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    2074     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    2075     CURRENT_THREAD->core->lid , hal_time_stamp() );
    20761801}
    20771802
     
    20791804void rpc_vmm_create_vseg_server( xptr_t xp )
    20801805{
    2081     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    2082     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    2083     CURRENT_THREAD->core->lid , hal_time_stamp() );
    2084 
    20851806    // get client cluster identifier and pointer on RPC descriptor
    20861807    cxy_t        cxy  = GET_CXY( xp );
     
    21101831    hal_remote_swd( XPTR( cxy , &desc->args[8] ) , (uint64_t)(intptr_t)vseg );
    21111832
    2112     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    2113     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    2114     CURRENT_THREAD->core->lid , hal_time_stamp() );
    21151833}
    21161834
     
    21231841                               lid_t              lid)
    21241842{
    2125     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    2126     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    2127     CURRENT_THREAD->core->lid , hal_time_stamp() );
    2128 
    21291843    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    21301844
     
    21411855    rpc_send( cxy , &rpc );
    21421856
    2143     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    2144     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    2145     CURRENT_THREAD->core->lid , hal_time_stamp() );
    21461857}
    21471858
     
    21491860void rpc_sched_display_server( xptr_t xp )
    21501861{
    2151     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    2152     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    2153     CURRENT_THREAD->core->lid , hal_time_stamp() );
    2154 
    21551862    // get client cluster identifier and pointer on RPC descriptor
    21561863    cxy_t        cxy  = GET_CXY( xp );
     
    21631870    sched_display( lid );
    21641871
    2165     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    2166     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    2167     CURRENT_THREAD->core->lid , hal_time_stamp() );
    21681872}
    21691873
     
    21761880                             process_t * process )
    21771881{
    2178     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    2179     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    2180     CURRENT_THREAD->core->lid , hal_time_stamp() );
    2181 
    21821882    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    21831883
     
    21941894    rpc_send( cxy , &rpc );
    21951895
    2196     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    2197     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    2198     CURRENT_THREAD->core->lid , hal_time_stamp() );
    21991896}
    22001897
     
    22021899void rpc_vmm_set_cow_server( xptr_t xp )
    22031900{
    2204     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    2205     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    2206     CURRENT_THREAD->core->lid , hal_time_stamp() );
    2207 
    22081901    process_t * process;
    22091902
     
    22181911    vmm_set_cow( process );
    22191912
    2220     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    2221     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    2222     CURRENT_THREAD->core->lid , hal_time_stamp() );
    22231913}
    22241914
     
    22321922                             bool_t      detailed )
    22331923{
    2234     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    2235     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    2236     CURRENT_THREAD->core->lid , hal_time_stamp() );
    2237 
    22381924    assert( (cxy != local_cxy) , __FUNCTION__ , "target cluster is not remote\n");
    22391925
     
    22511937    rpc_send( cxy , &rpc );
    22521938
    2253     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    2254     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    2255     CURRENT_THREAD->core->lid , hal_time_stamp() );
    22561939}
    22571940
     
    22591942void rpc_vmm_display_server( xptr_t xp )
    22601943{
    2261     rpc_dmsg("\n[DBG] %s : enter / thread %x on core[%x,%d] / cycle %d\n",
    2262     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    2263     CURRENT_THREAD->core->lid , hal_time_stamp() );
    2264 
    22651944    process_t * process;
    22661945    bool_t      detailed;
     
    22771956    vmm_display( process , detailed );
    22781957
    2279     rpc_dmsg("\n[DBG] %s : exit / thread %x on core[%x,%d] / cycle %d\n",
    2280     __FUNCTION__ , CURRENT_THREAD->trdid , local_cxy,
    2281     CURRENT_THREAD->core->lid , hal_time_stamp() );
    2282 }
    2283 
    2284 
     1958}
     1959
     1960
  • trunk/kernel/kern/rpc.h

    r436 r437  
    22 * rpc.h - RPC (Remote Procedure Call) operations definition.
    33 *
    4  * Author  Alain Greiner (2016,2017)
     4 * Author  Alain Greiner (2016,2017,2018)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
  • trunk/kernel/kern/scheduler.c

    r436 r437  
    9797    list_entry_t * current;
    9898    list_entry_t * last;
     99    list_entry_t * root;
     100    bool_t         done;
    99101
    100102    // take lock protecting sheduler lists
    101103    spinlock_lock( &sched->lock );
    102104
    103     // first loop : scan the kernel threads list if not empty
     105    // first : scan the kernel threads list if not empty
    104106    if( list_is_empty( &sched->k_root ) == false )
    105107    {
     108        root    = &sched->k_root;
    106109        last    = sched->k_last;
    107         current = sched->k_last;
    108         do
     110        current = last;
     111        done    = false;
     112
     113        while( done == false )
    109114        {
    110115            // get next entry in kernel list
    111             current = list_next( &sched->k_root , current );
     116            current = current->next;
     117
     118            // check exit condition
     119            if( current == last ) done = true;
    112120
    113121            // skip the root that does not contain a thread
    114             if( current == NULL ) current = sched->k_root.next;
     122            if( current == root ) continue;
    115123
    116124            // get thread pointer for this entry
     
    120128            switch( thread->type )
    121129            {
    122                 case THREAD_IDLE: // skip IDLE thread
    123                 break;
    124 
    125                 case THREAD_RPC:  // RPC thread if non blocked and FIFO non-empty
     130                case THREAD_RPC:  // if non blocked and RPC FIFO non-empty
    126131                if( (thread->blocked == 0) &&
    127132                    (local_fifo_is_empty( &LOCAL_CLUSTER->rpc_fifo ) == 0) )
     
    132137                break;
    133138
    134                 default:          // DEV thread if non blocked and waiting queue non empty
     139                case THREAD_DEV:  // if non blocked and waiting queue non empty
    135140                if( (thread->blocked == 0) &&
    136141                    (xlist_is_empty( XPTR( local_cxy , &thread->chdev->wait_root)) == 0) )
     
    140145                }
    141146                break;
    142             }  // end switch type
    143         }
    144         while( current != last );
    145     }
    146 
    147     // second loop : scan the user threads list if not empty
     147
     148                default:
     149                break;
     150            }
     151        } // end loop on kernel threads
     152    } // end if kernel threads
     153
     154    // second : scan the user threads list if not empty
    148155    if( list_is_empty( &sched->u_root ) == false )
    149156    {
     157        root    = &sched->u_root;
    150158        last    = sched->u_last;
    151         current = sched->u_last;
    152         do
     159        current = last;
     160        done    = false;
     161
     162        while( done == false )
    153163        {
    154164            // get next entry in user list
    155             current = list_next( &sched->u_root , current );
     165            current = current->next;
     166
     167            // check exit condition
     168            if( current == last ) done = true;
    156169
    157170            // skip the root that does not contain a thread
    158             if( current == NULL ) current = sched->u_root.next;
     171            if( current == root ) continue;
    159172
    160173            // get thread pointer for this entry
     
    167180                return thread;
    168181            }
    169         }
    170         while( current != last );
    171     }
    172 
    173     // third : return idle thread if no runnable thread
     182        } // end loop on user threads
     183    } // end if user threads
     184
     185    // third : return idle thread if no other runnable thread
    174186    spinlock_unlock( &sched->lock );
    175187    return sched->idle;
     
    180192void sched_handle_signals( core_t * core )
    181193{
     194
    182195    list_entry_t * iter;
    183196    thread_t     * thread;
     
    214227            process = thread->process;
    215228
     229#if CONFIG_DEBUG_SCHED_HANDLE_SIGNALS
     230uint32_t cycle = (uint32_t)hal_get_cycles();
     231if( CONFIG_DEBUG_SCHED_HANDLE_SIGNALS < cycle )
     232printk("\n[DBG] %s : thread %x in proces %x must be deleted / cycle %d\n",
     233__FUNCTION__ , thread , process->pid , cycle );
     234#endif
    216235                // release FPU if required
    217236                if( thread->core->fpu_owner == thread )  thread->core->fpu_owner = NULL;
     
    232251
    233252#if CONFIG_DEBUG_SCHED_HANDLE_SIGNALS
    234 uint32_t cycle = (uint32_t)hal_get_cycles();
     253cycle = (uint32_t)hal_get_cycles();
    235254if( CONFIG_DEBUG_SCHED_HANDLE_SIGNALS < cycle )
    236 printk("\n[DBG] %s : thread %x deleted thread %x / cycle %d\n",
    237 __FUNCTION__ , CURRENT_THREAD , thread , cycle );
     255printk("\n[DBG] %s : thread %x in process %x has been deleted / cycle %d\n",
     256__FUNCTION__ , thread , process->pid , cycle );
    238257#endif
    239258            // destroy process descriptor if no more threads
     
    246265cycle = (uint32_t)hal_get_cycles();
    247266if( CONFIG_DEBUG_SCHED_HANDLE_SIGNALS < cycle )
    248 printk("\n[DBG] %s : thread %x deleted process %x / cycle %d\n",
    249 __FUNCTION__ , CURRENT_THREAD , process , cycle );
     267printk("\n[DBG] %s : process %x has been deleted / cycle %d\n",
     268__FUNCTION__ , process->pid , cycle );
    250269#endif
    251270
     
    374393    remote_spinlock_lock_busy( lock_xp , &save_sr );
    375394
    376     nolock_printk("\n***** scheduler state for core[%x,%d] / cycle %d / current = (%x,%x)\n",
    377             local_cxy , core->lid, (uint32_t)hal_get_cycles(),
    378             sched->current->process->pid , sched->current->trdid );
     395    nolock_printk("\n***** threads on core[%x,%d] / current %x / cycle %d\n",
     396            local_cxy , core->lid, sched->current, (uint32_t)hal_get_cycles() );
    379397
    380398    // display kernel threads
     
    390408        else
    391409        {
    392             nolock_printk(" - %s / pid %X / trdid %X / desc %X / block %X / flags %X \n",
     410            nolock_printk(" - %s / pid %X / trdid %X / desc %X / block %X / flags %X\n",
    393411            thread_type_str( thread->type ), thread->process->pid, thread->trdid,
    394             thread, thread->blocked, thread->flags  );
     412            thread, thread->blocked, thread->flags );
    395413        }
    396414    }
  • trunk/kernel/kern/scheduler.h

    r436 r437  
    4040typedef struct scheduler_s
    4141{
    42     spinlock_t        lock;            /*! readlock protecting lists of threads             */
     42    spinlock_t        lock;            /*! lock protecting lists of threads                 */
    4343    uint16_t          u_threads_nr;    /*! total number of attached user threads            */
    4444    uint16_t          k_threads_nr;    /*! total number of attached kernel threads          */
  • trunk/kernel/kern/thread.h

    r436 r437  
    150150    xptr_t              parent;          /*! extended pointer on parent thread        */
    151151
    152         uint32_t            local_locks;         /*! number of local locks owned by thread    */
    153         uint32_t            remote_locks;        /*! number of remote locks owned by thread   */
    154 
    155152    remote_spinlock_t   join_lock;       /*! lock protecting the join/exit            */
    156153    xptr_t              join_xp;         /*! joining/killer thread extended pointer   */
     
    197194    list_entry_t        locks_root;      /*! root of list of locks taken              */
    198195    xlist_entry_t       xlocks_root;     /*! root of xlist of remote locks taken      */
     196        uint32_t            local_locks;         /*! number of local locks owned by thread    */
     197        uint32_t            remote_locks;        /*! number of remote locks owned by thread   */
    199198
    200199        thread_info_t       info;            /*! embedded thread_info_t                   */
Note: See TracChangeset for help on using the changeset viewer.