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

Re: [Xen-devel] [PATCH 1/5] VT-d support for PV guests

To: "Espen Skoglund" <espen.skoglund@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 1/5] VT-d support for PV guests
From: "Jan Beulich" <jbeulich@xxxxxxxxxx>
Date: Tue, 20 May 2008 08:14:20 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 20 May 2008 00:14:27 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <18481.58194.426124.386871@xxxxxxxxxxxxxxxxxx>
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <18481.58194.426124.386871@xxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
>--- a/xen/arch/x86/domain.c    Mon May 19 20:32:22 2008 +0100
>+++ b/xen/arch/x86/domain.c    Mon May 19 20:42:54 2008 +0100
>@@ -127,12 +127,15 @@
> void dump_pageframe_info(struct domain *d)
> {
>     struct page_info *page;
>+    int cnt[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
> 
>     printk("Memory pages belonging to domain %u:\n", d->domain_id);
> 
>     if ( d->tot_pages >= 10 )
>     {
>         printk("    DomPage list too long to display\n");
>+        list_for_each_entry ( page, &d->page_list, list )
>+            cnt[(page->u.inuse.type_info >> 29) & 0x7]++;
>     }
>     else
>     {
>@@ -141,8 +144,12 @@
>             printk("    DomPage %p: caf=%08x, taf=%" PRtype_info "\n",
>                    _p(page_to_mfn(page)),
>                    page->count_info, page->u.inuse.type_info);
>+            cnt[(page->u.inuse.type_info >> 29) & 0x7]++;
>         }
>     }
>+    printk("    TypeCnt "
>+           "{ none %d, L1 %d, L2 %d, L3 %d, L4 %d, seg %d, rw %d }\n",
>+           cnt[0], cnt[1], cnt[2], cnt[3], cnt[4], cnt[5], cnt[7]);
> 
>     list_for_each_entry ( page, &d->xenpage_list, list )
>     {

Even if just used for debug output, I think using hard-coded numbers here
is as unacceptable as it would be anywhere else.

Jan


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

<Prev in Thread] Current Thread [Next in Thread>