diff --git a/rpcs3/Emu/CPU/CPUThread.cpp b/rpcs3/Emu/CPU/CPUThread.cpp index 9710af94f5..58fcc54a79 100644 --- a/rpcs3/Emu/CPU/CPUThread.cpp +++ b/rpcs3/Emu/CPU/CPUThread.cpp @@ -659,7 +659,7 @@ void cpu_thread::operator()() } case thread_class::spu: { - if (g_cfg.core.spu_prof) + if (g_cfg.core.spu_prof || g_cfg.core.spu_debug) { g_fxo->get().registered.push(id); } @@ -1546,7 +1546,7 @@ void cpu_thread::flush_profilers() noexcept return; } - if (g_cfg.core.spu_prof) + if (g_cfg.core.spu_prof || g_cfg.core.spu_debug) { g_fxo->get().registered.push(0); } diff --git a/rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp b/rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp index 6b4b456f3d..946deacf01 100644 --- a/rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp +++ b/rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp @@ -186,7 +186,7 @@ spu_function_t spu_recompiler::compile(spu_program&& _func) c->cmp(SPU_OFF_32(state), 0); c->jnz(label_stop); - if (g_cfg.core.spu_prof && g_cfg.core.spu_verification) + if ((g_cfg.core.spu_prof || g_cfg.core.spu_debug) && g_cfg.core.spu_verification) { c->mov(x86::rax, m_hash_start & -0xffff); c->mov(SPU_OFF_64(block_hash), x86::rax); @@ -755,7 +755,7 @@ spu_function_t spu_recompiler::compile(spu_program&& _func) c->add(SPU_OFF_64(block_counter), ::size32(words) / (words_align / 4)); // Set block hash for profiling (if enabled) - if (g_cfg.core.spu_prof) + if (g_cfg.core.spu_prof || g_cfg.core.spu_debug) { c->mov(x86::rax, m_hash_start | 0xffff); c->mov(SPU_OFF_64(block_hash), x86::rax); @@ -1199,7 +1199,7 @@ void spu_recompiler::branch_set_link(u32 target) c->movdqa(x86::dqword_ptr(*cpu, *qw1, 0, ::offset32(&spu_thread::stack_mirror)), x86::xmm0); // Set block hash for profiling (if enabled) - if (g_cfg.core.spu_prof) + if (g_cfg.core.spu_prof || g_cfg.core.spu_debug) { c->mov(x86::rax, m_hash_start | 0xffff); c->mov(SPU_OFF_64(block_hash), x86::rax); diff --git a/rpcs3/Emu/Cell/SPULLVMRecompiler.cpp b/rpcs3/Emu/Cell/SPULLVMRecompiler.cpp index b8f30de43f..e66d7c9654 100644 --- a/rpcs3/Emu/Cell/SPULLVMRecompiler.cpp +++ b/rpcs3/Emu/Cell/SPULLVMRecompiler.cpp @@ -1632,7 +1632,7 @@ public: m_ir->SetInsertPoint(label_test); // Set block hash for profiling (if enabled) - if (g_cfg.core.spu_prof && g_cfg.core.spu_verification) + if ((g_cfg.core.spu_prof || g_cfg.core.spu_debug) && g_cfg.core.spu_verification) m_ir->CreateStore(m_ir->getInt64((m_hash_start & -65536)), spu_ptr(&spu_thread::block_hash)); if (!g_cfg.core.spu_verification) @@ -1989,7 +1989,7 @@ public: set_function(m_functions[m_entry].chunk); // Set block hash for profiling (if enabled) - if (g_cfg.core.spu_prof) + if (g_cfg.core.spu_prof || g_cfg.core.spu_debug) m_ir->CreateStore(m_ir->getInt64((m_hash_start & -65536) | (m_entry >> 2)), spu_ptr(&spu_thread::block_hash)); m_finfo = &m_functions[m_entry]; diff --git a/rpcs3/Emu/Cell/SPUThread.cpp b/rpcs3/Emu/Cell/SPUThread.cpp index cc21e2ebb8..f8848a9781 100644 --- a/rpcs3/Emu/Cell/SPUThread.cpp +++ b/rpcs3/Emu/Cell/SPUThread.cpp @@ -1612,10 +1612,14 @@ std::string spu_thread::dump_misc() const fmt::append(ret, "Block Weight: %u (Retreats: %u)", block_counter, block_failure); - if (g_cfg.core.spu_prof) + if (u64 hash = atomic_storage::load(block_hash)) { // Get short function hash and position in chunk - fmt::append(ret, "\nCurrent block: %s", spu_block_hash{atomic_storage::load(block_hash)}); + fmt::append(ret, "\nCurrent block: %s", spu_block_hash{hash}); + } + else if (g_cfg.core.spu_prof || g_cfg.core.spu_debug) + { + fmt::append(ret, "\nCurrent block: N/A"); } const u32 offset = group ? SPU_FAKE_BASE_ADDR + (id & 0xffffff) * SPU_LS_SIZE : RAW_SPU_BASE_ADDR + index * RAW_SPU_OFFSET;