On 6/20/25 10:27, Philippe Mathieu-Daudé wrote:
Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org>
---
accel/split/split-accel.h | 5 +++++
accel/split/split-accel-ops.c | 24 +++++++++++++++++++++++-
accel/split/split-all.c | 16 +++++++++++++++-
3 files changed, 43 insertions(+), 2 deletions(-)
diff --git a/accel/split/split-accel.h b/accel/split/split-accel.h
index 8a2888507f3..80a19bbb1e5 100644
--- a/accel/split/split-accel.h
+++ b/accel/split/split-accel.h
@@ -36,6 +36,11 @@ struct SplitAccelState {
char *hw_name;
char *sw_name;
+
+ struct {
+ unsigned transitions; /* number of HW <-> SW transitions */
+ uint64_t exec_count[2]; /* SW:0 HW:1 */
+ } stats;
};
struct AccelCPUState {
diff --git a/accel/split/split-accel-ops.c b/accel/split/split-accel-ops.c
index d59e70e0d9b..615faf1d96b 100644
--- a/accel/split/split-accel-ops.c
+++ b/accel/split/split-accel-ops.c
@@ -9,6 +9,7 @@
#include "qemu/osdep.h"
#include "qemu/main-loop.h"
#include "qemu/guest-random.h"
+#include "qapi/type-helpers.h"
#include "exec/cpu-common.h"
#include "exec/cpu-interrupt.h"
#include "hw/core/cpu.h"
@@ -16,6 +17,7 @@
#include "system/cpus.h"
#include "system/hw_accel.h"
#include "system/tcg.h"
+#include "monitor/monitor.h"
#include "split-accel.h"
#include "trace.h"
@@ -70,6 +72,7 @@ static void *split_cpu_thread_routine(void *arg)
r = swops->exec_vcpu_thread(cpu);
trace_accel_split_exec_vcpu_thread_sw(r);
}
+ sas->stats.exec_count[acs->use_hw]++;
switch (r) {
case 0:
if (acs->use_hw) {
@@ -103,6 +106,7 @@ static void *split_cpu_thread_routine(void *arg)
assert(!acs->use_hw);
trace_accel_split_hw_accelerate();
acs->use_hw = true;
+ sas->stats.transitions++;
There's also the transitions in case 0.
Otherwise,
Reviewed-by: Richard Henderson <richard.hender...@linaro.org>
r~