diff mbox series

[2/5] x86/perfc: conditionalize HVM and shadow counters

Message ID ea513864-58c0-fb90-cee6-f668309fcc38@suse.com (mailing list archive)
State New, archived
Headers show
Series perfc: assorted adjustments | expand

Commit Message

Jan Beulich Dec. 3, 2021, 12:04 p.m. UTC
There's no point including them when the respective functionality isn't
enabled in the build. Note that this covers only larger groups; more
fine grained exclusion may want to be done later on.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

Comments

Andrew Cooper Dec. 17, 2021, 2:35 p.m. UTC | #1
On 03/12/2021 12:04, Jan Beulich wrote:
> There's no point including them when the respective functionality isn't
> enabled in the build. Note that this covers only larger groups; more
> fine grained exclusion may want to be done later on.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
diff mbox series

Patch

--- a/xen/include/asm-x86/perfc_defn.h
+++ b/xen/include/asm-x86/perfc_defn.h
@@ -4,6 +4,8 @@ 
 
 PERFCOUNTER_ARRAY(exceptions,           "exceptions", 32)
 
+#ifdef CONFIG_HVM
+
 #define VMX_PERF_EXIT_REASON_SIZE 56
 #define VMX_PERF_VECTOR_SIZE 0x20
 PERFCOUNTER_ARRAY(vmexits,              "vmexits", VMX_PERF_EXIT_REASON_SIZE)
@@ -13,6 +15,8 @@  PERFCOUNTER_ARRAY(cause_vector,
 #define SVM_PERF_EXIT_REASON_SIZE (1+141)
 PERFCOUNTER_ARRAY(svmexits,             "SVMexits", SVM_PERF_EXIT_REASON_SIZE)
 
+#endif /* CONFIG_HVM */
+
 PERFCOUNTER(seg_fixups,             "segmentation fixups")
 
 PERFCOUNTER(apic_timer,             "apic timer interrupts")
@@ -37,6 +41,8 @@  PERFCOUNTER(exception_fixed,        "pre
 PERFCOUNTER(guest_walk,            "guest pagetable walks")
 
 /* Shadow counters */
+#ifdef CONFIG_SHADOW_PAGING
+
 PERFCOUNTER(shadow_alloc,          "calls to shadow_alloc")
 PERFCOUNTER(shadow_alloc_tlbflush, "shadow_alloc flushed TLBs")
 
@@ -112,6 +118,8 @@  PERFCOUNTER(shadow_unsync,         "shad
 PERFCOUNTER(shadow_unsync_evict,   "shadow OOS evictions")
 PERFCOUNTER(shadow_resync,         "shadow OOS resyncs")
 
+#endif /* CONFIG_SHADOW_PAGING */
+
 PERFCOUNTER(realmode_emulations, "realmode instructions emulated")
 PERFCOUNTER(realmode_exits,      "vmexits from realmode")