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] Allow building with perfc and perfc_arrays

To: Ben Thomas <bthomas@xxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] Allow building with perfc and perfc_arrays
From: Chris Wright <chrisw@xxxxxxxxxxxx>
Date: Thu, 16 Feb 2006 13:26:43 -0800
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 16 Feb 2006 21:36:09 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <43F4D80C.4050308@xxxxxxxxxxxxxxx>
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: <43F4D80C.4050308@xxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.2.1i
* Ben Thomas (bthomas@xxxxxxxxxxxxxxx) wrote:
> Attempts to build with either perfc or perfc_arrays fails.  Some of
> this is specific to the platform (eg, __x86_64__).  Add simple-minded
> fixes to allow building with these options.
> 
> This patch resolves these issues and now builds on i386 and x86_64

I was just doing similar.  Only real difference I had was just using
char in the dom0_perfc_desc instead of the char* cast.

 typedef struct dom0_perfc_desc {
-    uint8_t      name[80];             /* name of perf counter */
+    char         name[80];             /* name of perf counter */

And a typo fix, which you accidentally propagate.

+PERFCOUNTER_CPU(apshot_pages,            "apshot_pages")

I had simply done:

-        perfc_decr(apshot_pages);
+        perfc_decr(snapshot_pages);

Accidental conversion to percpu counter of a couple of these.  And,
finally, this isn't quite enough for PAE.

Here's my patch, mind taking a double check?

thanks,
-chris
--

Fix Xen builds with perfc=y and perfc_arrays=y.

Signed-off-by: Chris Wright <chrisw@xxxxxxxxxxxx>
---

diff -r 2b0078f771cc xen/arch/x86/shadow_public.c
--- a/xen/arch/x86/shadow_public.c      Thu Feb 16 17:37:21 2006 +0100
+++ b/xen/arch/x86/shadow_public.c      Thu Feb 16 16:17:02 2006 -0500
@@ -672,7 +672,7 @@ void free_shadow_page(unsigned long smfn
         break;
 #endif
     case PGT_snapshot:
-        perfc_decr(apshot_pages);
+        perfc_decr(snapshot_pages);
         break;
 
     default:
diff -r 2b0078f771cc xen/include/public/dom0_ops.h
--- a/xen/include/public/dom0_ops.h     Thu Feb 16 17:37:21 2006 +0100
+++ b/xen/include/public/dom0_ops.h     Thu Feb 16 16:17:02 2006 -0500
@@ -311,7 +311,7 @@ typedef struct dom0_read_memtype {
 #define DOM0_PERFCCONTROL_OP_RESET 1   /* Reset all counters to zero. */
 #define DOM0_PERFCCONTROL_OP_QUERY 2   /* Get perfctr information. */
 typedef struct dom0_perfc_desc {
-    uint8_t      name[80];             /* name of perf counter */
+    char         name[80];             /* name of perf counter */
     uint32_t     nr_vals;              /* number of values for this counter */
     uint32_t     vals[64];             /* array of values */
 } dom0_perfc_desc_t;
diff -r 2b0078f771cc xen/include/xen/perfc_defn.h
--- a/xen/include/xen/perfc_defn.h      Thu Feb 16 17:37:21 2006 +0100
+++ b/xen/include/xen/perfc_defn.h      Thu Feb 16 16:17:02 2006 -0500
@@ -14,6 +14,12 @@ PERFCOUNTER_ARRAY(shm_l2_updates,       
                   PERFC_MAX_PT_UPDATES)
 PERFCOUNTER_ARRAY(shm_hl2_updates,      "shadow mode HL2 pt updates",
                   PERFC_MAX_PT_UPDATES)
+#if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE)
+PERFCOUNTER_ARRAY(shm_l3_updates,       "shadow mode L3 pt updates",
+                  PERFC_MAX_PT_UPDATES)
+PERFCOUNTER_ARRAY(shm_l4_updates,       "shadow mode L4 pt updates",
+                  PERFC_MAX_PT_UPDATES)
+#endif
 PERFCOUNTER_ARRAY(snapshot_copies,      "entries copied per snapshot",
                   PERFC_MAX_PT_UPDATES)
 
@@ -60,6 +66,10 @@ PERFCOUNTER_CPU(map_domain_page_count,  
 PERFCOUNTER_CPU(map_domain_page_count,  "map_domain_page count")
 PERFCOUNTER_CPU(ptwr_emulations,        "writable pt emulations")
 
+#if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE)
+PERFCOUNTER_CPU(shadow_l4_table_count,  "shadow_l4_table count")
+PERFCOUNTER_CPU(shadow_l3_table_count,  "shadow_l3_table count")
+#endif
 PERFCOUNTER_CPU(shadow_l2_table_count,  "shadow_l2_table count")
 PERFCOUNTER_CPU(shadow_l1_table_count,  "shadow_l1_table count")
 PERFCOUNTER_CPU(unshadow_table_count,   "unshadow_table count")
@@ -68,6 +78,10 @@ PERFCOUNTER_CPU(shadow_update_va_fail2, 
 PERFCOUNTER_CPU(shadow_update_va_fail2, "shadow_update_va_fail2")
 
 /* STATUS counters do not reset when 'P' is hit */
+#if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE)
+PERFSTATUS(shadow_l4_pages,             "current # shadow L4 pages")
+PERFSTATUS(shadow_l3_pages,             "current # shadow L3 pages")
+#endif
 PERFSTATUS(shadow_l2_pages,             "current # shadow L2 pages")
 PERFSTATUS(shadow_l1_pages,             "current # shadow L1 pages")
 PERFSTATUS(hl2_table_pages,             "current # hl2 pages")
@@ -82,6 +96,10 @@ PERFCOUNTER_CPU(shadow_set_l1e_force_map
 PERFCOUNTER_CPU(shadow_set_l1e_force_map, "shadow_set_l1e forced to map l1")
 PERFCOUNTER_CPU(shadow_set_l1e_unlinked, "shadow_set_l1e found unlinked l1")
 PERFCOUNTER_CPU(shadow_set_l1e_fail,    "shadow_set_l1e failed (no sl1)")
+#if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE)
+PERFCOUNTER_CPU(shadow_set_l2e_force_map, "shadow_set_l2e forced to map l2")
+PERFCOUNTER_CPU(shadow_set_l3e_force_map, "shadow_set_l3e forced to map l3")
+#endif
 PERFCOUNTER_CPU(shadow_invlpg_faults,   "shadow_invlpg's get_user faulted")
 PERFCOUNTER_CPU(unshadow_l2_count,      "unpinned L2 count")
 
@@ -95,6 +113,10 @@ PERFCOUNTER_CPU(shadow_sync_va,         
 PERFCOUNTER_CPU(shadow_sync_va,         "calls to shadow_sync_va")
 PERFCOUNTER_CPU(resync_l1,              "resync L1 page")
 PERFCOUNTER_CPU(resync_l2,              "resync L2 page")
+#if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE)
+PERFCOUNTER_CPU(resync_l3,              "resync L3 page")
+PERFCOUNTER_CPU(resync_l4,              "resync L4 page")
+#endif
 PERFCOUNTER_CPU(resync_hl2,             "resync HL2 page")
 PERFCOUNTER_CPU(shadow_make_snapshot,   "snapshots created")
 PERFCOUNTER_CPU(shadow_mark_mfn_out_of_sync_calls,
@@ -113,6 +135,9 @@ PERFCOUNTER_CPU(shadow_get_page_fail,   
 PERFCOUNTER_CPU(shadow_get_page_fail,   "shadow_get_page_from_l1e fails")
 PERFCOUNTER_CPU(validate_hl2e_calls,    "calls to validate_hl2e_change")
 PERFCOUNTER_CPU(validate_hl2e_changes,  "validate_hl2e makes changes")
+#if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE)
+PERFCOUNTER_CPU(validate_entry_changes,  "validate_entry changes")
+#endif
 PERFCOUNTER_CPU(exception_fixed,        "pre-exception fixed")
 PERFCOUNTER_CPU(get_mfn_from_gpfn_foreign, "calls to 
get_mfn_from_gpfn_foreign")
 PERFCOUNTER_CPU(remove_all_access,      "calls to remove_all_access")

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