RISC-V: Convert trap debugging to trace events
Cc: Palmer Dabbelt <palmer@sifive.com> Cc: Alistair Francis <Alistair.Francis@wdc.com> Signed-off-by: Michael Clark <mjc@sifive.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
This commit is contained in:
parent
acbbb94e57
commit
929f0a7fc4
@ -186,6 +186,7 @@ trace-events-subdirs += target/hppa
|
|||||||
trace-events-subdirs += target/i386
|
trace-events-subdirs += target/i386
|
||||||
trace-events-subdirs += target/mips
|
trace-events-subdirs += target/mips
|
||||||
trace-events-subdirs += target/ppc
|
trace-events-subdirs += target/ppc
|
||||||
|
trace-events-subdirs += target/riscv
|
||||||
trace-events-subdirs += target/s390x
|
trace-events-subdirs += target/s390x
|
||||||
trace-events-subdirs += target/sparc
|
trace-events-subdirs += target/sparc
|
||||||
trace-events-subdirs += ui
|
trace-events-subdirs += ui
|
||||||
|
@ -22,8 +22,7 @@
|
|||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
#include "exec/exec-all.h"
|
#include "exec/exec-all.h"
|
||||||
#include "tcg-op.h"
|
#include "tcg-op.h"
|
||||||
|
#include "trace.h"
|
||||||
#define RISCV_DEBUG_INTERRUPT 0
|
|
||||||
|
|
||||||
int riscv_cpu_mmu_index(CPURISCVState *env, bool ifetch)
|
int riscv_cpu_mmu_index(CPURISCVState *env, bool ifetch)
|
||||||
{
|
{
|
||||||
@ -493,13 +492,8 @@ void riscv_cpu_do_interrupt(CPUState *cs)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (RISCV_DEBUG_INTERRUPT) {
|
trace_riscv_trap(env->mhartid, async, cause, env->pc, tval, cause < 16 ?
|
||||||
qemu_log_mask(LOG_TRACE, "core " TARGET_FMT_ld ": %s %s, "
|
(async ? riscv_intr_names : riscv_excp_names)[cause] : "(unknown)");
|
||||||
"epc 0x" TARGET_FMT_lx ": tval 0x" TARGET_FMT_lx "\n",
|
|
||||||
env->mhartid, async ? "intr" : "trap",
|
|
||||||
(async ? riscv_intr_names : riscv_excp_names)[cause],
|
|
||||||
env->pc, tval);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (env->priv <= PRV_S &&
|
if (env->priv <= PRV_S &&
|
||||||
cause < TARGET_LONG_BITS && ((deleg >> cause) & 1)) {
|
cause < TARGET_LONG_BITS && ((deleg >> cause) & 1)) {
|
||||||
|
2
target/riscv/trace-events
Normal file
2
target/riscv/trace-events
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# target/riscv/cpu_helper.c
|
||||||
|
riscv_trap(uint64_t hartid, bool async, uint64_t cause, uint64_t epc, uint64_t tval, const char *desc) "hart:%"PRId64", async:%d, cause:%"PRId64", epc:0x%"PRIx64", tval:0x%"PRIx64", desc=%s"
|
Loading…
Reference in New Issue
Block a user