@@ -19,6 +19,7 @@
*/
#include "qemu/osdep.h"
+#include "trace.h"
#include "qapi/error.h"
#include "qemu-common.h"
#include "qom/cpu.h"
@@ -111,6 +112,8 @@ void cpu_reset_interrupt(CPUState *cpu, int mask)
void cpu_exit(CPUState *cpu)
{
+ trace_cpu_exit(cpu, cpu->cpu_index);
+
atomic_set(&cpu->exit_request, 1);
/* Ensure cpu_exec will see the exit request after TCG has exited. */
smp_wmb();
@@ -1,5 +1,9 @@
# See docs/devel/tracing.txt for syntax documentation.
+# qom/cpu.c
+# cpu_exit events
+cpu_exit(void *cpu, int id) "cpu:%p id:%d"
+
# qom/object.c
object_dynamic_cast_assert(const char *type, const char *target, const char *file, int line, const char *func) "%s->%s (%s:%d:%s)"
object_class_dynamic_cast_assert(const char *type, const char *target, const char *file, int line, const char *func) "%s->%s (%s:%d:%s)"
This is useful for tracing cpu_exit events where we signal the CPU to come back to the main loop. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> --- qom/cpu.c | 3 +++ qom/trace-events | 4 ++++ 2 files changed, 7 insertions(+) -- 2.17.1