diff mbox

[2/2] trace: Add "cpu_reset" event

Message ID 147317195853.24754.9968188864229641356.stgit@fimbulvetr.bsc.es (mailing list archive)
State New, archived
Headers show

Commit Message

Lluís Vilanova Sept. 6, 2016, 2:25 p.m. UTC
Signals the reset of the state a virtual (guest) CPU.

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

Patch

diff --git a/qom/cpu.c b/qom/cpu.c
index 2553247..47bd807 100644
--- a/qom/cpu.c
+++ b/qom/cpu.c
@@ -29,6 +29,7 @@ 
 #include "qemu/error-report.h"
 #include "sysemu/sysemu.h"
 #include "hw/qdev-properties.h"
+#include "trace.h"
 
 bool cpu_exists(int64_t id)
 {
@@ -245,6 +246,8 @@  void cpu_reset(CPUState *cpu)
     if (klass->reset != NULL) {
         (*klass->reset)(cpu);
     }
+
+    trace_guest_cpu_reset(cpu);
 }
 
 static void cpu_common_reset(CPUState *cpu)
diff --git a/trace-events b/trace-events
index 5715826..2780bc8 100644
--- a/trace-events
+++ b/trace-events
@@ -150,6 +150,11 @@  memory_region_tb_write(int cpu_index, uint64_t addr, uint64_t value, unsigned si
 # Targets: all
 guest_cpu_init(void *cpu) "cpu=%p"
 
+# Reset the state of a virtual (guest) CPU
+#
+# Targets: all
+vcpu guest_cpu_reset(void)
+
 # @vaddr: Access' virtual address.
 # @info : Access' information (see below).
 #