From 3176f8f5148d95aa4dc933c23934490ca5be4b26 Mon Sep 17 00:00:00 2001 From: SharzyL Date: Tue, 7 May 2024 00:14:33 +0800 Subject: [PATCH] [cosim] less verbose logging --- ipemu/csrc/elf.cc | 3 +-- ipemu/csrc/spdlog_ext.cc | 15 +++++++++------ ipemu/csrc/vbridge_impl.cc | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/ipemu/csrc/elf.cc b/ipemu/csrc/elf.cc index c6a1e3f402..8414adb25c 100644 --- a/ipemu/csrc/elf.cc +++ b/ipemu/csrc/elf.cc @@ -64,7 +64,7 @@ simple_sim::load_elf_result_t simple_sim::load_elf32_little_endian(const std::st .with("phdr_offset", fmt::format("{:08X}", phdr.p_offset)) .with("paddr_range", fmt::format("{:08X}-{:08X}", phdr.p_paddr, phdr.p_paddr + phdr.p_memsz)) - .warn(); + .info(); } } @@ -86,7 +86,6 @@ simple_sim::load_elf_result_t simple_sim::load_elf32_little_endian(const std::st auto shdr = read_from_fs(fs, shoff + i * shentsize); if (from_le(shdr.sh_type) == SHT_STRTAB && std::string(§ion_string_table[from_le(shdr.sh_name)]) == ".strtab") { - Log("size").with("size", shdr.sh_size).warn(); string_table.resize(from_le(shdr.sh_size)); copy_from_fs(fs, from_le(shdr.sh_offset), from_le(shdr.sh_size), string_table.data()); } diff --git a/ipemu/csrc/spdlog_ext.cc b/ipemu/csrc/spdlog_ext.cc index 21c91ac5ce..9259578cba 100644 --- a/ipemu/csrc/spdlog_ext.cc +++ b/ipemu/csrc/spdlog_ext.cc @@ -58,12 +58,15 @@ static std::set get_set_from_env(const char *env_name, const char d ConsoleSink::ConsoleSink() { whitelist = get_set_from_env("EMULATOR_LOG_WHITELIST", ','); - whitelist.insert("DPIInitCosim"); - whitelist.insert("SpikeStep"); - whitelist.insert("FunctionCall"); - whitelist.insert("SimulationExit"); - whitelist.insert("DPIPeekIssue"); - whitelist.insert("DPIPokeInst"); + if (whitelist.empty()) { + // default set of whitelist + whitelist.insert("DPIInitCosim"); + whitelist.insert("SpikeStep"); + whitelist.insert("FunctionCall"); + whitelist.insert("SimulationExit"); + whitelist.insert("DPIPeekIssue"); + whitelist.insert("DPIPokeInst"); + } // putting it in JsonLogger::JsonLogger will not work. not knowing why this->set_level(get_level_from_env("EMULATOR_CONSOLE_LOG_LEVEL", spdlog::level::info)); diff --git a/ipemu/csrc/vbridge_impl.cc b/ipemu/csrc/vbridge_impl.cc index 6991f3496e..7e7274d392 100644 --- a/ipemu/csrc/vbridge_impl.cc +++ b/ipemu/csrc/vbridge_impl.cc @@ -524,7 +524,7 @@ void VBridgeImpl::receive_tl_req(const VTlInterface &tl) { Log("ReceiveTLReq") .with("addr", fmt::format("{:08X}", addr)) .with("insn", se->jsonify_insn()) - .warn("send falsy data 0xDE for accessing unexpected memory"); + .info("send falsy data 0xDE for accessing unexpected memory"); actual_data[offset] = 0xDE; // falsy data } }