ia64/xen-unstable

changeset 4051:e61e2c666c53

bitkeeper revision 1.1236.19.2 (422f40f3l62sGOkmaI-pc1lI7OvE-A)

audit_pagelist added for debugging.
Signed-off-by: ian@xensource.com
author iap10@freefall.cl.cam.ac.uk
date Wed Mar 09 18:31:15 2005 +0000 (2005-03-09)
parents 4b51c55ba441
children a38777f9f099
files xen/arch/x86/mm.c
line diff
     1.1 --- a/xen/arch/x86/mm.c	Wed Mar 09 18:26:32 2005 +0000
     1.2 +++ b/xen/arch/x86/mm.c	Wed Mar 09 18:31:15 2005 +0000
     1.3 @@ -104,7 +104,7 @@
     1.4  
     1.5  #ifdef VERBOSE
     1.6  #define MEM_LOG(_f, _a...)                           \
     1.7 -  printk("DOM%u: (file=memory.c, line=%d) " _f "\n", \
     1.8 +  printk("DOM%u: (file=mm.c, line=%d) " _f "\n", \
     1.9           current->domain->id , __LINE__ , ## _a )
    1.10  #else
    1.11  #define MEM_LOG(_f, _a...) ((void)0)
    1.12 @@ -2566,6 +2566,31 @@ void ptwr_status(void)
    1.13      page = &frame_table[pfn];
    1.14  }
    1.15  
    1.16 +void audit_pagelist(struct domain *d)
    1.17 +{
    1.18 +    struct list_head *list_ent;
    1.19 +    int xenpages, totpages;
    1.20 +
    1.21 +    list_ent = d->xenpage_list.next;
    1.22 +    for ( xenpages = 0; (list_ent != &d->xenpage_list); xenpages++ )
    1.23 +    {
    1.24 +        list_ent = list_ent->next;
    1.25 +    }
    1.26 +    list_ent = d->page_list.next;
    1.27 +    for ( totpages = 0; (list_ent != &d->page_list); totpages++ )
    1.28 +    {
    1.29 +        list_ent = list_ent->next;
    1.30 +    }
    1.31 +
    1.32 +    if ( xenpages != d->xenheap_pages ||
    1.33 +         totpages != d->tot_pages )
    1.34 +    {
    1.35 +        printk("ARGH! dom %d: xen=%d %d, pages=%d %d\n",
    1.36 +               xenpages, d->xenheap_pages, 
    1.37 +               totpages, d->tot_pages );
    1.38 +    }
    1.39 +}
    1.40 +
    1.41  void audit_domain(struct domain *d)
    1.42  {
    1.43      int ttot=0, ctot=0, io_mappings=0, lowmem_mappings=0;
    1.44 @@ -2669,6 +2694,8 @@ void audit_domain(struct domain *d)
    1.45             
    1.46      spin_lock(&d->page_alloc_lock);
    1.47  
    1.48 +    audit_pagelist(d);
    1.49 +
    1.50      /* PHASE 0 */
    1.51  
    1.52      list_ent = d->page_list.next;
    1.53 @@ -2969,13 +2996,13 @@ void audit_domain(struct domain *d)
    1.54          list_ent = frame_table[pfn].list.next;
    1.55      }
    1.56  
    1.57 -    spin_unlock(&d->page_alloc_lock);
    1.58  
    1.59      if ( pagetable_val(d->exec_domain[0]->arch.guest_table) )
    1.60          adjust(&frame_table[pagetable_val(
    1.61              d->exec_domain[0]->arch.guest_table)>>PAGE_SHIFT], 1, 1);
    1.62  
    1.63 -    printk("Audit %d: Done. pages=%d l1=%d l2=%d ctot=%d ttot=%d\n", d->id, i, l1, l2, ctot, ttot );
    1.64 +    spin_unlock(&d->page_alloc_lock);
    1.65 +    printk("Audit %d: Done. ref=%d xenpages=%d pages=%d l1=%d l2=%d ctot=%d ttot=%d\n", d->id, atomic_read(&d->refcnt), d->xenheap_pages, d->tot_pages, l1, l2, ctot, ttot );
    1.66  
    1.67      if ( d != current->domain )
    1.68          domain_unpause(d);