All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH]  Allow building with perfc and perfc_arrays
@ 2006-02-16 19:52 Ben Thomas
  2006-02-16 21:26 ` Chris Wright
  0 siblings, 1 reply; 4+ messages in thread
From: Ben Thomas @ 2006-02-16 19:52 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 303 bytes --]

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


Signed-off-by: Ben Thomas (ben@virtualiron.com)




[-- Attachment #2: perfc.tip --]
[-- Type: text/plain, Size: 2158 bytes --]

# HG changeset patch
# Node ID 3a3b034fde8c6644465b1a9d4135142a75740a34
# Parent  1ca3d63e70082c57dd918b0875d28ad679f842a2


building with perfc fails -> simple fix
building with perfc and perfc_arrays on x86_64 fails -> do the
     simple-minded thing and just add the missing elements


diff -r 1ca3d63e7008 -r 3a3b034fde8c xen/common/perfc.c
--- a/xen/common/perfc.c	Wed Feb 15 22:06:12 2006 +0000
+++ b/xen/common/perfc.c	Thu Feb 16 14:50:21 2006 -0500
@@ -144,7 +144,7 @@ static int perfc_copy_info(dom0_perfc_de
     {
         for ( i = 0; i < NR_PERFCTRS; i++ )
         {
-            strncpy(perfc_d[i].name, perfc_info[i].name,
+            strncpy((char *)perfc_d[i].name, perfc_info[i].name,
                     sizeof(perfc_d[i].name));
             perfc_d[i].name[sizeof(perfc_d[i].name)-1] = '\0';
 
diff -r 1ca3d63e7008 -r 3a3b034fde8c xen/include/xen/perfc_defn.h
--- a/xen/include/xen/perfc_defn.h	Wed Feb 15 22:06:12 2006 +0000
+++ b/xen/include/xen/perfc_defn.h	Thu Feb 16 14:50:21 2006 -0500
@@ -125,4 +125,26 @@ PERFCOUNTER_CPU(remove_write_bad_predict
 PERFCOUNTER_CPU(remove_write_bad_prediction, "remove_write bad prediction")
 PERFCOUNTER_CPU(update_hl2e_invlpg,     "update_hl2e calls invlpg")
 
+/* perfc */
+
+#ifdef __x86_64__
+PERFCOUNTER_CPU(validate_entry_changes,  "validate_entry_changes")
+PERFCOUNTER_CPU(shadow_l3_pages,         "shadow_l3_pages")
+PERFCOUNTER_CPU(shadow_l4_pages,         "shadow_l4_pages")
+PERFCOUNTER_CPU(shadow_set_l2e_force_map,"shadow_set_l3e_force_map")
+PERFCOUNTER_CPU(shadow_set_l3e_force_map,"shadow_set_l3e_force_map")
+PERFCOUNTER_CPU(resync_l3,		 "resync_l3")
+PERFCOUNTER_CPU(resync_l4,		 "resync_l4")
+PERFCOUNTER_CPU(shadow_l3_table_count,	 "shadow_l3_table_count")
+PERFCOUNTER_CPU(shadow_l4_table_count,	 "shadow_l4_table_count")
+PERFCOUNTER_CPU(apshot_pages,            "apshot_pages")
+
+/* perfc_arrays */
+
+PERFCOUNTER_ARRAY(shm_l3_updates,          "shm_l3_updates",
+                  PERFC_MAX_PT_UPDATES)
+PERFCOUNTER_ARRAY(shm_l4_updates,          "shm_l4_updates",
+                  PERFC_MAX_PT_UPDATES)
+#endif /* x86_64 */
+
 /*#endif*/ /* __XEN_PERFC_DEFN_H__ */

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH]  Allow building with perfc and perfc_arrays
  2006-02-16 19:52 [PATCH] Allow building with perfc and perfc_arrays Ben Thomas
@ 2006-02-16 21:26 ` Chris Wright
  2006-02-16 22:17   ` Ben Thomas
  0 siblings, 1 reply; 4+ messages in thread
From: Chris Wright @ 2006-02-16 21:26 UTC (permalink / raw)
  To: Ben Thomas; +Cc: xen-devel

* Ben Thomas (bthomas@virtualiron.com) 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@sous-sol.org>
---

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")

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH]  Allow building with perfc and perfc_arrays
  2006-02-16 21:26 ` Chris Wright
@ 2006-02-16 22:17   ` Ben Thomas
  2006-02-16 22:51     ` Chris Wright
  0 siblings, 1 reply; 4+ messages in thread
From: Ben Thomas @ 2006-02-16 22:17 UTC (permalink / raw)
  To: Chris Wright; +Cc: xen-devel

Hi,

Well, I did use the phrase "simple-minded".  It seemed like
adequate warning.  ;-)

My goal was to get it compiling and out of my way so that
I could work on something else.  This was purely annoying and
I spent very little time on it.  Then, once I got it compiling,
the guilt-gene kicked in and I thought I should submit the
changes.

Your changes are more complete, and I like them better.

(Now, if I could manage to spend the time to package up other
  changes that I've made ...)

Thanks,
-b

Chris Wright wrote:
> * Ben Thomas (bthomas@virtualiron.com) 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH]  Allow building with perfc and perfc_arrays
  2006-02-16 22:17   ` Ben Thomas
@ 2006-02-16 22:51     ` Chris Wright
  0 siblings, 0 replies; 4+ messages in thread
From: Chris Wright @ 2006-02-16 22:51 UTC (permalink / raw)
  To: Ben Thomas; +Cc: Chris Wright, xen-devel

* Ben Thomas (bthomas@virtualiron.com) wrote:
> Well, I did use the phrase "simple-minded".  It seemed like
> adequate warning.  ;-)

Heh ;-)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-02-16 22:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-16 19:52 [PATCH] Allow building with perfc and perfc_arrays Ben Thomas
2006-02-16 21:26 ` Chris Wright
2006-02-16 22:17   ` Ben Thomas
2006-02-16 22:51     ` Chris Wright

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.