From 2023057fbb7b5fd469d30440416de68715ebf175 Mon Sep 17 00:00:00 2001 From: Eladash <18193363+elad335@users.noreply.github.com> Date: Wed, 27 Mar 2024 11:49:11 +0200 Subject: [PATCH] Savestates: Reduce logging --- rpcs3/Emu/Cell/lv2/lv2.cpp | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/rpcs3/Emu/Cell/lv2/lv2.cpp b/rpcs3/Emu/Cell/lv2/lv2.cpp index a407ad22de..32541981b3 100644 --- a/rpcs3/Emu/Cell/lv2/lv2.cpp +++ b/rpcs3/Emu/Cell/lv2/lv2.cpp @@ -1446,16 +1446,28 @@ bool lv2_obj::sleep_unlocked(cpu_thread& thread, u64 timeout, u64 current_time) auto on_to_sleep_update = [&]() { - std::string out = fmt::format("Threads (%d):", g_to_sleep.size()); - for (auto thread : g_to_sleep) + if (g_to_sleep.size() > 5u) { - fmt::append(out, " 0x%x,", thread->id); + ppu_log.warning("Threads (%d)", g_to_sleep.size()); } - - ppu_log.warning("%s", out); - - if (g_to_sleep.empty()) + else if (!g_to_sleep.empty()) { + // In case there is a deadlock (PPU threads not sleeping) + // Print-out their IDs for further inspection (focus at 5 at max for now to avoid log spam) + std::string out = fmt::format("Threads (%d):", g_to_sleep.size()); + for (auto thread : g_to_sleep) + { + fmt::append(out, " 0x%x,", thread->id); + } + + out.resize(out.size() - 1); + + ppu_log.warning("%s", out); + } + else + { + ppu_log.warning("Final Thread"); + // All threads are ready, wake threads Emu.CallFromMainThread([] {