All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/2] trace: Add "cpu_init" event
@ 2016-09-06 14:25 Lluís Vilanova
  2016-09-06 14:25 ` [Qemu-devel] [PATCH 2/2] trace: Add "cpu_reset" event Lluís Vilanova
  2016-09-14 14:40 ` [Qemu-devel] [PATCH 1/2] trace: Add "cpu_init" event Stefan Hajnoczi
  0 siblings, 2 replies; 8+ messages in thread
From: Lluís Vilanova @ 2016-09-06 14:25 UTC (permalink / raw)
  To: qemu-devel
  Cc: Stefan Hajnoczi, Paolo Bonzini, Peter Crosthwaite, Richard Henderson

Signals the creation of a new virtual (guest) CPU.

The event does not have the "vcpu" property because the machine creates
its initial vCPUs before late trace state initialization, making the
event "invisible" at system boot.

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
---
 cpus.c       |    2 ++
 stubs/cpus.c |    2 ++
 trace-events |    8 ++++++++
 3 files changed, 12 insertions(+)

diff --git a/cpus.c b/cpus.c
index 84c3520..eaf4b2c 100644
--- a/cpus.c
+++ b/cpus.c
@@ -46,6 +46,7 @@
 #include "qapi-event.h"
 #include "hw/nmi.h"
 #include "sysemu/replay.h"
+#include "trace.h"
 
 #ifndef _WIN32
 #include "qemu/compatfd.h"
@@ -1448,6 +1449,7 @@ void qemu_init_vcpu(CPUState *cpu)
     } else {
         qemu_dummy_start_vcpu(cpu);
     }
+    trace_guest_cpu_init(cpu);
 }
 
 void cpu_stop_current(void)
diff --git a/stubs/cpus.c b/stubs/cpus.c
index e192722..a797be1 100644
--- a/stubs/cpus.c
+++ b/stubs/cpus.c
@@ -1,6 +1,7 @@
 #include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qom/cpu.h"
+#include "trace.h"
 
 void cpu_resume(CPUState *cpu)
 {
@@ -8,4 +9,5 @@ void cpu_resume(CPUState *cpu)
 
 void qemu_init_vcpu(CPUState *cpu)
 {
+    trace_guest_cpu_init(cpu);
 }
diff --git a/trace-events b/trace-events
index 616cc52..5715826 100644
--- a/trace-events
+++ b/trace-events
@@ -142,6 +142,14 @@ memory_region_tb_write(int cpu_index, uint64_t addr, uint64_t value, unsigned si
 
 ### Guest events, keep at bottom
 
+
+## vCPU
+
+# Create a new virtual (guest) CPU
+#
+# Targets: all
+guest_cpu_init(void *cpu) "cpu=%p"
+
 # @vaddr: Access' virtual address.
 # @info : Access' information (see below).
 #

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-09-15 14:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-06 14:25 [Qemu-devel] [PATCH 1/2] trace: Add "cpu_init" event Lluís Vilanova
2016-09-06 14:25 ` [Qemu-devel] [PATCH 2/2] trace: Add "cpu_reset" event Lluís Vilanova
2016-09-14 14:40 ` [Qemu-devel] [PATCH 1/2] trace: Add "cpu_init" event Stefan Hajnoczi
2016-09-14 16:01   ` Lluís Vilanova
2016-09-15 12:10     ` Stefan Hajnoczi
2016-09-15 12:51       ` Lluís Vilanova
2016-09-15 13:05         ` Stefan Hajnoczi
2016-09-15 14:23           ` Lluís Vilanova

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.