From: Philippe Mathieu-Daudé Date: Tue, 28 Oct 2025 05:41:57 +0000 (+0100) Subject: cpus: Trace cpu_exec_start() and cpu_exec_end() calls X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=65e438d9ea3b2c5fdbf3a2255e95d73887d15e74;p=thirdparty%2Fqemu.git cpus: Trace cpu_exec_start() and cpu_exec_end() calls Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Peter Maydell --- diff --git a/cpu-common.c b/cpu-common.c index 0eb5c7b8f2..988d057d84 100644 --- a/cpu-common.c +++ b/cpu-common.c @@ -249,6 +249,8 @@ void end_exclusive(void) /* Wait for exclusive ops to finish, and begin cpu execution. */ void cpu_exec_start(CPUState *cpu) { + trace_cpu_exec_start(cpu->cpu_index); + qatomic_set(&cpu->running, true); /* Write cpu->running before reading pending_cpus. */ @@ -319,6 +321,7 @@ void cpu_exec_end(CPUState *cpu) } } } + trace_cpu_exec_end(cpu->cpu_index); } void async_safe_run_on_cpu(CPUState *cpu, run_on_cpu_func func, diff --git a/trace-events b/trace-events index 3ec8a6c720..faeba6242f 100644 --- a/trace-events +++ b/trace-events @@ -29,6 +29,8 @@ breakpoint_insert(int cpu_index, uint64_t pc, int flags) "cpu=%d pc=0x%" PRIx64 " flags=0x%x" breakpoint_remove(int cpu_index, uint64_t pc, int flags) "cpu=%d pc=0x%" PRIx64 " flags=0x%x" breakpoint_singlestep(int cpu_index, int enabled) "cpu=%d enable=%d" +cpu_exec_start(int cpu_index) "cpu=%d" +cpu_exec_end(int cpu_index) "cpu=%d" # job.c job_state_transition(void *job, int ret, const char *legal, const char *s0, const char *s1) "job %p (ret: %d) attempting %s transition (%s-->%s)"