From 7a76fb14697e4559d425fc13aa3470e2039b4963 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Tue, 13 Oct 2020 11:05:49 +0300 Subject: [PATCH] PPU: Add loop logging in STWCX/STDCX --- rpcs3/Emu/Cell/PPUThread.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/Cell/PPUThread.cpp b/rpcs3/Emu/Cell/PPUThread.cpp index b7d416cd73..1bcd77b083 100644 --- a/rpcs3/Emu/Cell/PPUThread.cpp +++ b/rpcs3/Emu/Cell/PPUThread.cpp @@ -1648,7 +1648,7 @@ static bool ppu_store_reservation(ppu_thread& ppu, u32 addr, u64 reg_value) // Aligned 8-byte reservations will be used here addr &= -8; - while (true) + for (u64 count = 0;; count++) { auto [_old, _ok] = res.fetch_op([&](u64& r) { @@ -1669,6 +1669,11 @@ static bool ppu_store_reservation(ppu_thread& ppu, u32 addr, u64 reg_value) if (_ok) { + if (count >= 20) + { + ppu_log.notice("%s took too long (%u):", sizeof(T) == 4 ? "STWCX" : "STDCX", count); + } + break; }