WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: Keir Fraser <keir@xxxxxxx>
Subject: [Xen-devel] [PATCH] xen: show unmapped but valid grants in debug dump
From: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>
Date: Fri, 4 Nov 2011 16:19:25 -0400
Cc: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Fri, 04 Nov 2011 13:21:02 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] xen: show unmapped but valid grants in debug dump, Daniel De Graaf <=