From 8631e77db2c027330caf4d02492a8252379a6940 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 1 Jan 2026 13:55:30 +0100 Subject: [PATCH] Delete some outdated profiler integrations --- Core/MIPS/ARM/ArmJit.cpp | 2 - Core/MIPS/JitCommon/JitBlockCache.cpp | 53 +-------------------------- Core/MIPS/JitCommon/JitBlockCache.h | 8 ---- 3 files changed, 1 insertion(+), 62 deletions(-) diff --git a/Core/MIPS/ARM/ArmJit.cpp b/Core/MIPS/ARM/ArmJit.cpp index c2444fecfe..78ec6164bb 100644 --- a/Core/MIPS/ARM/ArmJit.cpp +++ b/Core/MIPS/ARM/ArmJit.cpp @@ -497,7 +497,6 @@ void ArmJit::UnlinkBlock(u8 *checkedEntry, u32 originalAddress) { } bool ArmJit::ReplaceJalTo(u32 dest) { -#if PPSSPP_ARCH(ARM) const ReplacementTableEntry *entry = nullptr; u32 funcSize = 0; if (!CanReplaceJalTo(dest, &entry, &funcSize)) { @@ -546,7 +545,6 @@ bool ArmJit::ReplaceJalTo(u32 dest) { // Add a trigger so that if the inlined code changes, we invalidate this block. blocks.ProxyBlock(js.blockStart, dest, funcSize / sizeof(u32), GetCodePtr()); -#endif return true; } diff --git a/Core/MIPS/JitCommon/JitBlockCache.cpp b/Core/MIPS/JitCommon/JitBlockCache.cpp index e3861c83e6..e192195760 100644 --- a/Core/MIPS/JitCommon/JitBlockCache.cpp +++ b/Core/MIPS/JitCommon/JitBlockCache.cpp @@ -40,27 +40,7 @@ #include "Core/MIPS/JitCommon/JitBlockCache.h" #include "Core/MIPS/JitCommon/JitCommon.h" -// #include "JitBase.h" - -// Enable define below to enable oprofile integration. For this to work, -// it requires at least oprofile version 0.9.4, and changing the build -// system to link the Dolphin executable against libopagent. Since the -// dependency is a little inconvenient and this is possibly a slight -// performance hit, it's not enabled by default, but it's useful for -// locating performance issues. -#if defined USE_OPROFILE && USE_OPROFILE -#include - -op_agent_t agent; -#endif - -#if defined USE_VTUNE -#include -#pragma comment(lib, "libittnotify.lib") -#pragma comment(lib, "jitprofiling.lib") -#endif - -const u32 INVALID_EXIT = 0xFFFFFFFF; +constexpr u32 INVALID_EXIT = 0xFFFFFFFF; static uint64_t HashJitBlock(const JitBlock &b) { PROFILE_THIS_SCOPE("jithash"); @@ -96,9 +76,6 @@ bool JitBlockCache::IsFull() const { } void JitBlockCache::Init() { -#if defined USE_OPROFILE && USE_OPROFILE - agent = op_open_agent(); -#endif blocks_ = new JitBlock[MAX_NUM_BLOCKS]; Clear(); } @@ -108,13 +85,6 @@ void JitBlockCache::Shutdown() { delete [] blocks_; blocks_ = 0; num_blocks_ = 0; -#if defined USE_OPROFILE && USE_OPROFILE - op_close_agent(agent); -#endif - -#ifdef USE_VTUNE - iJIT_NotifyEvent(iJVM_EVENT_TYPE_SHUTDOWN, NULL); -#endif } // This clears the JIT cache. It's called from JitCache.cpp when the JIT cache @@ -287,27 +257,6 @@ void JitBlockCache::FinalizeBlock(int block_num, bool block_link) { if (blockEnd > PSP_GetUserMemoryBase() + halfUserMemory) { ExpandRange(blockMemRanges_[JITBLOCK_RANGE_RAMTOP], b.originalAddress, blockEnd); } - -#if defined USE_OPROFILE && USE_OPROFILE - char buf[100]; - snprintf(buf, sizeof(buf), "EmuCode%x", b.originalAddress); - const u8* blockStart = blocks_[block_num].checkedEntry; - op_write_native_code(agent, buf, (uint64_t)blockStart, blockStart, b.normalEntry + b.codeSize - b.checkedEntry); -#endif - -#ifdef USE_VTUNE - snprintf(b.blockName, sizeof(b.blockName), "EmuCode_0x%08x", b.originalAddress); - - iJIT_Method_Load jmethod = {0}; - jmethod.method_id = iJIT_GetNewMethodID(); - jmethod.class_file_name = ""; - jmethod.source_file_name = __FILE__; - jmethod.method_load_address = (void*)blocks_[block_num].checkedEntry; - jmethod.method_size = b.normalEntry + b.codeSize - b.checkedEntry; - jmethod.line_number_size = 0; - jmethod.method_name = b.blockName; - iJIT_NotifyEvent(iJVM_EVENT_TYPE_METHOD_LOAD_FINISHED, (void*)&jmethod); -#endif } bool JitBlockCache::RangeMayHaveEmuHacks(u32 start, u32 end) const { diff --git a/Core/MIPS/JitCommon/JitBlockCache.h b/Core/MIPS/JitCommon/JitBlockCache.h index 13365cea13..1bcd5ba3ab 100644 --- a/Core/MIPS/JitCommon/JitBlockCache.h +++ b/Core/MIPS/JitCommon/JitBlockCache.h @@ -51,10 +51,6 @@ enum class DestroyType { CLEAR, }; -// Define this in order to get VTune profile support for the Jit generated code. -// Add the VTune include/lib directories to the project directories to get this to build. -// #define USE_VTUNE - // We should be careful not to access these block structures during runtime as they are large. // Fine to mess with them at block compile time though. struct JitBlock { @@ -76,10 +72,6 @@ struct JitBlock { bool invalid; bool linkStatus[MAX_JIT_BLOCK_EXITS]; -#ifdef USE_VTUNE - char blockName[32]; -#endif - // By having a pointer, we avoid a constructor/destructor being generated and dog slow // performance in debug. std::vector *proxyFor;