summaryrefslogtreecommitdiff
path: root/trace
diff options
context:
space:
mode:
Diffstat (limited to 'trace')
-rw-r--r--trace/control.c16
-rw-r--r--trace/control.h8
2 files changed, 24 insertions, 0 deletions
diff --git a/trace/control.c b/trace/control.c
index 1a7bee6ddc..cb79bb17ec 100644
--- a/trace/control.c
+++ b/trace/control.c
@@ -259,6 +259,22 @@ void trace_init_file(const char *file)
#endif
}
+void trace_fini_vcpu(CPUState *vcpu)
+{
+ TraceEventIter iter;
+ TraceEvent *ev;
+
+ trace_event_iter_init(&iter, NULL);
+ while ((ev = trace_event_iter_next(&iter)) != NULL) {
+ if (trace_event_is_vcpu(ev) &&
+ trace_event_get_state_static(ev) &&
+ trace_event_get_vcpu_state_dynamic(vcpu, ev)) {
+ /* must disable to affect the global counter */
+ trace_event_set_vcpu_state_dynamic(vcpu, ev, false);
+ }
+ }
+}
+
bool trace_init_backends(void)
{
#ifdef CONFIG_TRACE_SIMPLE
diff --git a/trace/control.h b/trace/control.h
index ccaeac8552..4ea53e2986 100644
--- a/trace/control.h
+++ b/trace/control.h
@@ -202,6 +202,14 @@ void trace_init_file(const char *file);
void trace_init_vcpu(CPUState *vcpu);
/**
+ * trace_fini_vcpu:
+ * @vcpu: Removed vCPU.
+ *
+ * Disable dynamic event state for a hot-unplugged vCPU.
+ */
+void trace_fini_vcpu(CPUState *vcpu);
+
+/**
* trace_list_events:
*
* List all available events.