[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] xen: show unmapped but valid grants in debug dump



This is useful to help determine if a grant table entry has been
properly set up even when the grant is not currently mapped, or to view
grant table entries that are used for operations other than mapping.

This also cleans up the output a bit by moving the header next to the
entries and fixing the display of 4-digit grant references.

Signed-off-by: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>
---
 xen/common/grant_table.c |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 07f58f3..23c553a 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -2613,9 +2613,6 @@ void gnttab_usage_print(struct domain *rd)
     grant_ref_t ref;
     struct grant_table *gt = rd->grant_table;
 
-    printk("      -------- active --------       -------- shared --------\n");
-    printk("[ref] localdom mfn      pin          localdom gmfn     flags\n");
-
     spin_lock(&gt->lock);
 
     if ( gt->gt_version == 0 )
@@ -2631,8 +2628,6 @@ void gnttab_usage_print(struct domain *rd)
         uint64_t frame;
 
         act = &active_entry(gt, ref);
-        if ( !act->pin )
-            continue;
 
         sha = shared_entry_header(gt, ref);
 
@@ -2651,15 +2646,21 @@ void gnttab_usage_print(struct domain *rd)
             status = status_entry(gt, ref);
         }
 
+        if ( !act->pin && !status )
+            continue;
+
         if ( first )
         {
             printk("grant-table for remote domain:%5d (v%d)\n",
                    rd->domain_id, gt->gt_version);
+            printk("      -------- active --------       -------- shared 
--------\n");
+            printk("[ref] localdom mfn      pin          localdom gmfn     
flags\n");
+
             first = 0;
         }
 
-        /*      [ddd]    ddddd 0xXXXXXX 0xXXXXXXXX      ddddd 0xXXXXXX 0xXX */
-        printk("[%3d]    %5d 0x%06lx 0x%08x      %5d 0x%06"PRIx64" 0x%02x\n",
+        /*      [dddd]   ddddd 0xXXXXXX 0xXXXXXXXX      ddddd 0xXXXXXX 0xXX */
+        printk("[%4d]   %5d 0x%06lx 0x%08x      %5d 0x%06"PRIx64" 0x%02x\n",
                ref, act->domid, act->frame, act->pin,
                sha->domid, frame, status);
     }
@@ -2668,8 +2669,8 @@ void gnttab_usage_print(struct domain *rd)
     spin_unlock(&gt->lock);
 
     if ( first )
-        printk("grant-table for remote domain:%5d ... "
-               "no active grant table entries\n", rd->domain_id);
+        printk("grant-table for remote domain:%5d (v%d) ... "
+               "no active grant table entries\n", rd->domain_id, 
gt->gt_version);
 }
 
 static void gnttab_usage_print_all(unsigned char key)
-- 
1.7.6.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.