Index: trunk/kernel/mm/vmm.c
===================================================================
--- trunk/kernel/mm/vmm.c	(revision 633)
+++ trunk/kernel/mm/vmm.c	(revision 634)
@@ -1906,5 +1906,5 @@
 
 #if DEBUG_VMM_HANDLE_PAGE_FAULT
-if( vpn == 0x40b )
+if( (start_cycle > DEBUG_VMM_HANDLE_PAGE_FAULT) && (vpn == vpn) )
 printk("\n[%s] thread[%x,%x] enter for vpn %x / cycle %d\n",
 __FUNCTION__, this->process->pid, this->trdid, vpn, start_cycle );
@@ -1912,4 +1912,5 @@
 
 #if (DEBUG_VMM_HANDLE_PAGE_FAULT & 1)
+if( (start_cycle > DEBUG_VMM_HANDLE_PAGE_FAULT) && (vpn == vpn) )
 hal_vmm_display( this->process , false );
 #endif
@@ -1928,8 +1929,7 @@
 
 #if DEBUG_VMM_HANDLE_PAGE_FAULT
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( vpn == 0x40b )
-printk("\n[%s] thread[%x,%x] found vseg %s / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, vseg_type_str(vseg->type), cycle );
+if( (start_cycle > DEBUG_VMM_HANDLE_PAGE_FAULT) && (vpn == vpn) )
+printk("\n[%s] thread[%x,%x] found vseg %s\n",
+__FUNCTION__, this->process->pid, this->trdid, vseg_type_str(vseg->type) );
 #endif
 
@@ -1951,8 +1951,7 @@
 
 #if DEBUG_VMM_HANDLE_PAGE_FAULT
-cycle = (uint32_t)hal_get_cycles();
-if( vpn == 0x40b )
+if( (start_cycle > DEBUG_VMM_HANDLE_PAGE_FAULT) && (vpn == vpn) )
 printk("\n[%s] thread[%x,%x] locked vpn %x in cluster %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, vpn, local_cxy, cycle );
+__FUNCTION__, this->process->pid, this->trdid, vpn, local_cxy );
 #endif
 
@@ -1972,6 +1971,6 @@
 
 #if DEBUG_VMM_HANDLE_PAGE_FAULT
-if( vpn == 0x40b )
-printk("\n[%s] thread[%x,%x] : access local gpt : local_cxy %x / ref_cxy %x / type %s\n",
+if( (start_cycle > DEBUG_VMM_HANDLE_PAGE_FAULT) && (vpn == vpn) )
+printk("\n[%s] thread[%x,%x] access local gpt : cxy %x / ref_cxy %x / type %s\n",
 __FUNCTION__, this->process->pid, this->trdid, local_cxy, ref_cxy, vseg_type_str(vseg->type) );
 #endif
@@ -2009,5 +2008,5 @@
 
 #if DEBUG_VMM_HANDLE_PAGE_FAULT
-if( vpn == 0x40b )
+if( (end_cycle > DEBUG_VMM_HANDLE_PAGE_FAULT) && (vpn == vpn) )
 printk("\n[%s] thread[%x,%x] handled local pgfault / ppn %x / attr %x / cycle %d\n",
 __FUNCTION__, this->process->pid, this->trdid, ppn, attr, end_cycle );
@@ -2028,6 +2027,6 @@
 
 #if DEBUG_VMM_HANDLE_PAGE_FAULT
-if( vpn == 0x40b )
-printk("\n[%s] thread[%x,%x] access ref gpt : local_cxy %x / ref_cxy %x / type %s\n",
+if( (start_cycle > DEBUG_VMM_HANDLE_PAGE_FAULT) && (vpn == vpn) )
+printk("\n[%s] thread[%x,%x] access ref gpt : cxy %x / ref_cxy %x / type %s\n",
 __FUNCTION__, this->process->pid, this->trdid, local_cxy, ref_cxy, vseg_type_str(vseg->type) );
 #endif
@@ -2052,5 +2051,5 @@
 
 #if DEBUG_VMM_HANDLE_PAGE_FAULT
-if( vpn == 0x40b )
+if( (start_cycle > DEBUG_VMM_HANDLE_PAGE_FAULT) && (vpn == vpn) )
 printk("\n[%s] thread[%x,%x] get pte from ref gpt / attr %x / ppn %x\n",
 __FUNCTION__, this->process->pid, this->trdid, ref_attr, ref_ppn );
@@ -2067,5 +2066,5 @@
 
 #if DEBUG_VMM_HANDLE_PAGE_FAULT
-if( vpn == 0x40b )
+if( (start_cycle > DEBUG_VMM_HANDLE_PAGE_FAULT) && (vpn == vpn) )
 printk("\n[%s] thread[%x,%x] updated local gpt for a false pgfault\n",
 __FUNCTION__, this->process->pid, this->trdid );
@@ -2076,5 +2075,5 @@
                              
 #if DEBUG_VMM_HANDLE_PAGE_FAULT
-if( vpn == 0x40b )
+if( (start_cycle > DEBUG_VMM_HANDLE_PAGE_FAULT) && (vpn == vpn) )
 printk("\n[%s] thread[%x,%x] unlock the ref gpt after a false pgfault\n",
 __FUNCTION__, this->process->pid, this->trdid );
@@ -2086,5 +2085,5 @@
 
 #if DEBUG_VMM_HANDLE_PAGE_FAULT
-if( vpn == 0x40b )
+if( (end_cycle > DEBUG_VMM_HANDLE_PAGE_FAULT) && (vpn == vpn) )
 printk("\n[%s] thread[%x,%x] handled false pgfault / ppn %x / attr %x / cycle %d\n",
 __FUNCTION__, this->process->pid, this->trdid, ref_ppn, ref_attr, end_cycle );
@@ -2122,5 +2121,5 @@
 
 #if DEBUG_VMM_HANDLE_PAGE_FAULT
-if( vpn == 0x40b )
+if( (start_cycle > DEBUG_VMM_HANDLE_PAGE_FAULT) && (vpn == vpn) )
 printk("\n[%s] thread[%x,%x] build a new PTE for a true pgfault\n",
 __FUNCTION__, this->process->pid, this->trdid );
@@ -2134,5 +2133,5 @@
 
 #if DEBUG_VMM_HANDLE_PAGE_FAULT
-if( vpn == 0x40b )
+if( (start_cycle > DEBUG_VMM_HANDLE_PAGE_FAULT) && (vpn == vpn) )
 printk("\n[%s] thread[%x,%x] set new PTE in ref gpt for a true page fault\n",
 __FUNCTION__, this->process->pid, this->trdid );
@@ -2151,5 +2150,5 @@
 
 #if DEBUG_VMM_HANDLE_PAGE_FAULT
-if( vpn == 0x40b )
+if( (end_cycle > DEBUG_VMM_HANDLE_PAGE_FAULT) && (vpn == vpn) )
 printk("\n[%s] thread[%x,%x] handled global pgfault / ppn %x / attr %x / cycle %d\n",
 __FUNCTION__, this->process->pid, this->trdid, ppn, attr, end_cycle );
@@ -2174,5 +2173,5 @@
 
 #if DEBUG_VMM_HANDLE_PAGE_FAULT
-if( vpn == 0x40b )
+if( (end_cycle > DEBUG_VMM_HANDLE_PAGE_FAULT) && (vpn == vpn) )
 printk("\n[%s] handled by another thread / vpn %x / ppn %x / attr %x / cycle %d\n",
 __FUNCTION__, vpn, ppn, attr, end_cycle );
