From fa02520b850839ece3c1df016f714db812c8b89e Mon Sep 17 00:00:00 2001 From: Chengfei Huang Date: Mon, 19 May 2025 18:44:01 +0800 Subject: [PATCH] qemu6.2.0: Add trace to measure hot migrate downtime Add trace to measure hot migrate downtime Signed-off-by: Chengfei Huang --- softmmu/cpus.c | 3 +++ softmmu/trace-events | 2 ++ 2 files changed, 5 insertions(+) diff --git a/softmmu/cpus.c b/softmmu/cpus.c index 3f61a3c31d..38bae59024 100644 --- a/softmmu/cpus.c +++ b/softmmu/cpus.c @@ -259,6 +259,8 @@ static int do_vm_stop(RunState state, bool send_stop) runstate_set(state); cpu_disable_ticks(); pause_all_vcpus(); + trace_all_vcpus_paused(); + vm_state_notify(0, state); if (send_stop) { qapi_event_send_stop(); @@ -694,6 +696,7 @@ int vm_prepare_start(void) cpu_enable_ticks(); runstate_set(RUN_STATE_RUNNING); vm_state_notify(1, RUN_STATE_RUNNING); + trace_all_vcpus_prepared(); return 0; } diff --git a/softmmu/trace-events b/softmmu/trace-events index 22606dc27b..998d870fe2 100644 --- a/softmmu/trace-events +++ b/softmmu/trace-events @@ -23,6 +23,8 @@ global_dirty_changed(unsigned int bitmask) "bitmask 0x%"PRIx32 # softmmu.c vm_stop_flush_all(int ret) "ret %d" +all_vcpus_paused(void) "" +all_vcpus_prepared(void) "" # vl.c vm_state_notify(int running, int reason, const char *reason_str) "running %d reason %d (%s)" -- Gitee