x86/perfc: add hypercall performance counters for hvm, correct pv
authorJuergen Gross <jgross@suse.com>
Tue, 14 Dec 2021 08:49:23 +0000 (09:49 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 14 Dec 2021 08:49:23 +0000 (09:49 +0100)
The HVM hypercall handler is missing incrementing the per hypercall
counters. Add that.

The counters for PV are handled wrong, as they are not using
perf_incra() with the number of the hypercall as index, but are
incrementing the first hypercall entry (set_trap_table) for each
hypercall. Fix that.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/hypercall.c
xen/arch/x86/pv/hypercall.c

index 1f04ffb272499eedd3c0341b418e9f07b1a25308..c4e5c34c377c9133722038a1a389c3ce6413049b 100644 (file)
@@ -325,6 +325,8 @@ int hvm_hypercall(struct cpu_user_regs *regs)
         ioreq_signal_mapcache_invalidate();
     }
 
+    perfc_incra(hypercalls, eax);
+
     return curr->hcall_preempted ? HVM_HCALL_preempted : HVM_HCALL_completed;
 }
 
index 16a77e3a359e2dafe2a431f7326eb6a37ca415f8..ecdd58deea6912cbc5f725353b282001c938ed0e 100644 (file)
@@ -238,7 +238,7 @@ _pv_hypercall(struct cpu_user_regs *regs, bool compat)
     if ( curr->hcall_preempted )
         regs->rip -= 2;
 
-    perfc_incr(hypercalls);
+    perfc_incra(hypercalls, eax);
 }
 
 enum mc_disposition pv_do_multicall_call(struct mc_state *state)