debuggers.hg

changeset 21063:83a8e561f3ff

Fix grant table debug key.

Must skip domains with gt_version==0.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Mar 09 12:32:04 2010 +0000 (2010-03-09)
parents 94bfa0959297
children 5f08fd0d6249
files xen/common/grant_table.c
line diff
     1.1 --- a/xen/common/grant_table.c	Tue Mar 09 12:29:10 2010 +0000
     1.2 +++ b/xen/common/grant_table.c	Tue Mar 09 12:32:04 2010 +0000
     1.3 @@ -2551,13 +2551,17 @@ void gnttab_usage_print(struct domain *r
     1.4  {
     1.5      int first = 1;
     1.6      grant_ref_t ref;
     1.7 +    struct grant_table *gt = rd->grant_table;
     1.8  
     1.9      printk("      -------- active --------       -------- shared --------\n");
    1.10      printk("[ref] localdom mfn      pin          localdom gmfn     flags\n");
    1.11  
    1.12 -    spin_lock(&rd->grant_table->lock);
    1.13 +    spin_lock(&gt->lock);
    1.14  
    1.15 -    for ( ref = 0; ref != nr_grant_entries(rd->grant_table); ref++ )
    1.16 +    if ( gt->gt_version == 0 )
    1.17 +        goto out;
    1.18 +
    1.19 +    for ( ref = 0; ref != nr_grant_entries(gt); ref++ )
    1.20      {
    1.21          struct active_grant_entry *act;
    1.22          struct grant_entry_header *sha;
    1.23 @@ -2566,31 +2570,31 @@ void gnttab_usage_print(struct domain *r
    1.24          uint16_t status;
    1.25          uint64_t frame;
    1.26  
    1.27 -        act = &active_entry(rd->grant_table, ref);
    1.28 +        act = &active_entry(gt, ref);
    1.29          if ( !act->pin )
    1.30              continue;
    1.31  
    1.32 -        sha = shared_entry_header(rd->grant_table, ref);
    1.33 +        sha = shared_entry_header(gt, ref);
    1.34  
    1.35 -        if ( rd->grant_table->gt_version == 1 )
    1.36 +        if ( gt->gt_version == 1 )
    1.37          {
    1.38 -            sha1 = &shared_entry_v1(rd->grant_table, ref);
    1.39 +            sha1 = &shared_entry_v1(gt, ref);
    1.40              sha2 = NULL;
    1.41              status = sha->flags;
    1.42              frame = sha1->frame;
    1.43          }
    1.44          else
    1.45          {
    1.46 -            sha2 = &shared_entry_v2(rd->grant_table, ref);
    1.47 +            sha2 = &shared_entry_v2(gt, ref);
    1.48              sha1 = NULL;
    1.49              frame = sha2->full_page.frame;
    1.50 -            status = status_entry(rd->grant_table, ref);
    1.51 +            status = status_entry(gt, ref);
    1.52          }
    1.53  
    1.54          if ( first )
    1.55          {
    1.56              printk("grant-table for remote domain:%5d (v%d)\n",
    1.57 -                   rd->domain_id, rd->grant_table->gt_version);
    1.58 +                   rd->domain_id, gt->gt_version);
    1.59              first = 0;
    1.60          }
    1.61  
    1.62 @@ -2600,7 +2604,8 @@ void gnttab_usage_print(struct domain *r
    1.63                 sha->domid, frame, status);
    1.64      }
    1.65  
    1.66 -    spin_unlock(&rd->grant_table->lock);
    1.67 + out:
    1.68 +    spin_unlock(&gt->lock);
    1.69  
    1.70      if ( first )
    1.71          printk("grant-table for remote domain:%5d ... "