]> git.proxmox.com Git - mirror_qemu.git/blobdiff - trace/control-target.c
qmp: Add deprecation information to query-machines
[mirror_qemu.git] / trace / control-target.c
index 4e361019974703d089982028ae93100ece6e10d0..ceb55c70ce8377b02d833b0ce6fe5ac2c8e35e10 100644 (file)
@@ -11,7 +11,6 @@
 #include "cpu.h"
 #include "trace-root.h"
 #include "trace/control.h"
-#include "translate-all.h"
 
 
 void trace_event_set_state_dynamic_init(TraceEvent *ev, bool state)
@@ -88,13 +87,17 @@ void trace_event_set_vcpu_state_dynamic(CPUState *vcpu,
             clear_bit(vcpu_id, vcpu->trace_dstate_delayed);
             (*ev->dstate)--;
         }
-        /*
-         * Delay changes until next TB; we want all TBs to be built from a
-         * single set of dstate values to ensure consistency of generated
-         * tracing code.
-         */
-        async_run_on_cpu(vcpu, trace_event_synchronize_vcpu_state_dynamic,
-                         RUN_ON_CPU_NULL);
+        if (vcpu->created) {
+            /*
+             * Delay changes until next TB; we want all TBs to be built from a
+             * single set of dstate values to ensure consistency of generated
+             * tracing code.
+             */
+            async_run_on_cpu(vcpu, trace_event_synchronize_vcpu_state_dynamic,
+                             RUN_ON_CPU_NULL);
+        } else {
+            trace_event_synchronize_vcpu_state_dynamic(vcpu, RUN_ON_CPU_NULL);
+        }
     }
 }