diff --git a/Makefile.objs b/Makefile.objs index 3e24c320c3c6be95eca249bca59447e1bc2f2329..bfd5a6ceb1cc50226bfdfc0705684032fe9690a6 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -122,7 +122,6 @@ trace-events-subdirs += crypto trace-events-subdirs += io trace-events-subdirs += migration trace-events-subdirs += block -trace-events-subdirs += backends trace-events-subdirs += chardev trace-events-subdirs += hw/block trace-events-subdirs += hw/block/dataplane diff --git a/backends/trace-events b/backends/trace-events deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/trace/control-target.c b/trace/control-target.c index 6266e6380d22312c8d6735b041313f9dbf396b53..99a8ed5157d51502519e4ffbb587eb534806510c 100644 --- a/trace/control-target.c +++ b/trace/control-target.c @@ -1,7 +1,7 @@ /* * Interface for configuring and controlling the state of tracing events. * - * Copyright (C) 2014-2016 Lluís Vilanova + * Copyright (C) 2014-2017 Lluís Vilanova * * This work is licensed under the terms of the GNU GPL, version 2 or later. * See the COPYING file in the top-level directory. @@ -38,12 +38,16 @@ void trace_event_set_state_dynamic(TraceEvent *ev, bool state) { CPUState *vcpu; assert(trace_event_get_state_static(ev)); - if (trace_event_is_vcpu(ev)) { + if (trace_event_is_vcpu(ev) && likely(first_cpu != NULL)) { CPU_FOREACH(vcpu) { trace_event_set_vcpu_state_dynamic(vcpu, ev, state); } } else { - /* Without the "vcpu" property, dstate can only be 1 or 0 */ + /* + * Without the "vcpu" property, dstate can only be 1 or 0. With it, we + * haven't instantiated any vCPU yet, so we will set a global state + * instead, and trace_init_vcpu will reconcile it afterwards. + */ bool state_pre = *ev->dstate; if (state_pre != state) { if (state) {