* [Qemu-devel] [PATCH] trace: Fix early setting of events with the "vcpu" property
@ 2017-06-25 11:08 Lluís Vilanova
2017-06-26 13:00 ` Stefan Hajnoczi
0 siblings, 1 reply; 2+ messages in thread
From: Lluís Vilanova @ 2017-06-25 11:08 UTC (permalink / raw)
To: qemu-devel; +Cc: Stefan Hajnoczi
Events with the "vcpu" property need to be set globally (i.e., as if they didn't
have that property) while we have not yet created any vCPU.
Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
---
trace/control-target.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/trace/control-target.c b/trace/control-target.c
index 6266e6380d..99a8ed5157 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 <vilanova@ac.upc.edu>
+ * Copyright (C) 2014-2017 Lluís Vilanova <vilanova@ac.upc.edu>
*
* 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) {
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] trace: Fix early setting of events with the "vcpu" property
2017-06-25 11:08 [Qemu-devel] [PATCH] trace: Fix early setting of events with the "vcpu" property Lluís Vilanova
@ 2017-06-26 13:00 ` Stefan Hajnoczi
0 siblings, 0 replies; 2+ messages in thread
From: Stefan Hajnoczi @ 2017-06-26 13:00 UTC (permalink / raw)
To: Lluís Vilanova; +Cc: qemu-devel, Stefan Hajnoczi
[-- Attachment #1: Type: text/plain, Size: 474 bytes --]
On Sun, Jun 25, 2017 at 02:08:38PM +0300, Lluís Vilanova wrote:
> Events with the "vcpu" property need to be set globally (i.e., as if they didn't
> have that property) while we have not yet created any vCPU.
>
> Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
> ---
> trace/control-target.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
Thanks, applied to my tracing tree:
https://github.com/stefanha/qemu/commits/tracing
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-06-26 13:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-25 11:08 [Qemu-devel] [PATCH] trace: Fix early setting of events with the "vcpu" property Lluís Vilanova
2017-06-26 13:00 ` Stefan Hajnoczi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).