trace: Add "vcpu_init" event
PATCH 1/2 trace: Add "vcpu_init" event
Signals the creation of a new vCPU (CPUState structure).
Signed-off-by Lluís Vilanova <[email protected]>
--- cpus.c | 1 + qemu-common.h | 4 +++- trace-events | 7 +++++++ 3 files changed, 11 insertions(+), 1 deletions(-)
cpus.c +1 -0
@@ -861,6 +861,7 @@ void qemu_init_vcpu(void *_env) }else {qemu_tcg_init_vcpu (env); } +trace_vcpu_init (env); }void qemu_notify_event (void )
qemu-common.h +3 -1
@@ -296,8 +296,10 @@ struct qemu_work_item {int done; }; +#include "trace.h" +#ifdef CONFIG_USER_ONLY -#define qemu_init_vcpu (env) do { } while (0) +#define qemu_init_vcpu (env) do { trace_vcpu_init(env); } while (0)#else void qemu_init_vcpu (void *env);#endif
trace-events +7 -0
@@ -502,3 +502,10 @@ escc_sunkbd_event_in(int ch) "Untranslated keycode %2.2x" escc_sunkbd_event_out(int ch) "Translated keycode %2.2x" escc_kbd_command(int val) "Command %d" escc_sunmouse_event(int dx, int dy, int buttons_state) "dx=%d dy=%d buttons=%01x" + +### Abstract events (not specific to a file; keep at bottom) + +## vCPU + +# Create a new vCPU (CPUState structure) +vcpu_init(void *vcpu) "%p"
PATCH 2/2 trace: Add "vcpu_reset" event
Signals the reset of the state a vCPU (CPUState structure).
Signed-off-by Lluís Vilanova <[email protected]>
--- target-arm/helper.c | 3 +++ target-cris/translate.c | 3 +++ target-i386/helper.c | 3 +++ target-lm32/helper.c | 3 +++ target-m68k/helper.c | 3 +++ target-microblaze/translate.c | 3 +++ target-mips/translate.c | 3 +++ target-ppc/helper.c | 3 +++ target-s390x/helper.c | 3 +++ target-sh4/translate.c | 3 +++ target-sparc/helper.c | 3 +++ trace-events | 2 ++ 12 files changed, 35 insertions(+), 0 deletions(-)
target-arm/helper.c +3 -0
@@ -10,6 +10,7 @@#if !defined(CONFIG_USER_ONLY )#include "hw/loader.h" #endif +#include "trace.h" static uint32_t cortexa9_cp15_c0_c1[8 ] = {0x1031 ,0x11 ,0x000 ,0 ,0x00100103 ,0x20000000 ,0x01230000 ,0x00002111 };
@@ -321,6 +322,8 @@ void cpu_reset(CPUARMState *env)set_float_detect_tininess (float_tininess_before_rounding, &env->vfp.standard_fp_status);tlb_flush (env,1 ); + +trace_vcpu_reset (env); }static int vfp_gdb_get_reg (CPUState *env,uint8_t *buf,int reg)
target-cris/translate.c +3 -0
@@ -36,6 +36,7 @@#include "mmu.h" #include "crisv32-decode.h" #include "qemu-common.h" +#include "trace.h" #define GEN_HELPER 1#include "helper.h"
@@ -3601,6 +3602,8 @@ void cpu_reset (CPUCRISState *env)cris_mmu_init (env); env->pregs[PR_CCS ] =0 ;#endif + +trace_vcpu_reset (env); }void restore_state_to_opc (CPUState *env,TranslationBlock *tb,int pc_pos)
target-i386/helper.c +3 -0
@@ -29,6 +29,7 @@#include "sysemu.h" #include "monitor.h" #endif +#include "trace.h" //#define DEBUG_MMU
@@ -104,6 +105,8 @@ void cpu_reset(CPUX86State *env) env->dr[7 ] =DR7_FIXED_1 ;cpu_breakpoint_remove_all (env,BP_CPU );cpu_watchpoint_remove_all (env,BP_CPU ); + +trace_vcpu_reset (env); }void cpu_x86_close (CPUX86State *env)
target-lm32/helper.c +3 -0
@@ -24,6 +24,7 @@#include "config.h" #include "cpu.h" #include "host-utils.h" +#include "trace.h" int cpu_lm32_handle_mmu_fault (CPUState *env,target_ulong address,int rw,int mmu_idx)
@@ -250,5 +251,7 @@ void cpu_reset(CPUState *env)/* reset cpu state */ memset (env,0 , offsetof(CPULM32State , breakpoints)); + +trace_vcpu_reset (env); }
target-m68k/helper.c +3 -0
@@ -25,6 +25,7 @@#include "cpu.h" #include "qemu-common.h" #include "gdbstub.h" +#include "trace.h" #include "helper.h"
@@ -165,6 +166,8 @@ void cpu_reset(CPUM68KState *env)/* TODO: We should set PC from the interrupt vector. */ env->pc =0 ;tlb_flush (env,1 ); + +trace_vcpu_reset (env); }CPUM68KState *cpu_m68k_init (const char *cpu_model)
target-microblaze/translate.c +3 -0
@@ -30,6 +30,7 @@#include "helper.h" #include "microblaze-decode.h" #include "qemu-common.h" +#include "trace.h" #define GEN_HELPER 1#include "helper.h"
@@ -1943,6 +1944,8 @@ void cpu_reset (CPUState *env) env->mmu.c_mmu_tlb_access =3 ; env->mmu.c_mmu_zones =16 ;#endif + +trace_vcpu_reset (env); }void restore_state_to_opc (CPUState *env,TranslationBlock *tb,int pc_pos)
target-mips/translate.c +3 -0
@@ -30,6 +30,7 @@#include "disas.h" #include "tcg-op.h" #include "qemu-common.h" +#include "trace.h" #include "helper.h" #define GEN_HELPER 1
@@ -12846,6 +12847,8 @@ void cpu_reset (CPUMIPSState *env) }#endif env->exception_index =EXCP_NONE ; + +trace_vcpu_reset (env); }void restore_state_to_opc (CPUState *env,TranslationBlock *tb,int pc_pos)
target-ppc/helper.c +3 -0
@@ -26,6 +26,7 @@#include "helper_regs.h" #include "qemu-common.h" #include "kvm.h" +#include "trace.h" //#define DEBUG_MMU //#define DEBUG_BATS
@@ -3084,6 +3085,8 @@ void cpu_reset(CPUPPCState *env) env->error_code =0 ;/* Flush all TLBs */ tlb_flush (env,1 ); + +trace_vcpu_reset (env); }CPUPPCState *cpu_ppc_init (const char *cpu_model)
target-s390x/helper.c +3 -0
@@ -26,6 +26,7 @@#include "gdbstub.h" #include "qemu-common.h" #include "qemu-timer.h" +#include "trace.h" //#define DEBUG_S390 //#define DEBUG_S390_PTE
@@ -131,6 +132,8 @@ void cpu_reset(CPUS390XState *env)memset (env,0 , offsetof(CPUS390XState , breakpoints));/* FIXME: reset vector? */ tlb_flush (env,1 ); + +trace_vcpu_reset (env); }#ifndef CONFIG_USER_ONLY
target-sh4/translate.c +3 -0
@@ -30,6 +30,7 @@#include "disas.h" #include "tcg-op.h" #include "qemu-common.h" +#include "trace.h" #include "helper.h" #define GEN_HELPER 1
@@ -205,6 +206,8 @@ void cpu_reset(CPUSH4State * env)set_flush_to_zero (1 , &env->fp_status);#endif set_default_nan_mode (1 , &env->fp_status); + +trace_vcpu_reset (env); } typedef struct {
target-sparc/helper.c +3 -0
@@ -24,6 +24,7 @@#include "cpu.h" #include "qemu-common.h" +#include "trace.h" //#define DEBUG_MMU //#define DEBUG_FEATURES
@@ -1166,6 +1167,8 @@ void cpu_reset(CPUSPARCState *env) env->npc = env->pc +4 ;#endif env->cache_control =0 ; + +trace_vcpu_reset (env); }static int cpu_sparc_register (CPUSPARCState *env,const char *cpu_model)
trace-events +2 -0
@@ -509,3 +509,5 @@ escc_sunmouse_event(int dx, int dy, int buttons_state) "dx=%d dy=%d buttons=%01x # Create a new vCPU (CPUState structure) vcpu_init(void *vcpu) "%p" +# Reset the state of a vCPU +vcpu_reset(void *vcpu) "%p"
Quoted 26 lines · Lluís Vilanova
Signals the creation of a new vCPU (CPUState structure).
Signed-off-by Lluís Vilanova <[email protected]>--- cpus.c | 1 + qemu-common.h | 4 +++- trace-events | 7 +++++++ 3 files changed, 11 insertions(+), 1 deletions(-)cpus.c +1
-0@@ -861,6 +861,7 @@ void qemu_init_vcpu(void *_env) }else {qemu_tcg_init_vcpu (env); } +trace_vcpu_init (env); }void qemu_notify_event (void )qemu-common.h +0
-0
qemu-common.h struct qemu_work_item { · line 302
Quoted 8 lines
qemu-common.h +3
-1@@ -296,8 +296,10 @@ struct qemu_work_item {int done; }; +#include "trace.h" +#ifdef CONFIG_USER_ONLY -#define qemu_init_vcpu (env) do { } while (0) +#define qemu_init_vcpu (env) do { trace_vcpu_init(env); } while (0)
As you are already at it, please make this a proper static inline instead of a macro.
Both patches look good otherwise.
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux