From 423fa6d8485b5c853a8d1fe3d0721be8dbf88f02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 1 Dec 2022 16:00:31 +0100 Subject: [PATCH] Couple more FormatMemWriteTagAt --- Core/MemMapHelpers.h | 3 +-- GPU/GPUCommon.cpp | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Core/MemMapHelpers.h b/Core/MemMapHelpers.h index fdee215d03..56a950728c 100644 --- a/Core/MemMapHelpers.h +++ b/Core/MemMapHelpers.h @@ -71,9 +71,8 @@ inline void Memcpy(const u32 to_address, const u32 from_address, const u32 len, if (MemBlockInfoDetailed(len)) { char tagData[128]; if (!tag) { - const std::string srcTag = GetMemWriteTagAt("Memcpy/", from_address, len); + tagLen = FormatMemWriteTagAt(tagData, sizeof(tagData), "Memcpy/", from_address, len); tag = tagData; - tagLen = truncate_cpy(tagData, srcTag.c_str()); } NotifyMemInfo(MemBlockFlags::READ, from_address, len, tag, tagLen); NotifyMemInfo(MemBlockFlags::WRITE, to_address, len, tag, tagLen); diff --git a/GPU/GPUCommon.cpp b/GPU/GPUCommon.cpp index 17692b1cf0..03d80c3c45 100644 --- a/GPU/GPUCommon.cpp +++ b/GPU/GPUCommon.cpp @@ -3095,9 +3095,9 @@ void GPUCommon::DoBlockTransfer(u32 skipDrawReason) { memcpy(dstp, srcp, bytesToCopy); if (MemBlockInfoDetailed(bytesToCopy)) { - const std::string tag = GetMemWriteTagAt("GPUBlockTransfer/", src, bytesToCopy); - NotifyMemInfo(MemBlockFlags::READ, src, bytesToCopy, tag.c_str(), tag.size()); - NotifyMemInfo(MemBlockFlags::WRITE, dst, bytesToCopy, tag.c_str(), tag.size()); + tagSize = FormatMemWriteTagAt(tag, sizeof(tag), "GPUBlockTransfer/", src, bytesToCopy); + NotifyMemInfo(MemBlockFlags::READ, src, bytesToCopy, tag, tagSize); + NotifyMemInfo(MemBlockFlags::WRITE, dst, bytesToCopy, tag, tagSize); } } else if ((srcDstOverlap || srcWraps || dstWraps) && (srcValid || srcWraps) && (dstValid || dstWraps)) { // This path means we have either src/dst overlap, OR one or both of src and dst wrap. @@ -3254,8 +3254,9 @@ bool GPUCommon::PerformMemoryCopy(u32 dest, u32 src, int size, GPUCopyFlag flags // Since they're identical we don't need to copy. if (dest != src) { if (MemBlockInfoDetailed(size)) { - const std::string tag = GetMemWriteTagAt("GPUMemcpy/", src, size); - Memory::Memcpy(dest, src, size, tag.c_str(), tag.size()); + char tag[128]; + size_t tagSize = FormatMemWriteTagAt(tag, sizeof(tag), "GPUMemcpy/", src, size); + Memory::Memcpy(dest, src, size, tag, tagSize); } else { Memory::Memcpy(dest, src, size, "GPUMemcpy"); } @@ -3266,9 +3267,10 @@ bool GPUCommon::PerformMemoryCopy(u32 dest, u32 src, int size, GPUCopyFlag flags } if (MemBlockInfoDetailed(size)) { - const std::string tag = GetMemWriteTagAt("GPUMemcpy/", src, size); - NotifyMemInfo(MemBlockFlags::READ, src, size, tag.c_str(), tag.size()); - NotifyMemInfo(MemBlockFlags::WRITE, dest, size, tag.c_str(), tag.size()); + char tag[128]; + size_t tagSize = FormatMemWriteTagAt(tag, sizeof(tag), "GPUMemcpy/", src, size); + NotifyMemInfo(MemBlockFlags::READ, src, size, tag, tagSize); + NotifyMemInfo(MemBlockFlags::WRITE, dest, size, tag, tagSize); } InvalidateCache(dest, size, GPU_INVALIDATE_HINT); if (!(flags & GPUCopyFlag::DEBUG_NOTIFIED))