trace: Immediately apply per-vCPU state changes if a vCPU is being created
Right now, function trace_event_set_vcpu_state_dynamic() asynchronously enables events in the case a vCPU is executing TCG code. If the vCPU is being created this makes some events like "guest_cpu_enter" to not be traced. Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> Reviewed-by: Emilio G. Cota <cota@braap.org> Message-id: 150525662577.19850.13767570977540117247.stgit@frigg.lan Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
3dabde1128
commit
f99b38fc7c
@ -88,6 +88,7 @@ void trace_event_set_vcpu_state_dynamic(CPUState *vcpu,
|
|||||||
clear_bit(vcpu_id, vcpu->trace_dstate_delayed);
|
clear_bit(vcpu_id, vcpu->trace_dstate_delayed);
|
||||||
(*ev->dstate)--;
|
(*ev->dstate)--;
|
||||||
}
|
}
|
||||||
|
if (vcpu->created) {
|
||||||
/*
|
/*
|
||||||
* Delay changes until next TB; we want all TBs to be built from a
|
* Delay changes until next TB; we want all TBs to be built from a
|
||||||
* single set of dstate values to ensure consistency of generated
|
* single set of dstate values to ensure consistency of generated
|
||||||
@ -95,6 +96,9 @@ void trace_event_set_vcpu_state_dynamic(CPUState *vcpu,
|
|||||||
*/
|
*/
|
||||||
async_run_on_cpu(vcpu, trace_event_synchronize_vcpu_state_dynamic,
|
async_run_on_cpu(vcpu, trace_event_synchronize_vcpu_state_dynamic,
|
||||||
RUN_ON_CPU_NULL);
|
RUN_ON_CPU_NULL);
|
||||||
|
} else {
|
||||||
|
trace_event_synchronize_vcpu_state_dynamic(vcpu, RUN_ON_CPU_NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user