From e7cdd757248358235f3231cecf6aafdf23201d4e Mon Sep 17 00:00:00 2001 From: sthiruva Date: Tue, 29 Sep 2020 10:36:02 +0530 Subject: [PATCH] Add core id to lines generated by --log-commits (#556) * Add core id to lines generated by --log-commits * Fixing the format specifier for cpuid in log-commits Co-authored-by: Shajid Thiruvathodi --- riscv/execute.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/riscv/execute.cc b/riscv/execute.cc index a6c7f104..84e9c5fd 100644 --- a/riscv/execute.cc +++ b/riscv/execute.cc @@ -70,6 +70,10 @@ static void commit_log_print_insn(processor_t *p, reg_t pc, insn_t insn) int xlen = p->get_state()->last_inst_xlen; int flen = p->get_state()->last_inst_flen; + // print core id on all lines so it is easy to grep + uint64_t id = p->get_csr(CSR_MHARTID); + fprintf(log_file, "core%4" PRId64 ": ", id); + fprintf(log_file, "%1d ", priv); commit_log_print_value(log_file, xlen, pc); fprintf(log_file, " (");