Index: trunk/kernel/mm/vmm.c
===================================================================
--- trunk/kernel/mm/vmm.c	(revision 437)
+++ trunk/kernel/mm/vmm.c	(revision 438)
@@ -63,7 +63,7 @@
     intptr_t  size;
 
-#if CONFIG_DEBUG_VMM_INIT
+#if DEBUG_VMM_INIT
 uint32_t cycle = (uint32_t)hal_get_cycles();
-if( CONFIG_DEBUG_VMM_INIT )
+if( DEBUG_VMM_INIT )
 printk("\n[DBG] %s : thread %x enter for process %x / cycle %d\n", 
 __FUNCTION__ , CURRENT_THREAD , process->pid , cycle );
@@ -183,7 +183,7 @@
     hal_fence();
 
-#if CONFIG_DEBUG_VMM_INIT
+#if DEBUG_VMM_INIT
 cycle = (uint32_t)hal_get_cycles();
-if( CONFIG_DEBUG_VMM_INIT )
+if( DEBUG_VMM_INIT )
 printk("\n[DBG] %s : thread %x exit for process %x / entry_point = %x / cycle %d\n", 
 __FUNCTION__ , CURRENT_THREAD , process->pid , process->vmm.entry_point , cycle );
@@ -266,7 +266,7 @@
     lpid_t          owner_lpid;
 
-#if CONFIG_DEBUG_VMM_UPDATE_PTE
+#if DEBUG_VMM_UPDATE_PTE
 uint32_t cycle = (uint32_t)hal_get_cycles();
-if( CONFIG_DEBUG_VMM_UPDATE_PTE < cycle )
+if( DEBUG_VMM_UPDATE_PTE < cycle )
 printk("\n[DBG] %s : thread %x enter for process %x / vpn %x / cycle %d\n",
 __FUNCTION__ , CURRENT_THREAD , process->pid , vpn , cycle );
@@ -292,6 +292,6 @@
         remote_process_cxy = GET_CXY( remote_process_xp );
 
-#if (CONFIG_DEBUG_VMM_UPDATE_PTE & 0x1)
-if( CONFIG_DEBUG_VMM_UPDATE_PTE < cycle )
+#if (DEBUG_VMM_UPDATE_PTE & 0x1)
+if( DEBUG_VMM_UPDATE_PTE < cycle )
 printk("\n[DBG] %s : thread %x handling process %x in cluster %x\n",
 __FUNCTION__ , CURRENT_THREAD , process->pid , remote_process_cxy );
@@ -305,7 +305,7 @@
     }  
 
-#if CONFIG_DEBUG_VMM_UPDATE_PTE
+#if DEBUG_VMM_UPDATE_PTE
 cycle = (uint32_t)hal_get_cycles();
-if( CONFIG_DEBUG_VMM_UPDATE_PTE < cycle )
+if( DEBUG_VMM_UPDATE_PTE < cycle )
 printk("\n[DBG] %s : thread %x exit for process %x / vpn %x / cycle %d\n",
 __FUNCTION__ , CURRENT_THREAD , process->pid , vpn , cycle );
@@ -338,7 +338,7 @@
     lpid_t          owner_lpid;
 
-#if CONFIG_DEBUG_VMM_SET_COW
+#if DEBUG_VMM_SET_COW
 uint32_t cycle = (uint32_t)hal_get_cycles();
-if( CONFIG_DEBUG_VMM_SET_COW < cycle )
+if( DEBUG_VMM_SET_COW < cycle )
 printk("\n[DBG] %s : thread %x enter for process %x / cycle %d\n",
 __FUNCTION__ , CURRENT_THREAD , process->pid , cycle );
@@ -370,6 +370,6 @@
         remote_process_cxy = GET_CXY( remote_process_xp );
 
-#if (CONFIG_DEBUG_VMM_SET_COW &0x1)
-if( CONFIG_DEBUG_VMM_SET_COW < cycle )
+#if (DEBUG_VMM_SET_COW &0x1)
+if( DEBUG_VMM_SET_COW < cycle )
 printk("\n[DBG] %s : thread %x handling process %x in cluster %x\n",
 __FUNCTION__ , CURRENT_THREAD , process->pid , remote_process_cxy );
@@ -394,6 +394,6 @@
             vpn_t    vpn_size = vseg->vpn_size;
 
-#if (CONFIG_DEBUG_VMM_SET_COW & 0x1)
-if( CONFIG_DEBUG_VMM_SET_COW < cycle )
+#if (DEBUG_VMM_SET_COW & 0x1)
+if( DEBUG_VMM_SET_COW < cycle )
 printk("\n[DBG] %s : thread %x handling vseg %s / vpn_base = %x / vpn_size = %x\n",
 __FUNCTION__, CURRENT_THREAD , vseg_type_str(type), vpn_base, vpn_size );
@@ -445,7 +445,7 @@
     }   // end loop on process copies
  
-#if CONFIG_DEBUG_VMM_SET_COW
+#if DEBUG_VMM_SET_COW
 cycle = (uint32_t)hal_get_cycles();
-if( CONFIG_DEBUG_VMM_SET_COW < cycle )
+if( DEBUG_VMM_SET_COW < cycle )
 printk("\n[DBG] %s : thread %x exit for process %x / cycle %d\n",
 __FUNCTION__ , CURRENT_THREAD , process->pid , cycle );
@@ -480,7 +480,7 @@
     ppn_t       ppn;
 
-#if CONFIG_DEBUG_VMM_FORK_COPY
+#if DEBUG_VMM_FORK_COPY
 uint32_t cycle = (uint32_t)hal_get_cycles();
-if( CONFIG_DEBUG_VMM_FORK_COPY < cycle )
+if( DEBUG_VMM_FORK_COPY < cycle )
 printk("\n[DBG] %s : thread %x enter / cycle %d\n",
 __FUNCTION__ , CURRENT_THREAD, cycle );
@@ -530,7 +530,7 @@
         type = hal_remote_lw( XPTR( parent_cxy , &parent_vseg->type ) );
         
-#if CONFIG_DEBUG_VMM_FORK_COPY
+#if DEBUG_VMM_FORK_COPY
 cycle = (uint32_t)hal_get_cycles();
-if( CONFIG_DEBUG_VMM_FORK_COPY < cycle )
+if( DEBUG_VMM_FORK_COPY < cycle )
 printk("\n[DBG] %s : thread %x found parent vseg %s / vpn_base = %x / cycle %d\n",
 __FUNCTION__ , CURRENT_THREAD, vseg_type_str(type),
@@ -556,7 +556,7 @@
             vseg_attach( child_vmm , child_vseg );
 
-#if CONFIG_DEBUG_VMM_FORK_COPY
+#if DEBUG_VMM_FORK_COPY
 cycle = (uint32_t)hal_get_cycles();
-if( CONFIG_DEBUG_VMM_FORK_COPY < cycle )
+if( DEBUG_VMM_FORK_COPY < cycle )
 printk("\n[DBG] %s : thread %x copied vseg %s / vpn_base = %x to child VSL / cycle %d\n",
 __FUNCTION__ , CURRENT_THREAD , vseg_type_str(type),
@@ -597,7 +597,7 @@
                         hal_remote_atomic_add( XPTR( page_cxy , &page_ptr->forks ) , 1 );
 
-#if CONFIG_DEBUG_VMM_FORK_COPY
+#if DEBUG_VMM_FORK_COPY
 cycle = (uint32_t)hal_get_cycles();
-if( CONFIG_DEBUG_VMM_FORK_COPY < cycle )
+if( DEBUG_VMM_FORK_COPY < cycle )
 printk("\n[DBG] %s : thread %x copied vpn %x to child GPT / cycle %d\n",
 __FUNCTION__ , CURRENT_THREAD , vpn , cycle );
@@ -649,7 +649,7 @@
     hal_fence();
 
-#if CONFIG_DEBUG_VMM_FORK_COPY
+#if DEBUG_VMM_FORK_COPY
 cycle = (uint32_t)hal_get_cycles();
-if( CONFIG_DEBUG_VMM_FORK_COPY < cycle )
+if( DEBUG_VMM_FORK_COPY < cycle )
 printk("\n[DBG] %s : thread %x exit successfully / cycle %d\n",
 __FUNCTION__ , CURRENT_THREAD , cycle );
@@ -666,12 +666,12 @@
 	vseg_t * vseg;
 
-#if CONFIG_DEBUG_VMM_DESTROY
+#if DEBUG_VMM_DESTROY
 uint32_t cycle = (uint32_t)hal_get_cycles();
-if( CONFIG_DEBUG_VMM_DESTROY < cycle )
+if( DEBUG_VMM_DESTROY < cycle )
 printk("\n[DBG] %s : thread %x enter for process %x / cycle %d\n",
 __FUNCTION__ , CURRENT_THREAD , process->pid , cycle );
 #endif
 
-#if (CONFIG_DEBUG_VMM_DESTROY & 1 )
+#if (DEBUG_VMM_DESTROY & 1 )
 vmm_display( process , true );
 #endif
@@ -694,6 +694,6 @@
         vseg    = GET_PTR( vseg_xp );
 
-#if( CONFIG_DEBUG_VMM_DESTROY & 1 )
-if( CONFIG_DEBUG_VMM_DESTROY < cycle )
+#if( DEBUG_VMM_DESTROY & 1 )
+if( DEBUG_VMM_DESTROY < cycle )
 printk("\n[DBG] %s : %s / vpn_base %x / vpn_size %d\n",
 __FUNCTION__ , vseg_type_str( vseg->type ), vseg->vpn_base, vseg->vpn_size );
@@ -728,7 +728,7 @@
     hal_gpt_destroy( &vmm->gpt );
 
-#if CONFIG_DEBUG_VMM_DESTROY
+#if DEBUG_VMM_DESTROY
 cycle = (uint32_t)hal_get_cycles();
-if( CONFIG_DEBUG_VMM_DESTROY < cycle )
+if( DEBUG_VMM_DESTROY < cycle )
 printk("\n[DBG] %s : thread %x exit / cycle %d\n",
 __FUNCTION__ , CURRENT_THREAD , cycle );
@@ -882,7 +882,7 @@
 	error_t      error;
 
-#if CONFIG_DEBUG_VMM_CREATE_VSEG
+#if DEBUG_VMM_CREATE_VSEG
 uint32_t cycle = (uint32_t)hal_get_cycles();
-if( CONFIG_DEBUG_VMM_CREATE_VSEG < cycle )
+if( DEBUG_VMM_CREATE_VSEG < cycle )
 printk("\n[DBG] %s : thread %x enter / process %x / base %x / size %x / %s / cxy %x / cycle %d\n",
 __FUNCTION__, CURRENT_THREAD, process->pid, base, size, vseg_type_str(type), cxy, cycle );
@@ -973,7 +973,7 @@
 	remote_rwlock_wr_unlock( lock_xp );
 
-#if CONFIG_DEBUG_VMM_CREATE_VSEG
+#if DEBUG_VMM_CREATE_VSEG
 cycle = (uint32_t)hal_get_cycles();
-if( CONFIG_DEBUG_VMM_CREATE_VSEG < cycle )
+if( DEBUG_VMM_CREATE_VSEG < cycle )
 printk("\n[DBG] %s : thread %x exit / process %x / %s / cxy %x / cycle %d\n",
 __FUNCTION__, CURRENT_THREAD, process->pid, vseg_type_str(type), cxy, cycle );
@@ -1110,7 +1110,7 @@
     uint32_t    count;      // actual number of pendinf forks
 
-#if CONFIG_DEBUG_VMM_UNMAP_VSEG
+#if DEBUG_VMM_UNMAP_VSEG
 uint32_t cycle = (uint32_t)hal_get_cycles();
-if( CONFIG_DEBUG_VMM_UNMAP_VSEG < cycle )
+if( DEBUG_VMM_UNMAP_VSEG < cycle )
 printk("\n[DBG] %s : thread %x enter / process %x / vseg %s / base %x / cycle %d\n",
 __FUNCTION__, CURRENT_THREAD, process->pid, vseg_type_str( vseg->type ), vseg->vpn_base, cycle );
@@ -1131,6 +1131,6 @@
         { 
 
-#if( CONFIG_DEBUG_VMM_UNMAP_VSEG & 1 )
-if( CONFIG_DEBUG_VMM_UNMAP_VSEG < cycle )
+#if( DEBUG_VMM_UNMAP_VSEG & 1 )
+if( DEBUG_VMM_UNMAP_VSEG < cycle )
 printk("- vpn %x / ppn %x\n" , vpn , ppn );
 #endif
@@ -1183,7 +1183,7 @@
     }
 
-#if CONFIG_DEBUG_VMM_UNMAP_VSEG
+#if DEBUG_VMM_UNMAP_VSEG
 cycle = (uint32_t)hal_get_cycles();
-if( CONFIG_DEBUG_VMM_UNMAP_VSEG < cycle )
+if( DEBUG_VMM_UNMAP_VSEG < cycle )
 printk("\n[DBG] %s : thread %x exit / process %x / vseg %s / base %x / cycle %d\n",
 __FUNCTION__, CURRENT_THREAD, process->pid, vseg_type_str( vseg->type ), vseg->vpn_base, cycle );
@@ -1383,6 +1383,6 @@
 {
 
-#if CONFIG_DEBUG_VMM_ALLOCATE_PAGE
-if( CONFIG_DEBUG_VMM_ALLOCATE_PAGE < (uint32_t)hal_get_cycles() )
+#if DEBUG_VMM_ALLOCATE_PAGE
+if( DEBUG_VMM_ALLOCATE_PAGE < (uint32_t)hal_get_cycles() )
 printk("\n[DBG] in %s : thread %x enter for vpn %x\n",
 __FUNCTION__ , CURRENT_THREAD, vpn );
@@ -1427,6 +1427,6 @@
     }
 
-#if CONFIG_DEBUG_VMM_ALLOCATE_PAGE
-if( CONFIG_DEBUG_VMM_ALLOCATE_PAGE < (uint32_t)hal_get_cycles() )
+#if DEBUG_VMM_ALLOCATE_PAGE
+if( DEBUG_VMM_ALLOCATE_PAGE < (uint32_t)hal_get_cycles() )
 printk("\n[DBG] in %s : thread %x exit for vpn = %d / ppn = %x\n",
 __FUNCTION__ , CURRENT_THREAD, vpn, ppm_page2ppn( XPTR( page_cxy , page_ptr ) ) );
@@ -1452,6 +1452,6 @@
     index     = vpn - vseg->vpn_base;
 
-#if CONFIG_DEBUG_VMM_GET_ONE_PPN 
-if( CONFIG_DEBUG_VMM_GET_ONE_PPN < (uint32_t)hal_get_cycles() )
+#if DEBUG_VMM_GET_ONE_PPN 
+if( DEBUG_VMM_GET_ONE_PPN < (uint32_t)hal_get_cycles() )
 printk("\n[DBG] %s : thread %x enter for vpn = %x / type = %s / index = %d\n",
 __FUNCTION__, CURRENT_THREAD, vpn, vseg_type_str(type), index );
@@ -1515,6 +1515,6 @@
             uint32_t elf_offset = vseg->file_offset + offset;
 
-#if (CONFIG_DEBUG_VMM_GET_ONE_PPN & 0x1)
-if( CONFIG_DEBUG_VMM_GET_ONE_PPN < (uint32_t)hal_get_cycles() )
+#if (DEBUG_VMM_GET_ONE_PPN & 0x1)
+if( DEBUG_VMM_GET_ONE_PPN < (uint32_t)hal_get_cycles() )
 printk("\n[DBG] %s : thread %x for vpn = %x / elf_offset = %x\n",
 __FUNCTION__, CURRENT_THREAD, vpn, elf_offset );
@@ -1530,6 +1530,6 @@
             {
 
-#if (CONFIG_DEBUG_VMM_GET_ONE_PPN & 0x1)
-if( CONFIG_DEBUG_VMM_GET_ONE_PPN < (uint32_t)hal_get_cycles() )
+#if (DEBUG_VMM_GET_ONE_PPN & 0x1)
+if( DEBUG_VMM_GET_ONE_PPN < (uint32_t)hal_get_cycles() )
 printk("\n[DBG] %s : thread%x for vpn = %x / fully in BSS\n",
 __FUNCTION__, CURRENT_THREAD, vpn );
@@ -1548,6 +1548,6 @@
             {
 
-#if (CONFIG_DEBUG_VMM_GET_ONE_PPN & 0x1)
-if( CONFIG_DEBUG_VMM_GET_ONE_PPN < (uint32_t)hal_get_cycles() )
+#if (DEBUG_VMM_GET_ONE_PPN & 0x1)
+if( DEBUG_VMM_GET_ONE_PPN < (uint32_t)hal_get_cycles() )
 printk("\n[DBG] %s : thread %x, for vpn = %x / fully in mapper\n",
 __FUNCTION__, CURRENT_THREAD, vpn );
@@ -1580,6 +1580,6 @@
             {
 
-#if (CONFIG_DEBUG_VMM_GET_ONE_PPN & 0x1)
-if( CONFIG_DEBUG_VMM_GET_ONE_PPN < (uint32_t)hal_get_cycles() )
+#if (DEBUG_VMM_GET_ONE_PPN & 0x1)
+if( DEBUG_VMM_GET_ONE_PPN < (uint32_t)hal_get_cycles() )
 printk("\n[DBG] %s : thread %x for vpn = %x / both mapper & BSS\n"
 "      %d bytes from mapper / %d bytes from BSS\n",
@@ -1627,6 +1627,6 @@
     *ppn = ppm_page2ppn( page_xp );
 
-#if CONFIG_DEBUG_VMM_GET_ONE_PPN
-if( CONFIG_DEBUG_VMM_GET_ONE_PPN < (uint32_t)hal_get_cycles() )
+#if DEBUG_VMM_GET_ONE_PPN
+if( DEBUG_VMM_GET_ONE_PPN < (uint32_t)hal_get_cycles() )
 printk("\n[DBG] %s : thread %x exit for vpn = %x / ppn = %x\n",
 __FUNCTION__ , CURRENT_THREAD , vpn , *ppn );
@@ -1655,8 +1655,8 @@
     "not called in the reference cluster\n" );
 
-#if CONFIG_DEBUG_VMM_GET_PTE
+#if DEBUG_VMM_GET_PTE
 uint32_t cycle = (uint32_t)hal_get_cycles();
-if( CONFIG_DEBUG_VMM_GET_PTE < cycle )
-printk("\n[DBG] %s : thread %x enter for vpn = %x / process %x / cow = %d / cycle %d\n",
+if( DEBUG_VMM_GET_PTE < cycle )
+printk("\n[DBG] %s : thread %x enter / vpn %x / process %x / cow %d / cycle %d\n",
 __FUNCTION__ , CURRENT_THREAD , vpn , process->pid , cow , cycle );
 #endif
@@ -1675,26 +1675,26 @@
     }
 
-#if CONFIG_DEBUG_VMM_GET_PTE
+#if( DEBUG_VMM_GET_PTE & 1 )
 cycle = (uint32_t)hal_get_cycles();
-if( CONFIG_DEBUG_VMM_GET_PTE < cycle )
+if( DEBUG_VMM_GET_PTE < cycle )
 printk("\n[DBG] %s : thread %x found vseg %s / vpn_base = %x / vpn_size = %x\n",
 __FUNCTION__, CURRENT_THREAD, vseg_type_str(vseg->type), vseg->vpn_base, vseg->vpn_size );
 #endif
 
-    // access GPT to get current PTE attributes and PPN
-    hal_gpt_get_pte( &vmm->gpt , vpn , &old_attr , &old_ppn );
-
-    // for both "copy_on_write" and "page_fault" events, allocate a physical page,
-    // initialize it, register it in the reference GPT, update GPT copies in all
-    // clusters containing a copy, and return the new_ppn and new_attr
-
-    if( cow )  /////////////////////////// copy_on_write request //////////////////////
-    {
+    if( cow )  //////////////// copy_on_write request //////////////////////
+               // get PTE from reference GPT
+               // allocate a new physical page if there is pending forks,
+               // initialize it from old physical page content,
+               // update PTE in all GPT copies, 
+    {
+        // access GPT to get current PTE attributes and PPN
+        hal_gpt_get_pte( &vmm->gpt , vpn , &old_attr , &old_ppn );
+
         assert( (old_attr & GPT_MAPPED) , __FUNCTION__ , 
         "PTE must be mapped for a copy-on-write exception\n" );
 
-#if CONFIG_DEBUG_VMM_GET_PTE
+#if( DEBUG_VMM_GET_PTE & 1 )
 cycle = (uint32_t)hal_get_cycles();
-if( CONFIG_DEBUG_VMM_GET_PTE < cycle )
+if( DEBUG_VMM_GET_PTE < cycle )
 printk("\n[DBG] %s : thread %x handling COW for vpn %x in process %x\n",
 __FUNCTION__, CURRENT_THREAD, vpn, process->pid );
@@ -1744,12 +1744,18 @@
         hal_remote_atomic_add( XPTR( page_cxy , &page_ptr->forks ) , -1 );
     }
-    else  ////////////////////////////////// page_fault request ////////////////////////
+    else        //////////// page_fault request ///////////////////////////
+                // get PTE from reference GPT
+                // allocate a physical page if it is a true page fault,
+                // register in reference GPT, but don't update GPT copies
     {  
+        // access GPT to get current PTE 
+        hal_gpt_get_pte( &vmm->gpt , vpn , &old_attr , &old_ppn );
+
         if( (old_attr & GPT_MAPPED) == 0 )   // true page_fault => map it
         {
 
-#if CONFIG_DEBUG_VMM_GET_PTE
+#if( DEBUG_VMM_GET_PTE & 1 )
 cycle = (uint32_t)hal_get_cycles();
-if( CONFIG_DEBUG_VMM_GET_PTE < cycle )
+if( DEBUG_VMM_GET_PTE < cycle )
 printk("\n[DBG] %s : thread %x handling page fault for vpn %x in process %x\n",
 __FUNCTION__, CURRENT_THREAD, vpn, process->pid );
@@ -1792,12 +1798,12 @@
     }
 
-#if CONFIG_DEBUG_VMM_GET_PTE
+#if DEBUG_VMM_GET_PTE
 cycle = (uint32_t)hal_get_cycles();
-if( CONFIG_DEBUG_VMM_GET_PTE < cycle )
-printk("\n[DBG] %s : thread,%x exit for vpn %x in process %x / ppn = %x / attr = %x / cycle %d\n",
+if( DEBUG_VMM_GET_PTE < cycle )
+printk("\n[DBG] %s : thread,%x exit / vpn %x in process %x / ppn %x / attr %x / cycle %d\n",
 __FUNCTION__, CURRENT_THREAD, vpn, process->pid, new_ppn, new_attr, cycle );
 #endif
 
-    // return success
+    // return PPN and flags
     *ppn  = new_ppn;
     *attr = new_attr;
@@ -1814,7 +1820,7 @@
     error_t          error;
 
-#if CONFIG_DEBUG_VMM_GET_PTE
+#if DEBUG_VMM_GET_PTE
 uint32_t cycle = (uint32_t)hal_get_cycles();
-if( CONFIG_DEBUG_VMM_GET_PTE < cycle )
+if( DEBUG_VMM_GET_PTE < cycle )
 printk("\n[DBG] %s : thread %x enter for vpn %x / process %x / cycle %d\n",
 __FUNCTION__ , CURRENT_THREAD , vpn , process->pid , cycle );
@@ -1854,7 +1860,7 @@
     }
 
-#if CONFIG_DEBUG_VMM_GET_PTE
+#if DEBUG_VMM_GET_PTE
 cycle = (uint32_t)hal_get_cycles();
-if( CONFIG_DEBUG_VMM_GET_PTE < cycle )
+if( DEBUG_VMM_GET_PTE < cycle )
 printk("\n[DBG] %s : thread %x exit for vpn %x / process %x / cycle %d\n",
 __FUNCTION__ , CURRENT_THREAD , vpn , process->pid , cycle );
@@ -1873,7 +1879,7 @@
     error_t          error;
 
-#if CONFIG_DEBUG_VMM_GET_PTE
+#if DEBUG_VMM_GET_PTE
 uint32_t cycle = (uint32_t)hal_get_cycles();
-if( CONFIG_DEBUG_VMM_GET_PTE < cycle )
+if( DEBUG_VMM_GET_PTE < cycle )
 printk("\n[DBG] %s : thread %x enter for vpn %x / process %x / cycle %d\n",
 __FUNCTION__ , CURRENT_THREAD , vpn , process->pid , cycle );
@@ -1913,7 +1919,7 @@
     }
 
-#if CONFIG_DEBUG_VMM_GET_PTE
+#if DEBUG_VMM_GET_PTE
 cycle = (uint32_t)hal_get_cycles();
-if( CONFIG_DEBUG_VMM_GET_PTE < cycle )
+if( DEBUG_VMM_GET_PTE < cycle )
 printk("\n[DBG] %s : thread %x exit for vpn %x / process %x / cycle %d\n",
 __FUNCTION__ , CURRENT_THREAD , vpn , process->pid , cycle );
