[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 17/17] accel/tcg: Split log_cpu_exec into inline and slow path
From: |
Richard Henderson |
Subject: |
[PATCH v5 17/17] accel/tcg: Split log_cpu_exec into inline and slow path |
Date: |
Sun, 25 Sep 2022 10:51:24 +0000 |
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
accel/tcg/cpu-exec.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index 7fe42269ea..318dbc1a2c 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -292,12 +292,11 @@ static inline TranslationBlock *tb_lookup(CPUState *cpu,
target_ulong pc,
return tb;
}
-static inline void log_cpu_exec(target_ulong pc, CPUState *cpu,
- const TranslationBlock *tb)
+static void log_cpu_exec_slow(CPUState *cpu, const TranslationBlock *tb)
{
- if (unlikely(qemu_loglevel_mask(CPU_LOG_TB_CPU | CPU_LOG_EXEC))
- && qemu_log_in_addr_range(pc)) {
+ target_ulong pc = tb_pc_log(tb);
+ if (qemu_log_in_addr_range(pc)) {
qemu_log_mask(CPU_LOG_EXEC,
"Trace %d: %p [" TARGET_FMT_lx
"/" TARGET_FMT_lx "/%08x/%08x] %s\n",
@@ -324,6 +323,13 @@ static inline void log_cpu_exec(target_ulong pc, CPUState
*cpu,
}
}
+static inline void log_cpu_exec(CPUState *cpu, const TranslationBlock *tb)
+{
+ if (unlikely(qemu_loglevel_mask(CPU_LOG_TB_CPU | CPU_LOG_EXEC))) {
+ log_cpu_exec_slow(cpu, tb);
+ }
+}
+
static bool check_for_breakpoints(CPUState *cpu, target_ulong pc,
uint32_t *cflags)
{
@@ -421,7 +427,7 @@ const void *HELPER(lookup_tb_ptr)(CPUArchState *env)
return tcg_code_gen_epilogue;
}
- log_cpu_exec(pc, cpu, tb);
+ log_cpu_exec(cpu, tb);
return tb->tc.ptr;
}
@@ -444,7 +450,7 @@ cpu_tb_exec(CPUState *cpu, TranslationBlock *itb, int
*tb_exit)
TranslationBlock *last_tb;
const void *tb_ptr = itb->tc.ptr;
- log_cpu_exec(tb_pc_log(itb), cpu, itb);
+ log_cpu_exec(cpu, itb);
qemu_thread_jit_execute();
ret = tcg_qemu_tb_exec(env, tb_ptr);
--
2.34.1
- Re: [PATCH v5 14/17] include/hw/core: Create struct CPUJumpCache, (continued)
- [PATCH v5 15/17] accel/tcg: Introduce tb_pc and tb_pc_log, Richard Henderson, 2022/09/25
- [PATCH v5 16/17] accel/tcg: Introduce TARGET_TB_PCREL, Richard Henderson, 2022/09/25
- Re: [PATCH v5 16/17] accel/tcg: Introduce TARGET_TB_PCREL, Peter Maydell, 2022/09/30
- Re: [PATCH v5 16/17] accel/tcg: Introduce TARGET_TB_PCREL, Alex Bennée, 2022/09/30
- Re: [PATCH v5 16/17] accel/tcg: Introduce TARGET_TB_PCREL, Peter Maydell, 2022/09/30
- Re: [PATCH v5 16/17] accel/tcg: Introduce TARGET_TB_PCREL, Alex Bennée, 2022/09/30
- Re: [PATCH v5 16/17] accel/tcg: Introduce TARGET_TB_PCREL, Peter Maydell, 2022/09/30
- Re: [PATCH v5 16/17] accel/tcg: Introduce TARGET_TB_PCREL, Richard Henderson, 2022/09/30
- [PATCH v5 17/17] accel/tcg: Split log_cpu_exec into inline and slow path,
Richard Henderson <=
- Re: [PATCH v5 00/17] tcg: CPUTLBEntryFull and TARGET_TB_PCREL, Richard Henderson, 2022/09/28