diff options
author | Lluís Vilanova <vilanova@ac.upc.edu> | 2016-12-26 22:24:40 +0100 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2017-01-16 13:40:56 +0000 |
commit | 82e95ec847757c1a2b6accf0e8312925ada3dca8 (patch) | |
tree | c216df66c35a995786021fce24a2b830d15c0757 /trace/control.c | |
parent | fff895dfdbe41965f7b0430e3d9e8b7bd8fc8eda (diff) | |
download | qemu-82e95ec847757c1a2b6accf0e8312925ada3dca8.zip qemu-82e95ec847757c1a2b6accf0e8312925ada3dca8.tar.gz qemu-82e95ec847757c1a2b6accf0e8312925ada3dca8.tar.bz2 |
trace: Fix dynamic event state on vCPU hot-unplug
We need to disable per-vCPU events on a vCPU that is hot-unplugged to
keep the dynamic event state global counters consistent.
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
Message-id: 148278748055.1404.1570530281528619895.stgit@fimbulvetr.bsc.es
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'trace/control.c')
-rw-r--r-- | trace/control.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/trace/control.c b/trace/control.c index 1a7bee6..cb79bb1 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 |