From 50135a988ecb6f15a2232c27995896bdb92647d9 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Thu, 23 Oct 2014 05:59:14 -0500 Subject: [PATCH] Enables block profiling in the UI on non x86 targets. ARMv7 supports block profiling as well. So let's stop artificially limiting here. --- Source/Core/Core/PowerPC/JitInterface.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Source/Core/Core/PowerPC/JitInterface.cpp b/Source/Core/Core/PowerPC/JitInterface.cpp index c2a3114804ca..fd7392f6b3ed 100644 --- a/Source/Core/Core/PowerPC/JitInterface.cpp +++ b/Source/Core/Core/PowerPC/JitInterface.cpp @@ -134,31 +134,32 @@ namespace JitInterface void WriteProfileResults(const std::string& filename) { // Can't really do this with no jit core available - #if _M_X86 + if (!jit) + return; std::vector stats; stats.reserve(jit->GetBlockCache()->GetNumBlocks()); u64 cost_sum = 0; - #ifdef _WIN32 + #ifdef _WIN32 u64 timecost_sum = 0; u64 countsPerSec; QueryPerformanceFrequency((LARGE_INTEGER *)&countsPerSec); - #endif + #endif for (int i = 0; i < jit->GetBlockCache()->GetNumBlocks(); i++) { const JitBlock *block = jit->GetBlockCache()->GetBlock(i); // Rough heuristic. Mem instructions should cost more. u64 cost = block->originalSize * (block->runCount / 4); - #ifdef _WIN32 + #ifdef _WIN32 u64 timecost = block->ticCounter; - #endif + #endif // Todo: tweak. if (block->runCount >= 1) stats.push_back(BlockStat(i, cost)); cost_sum += cost; - #ifdef _WIN32 + #ifdef _WIN32 timecost_sum += timecost; - #endif + #endif } sort(stats.begin(), stats.end()); @@ -176,19 +177,18 @@ namespace JitInterface { std::string name = g_symbolDB.GetDescription(block->originalAddress); double percent = 100.0 * (double)stat.cost / (double)cost_sum; - #ifdef _WIN32 + #ifdef _WIN32 double timePercent = 100.0 * (double)block->ticCounter / (double)timecost_sum; fprintf(f.GetHandle(), "%08x\t%s\t%" PRIu64 "\t%" PRIu64 "\t%.2lf\t%llf\t%lf\t%i\n", block->originalAddress, name.c_str(), stat.cost, block->ticCounter, percent, timePercent, (double)block->ticCounter*1000.0/(double)countsPerSec, block->codeSize); - #else + #else fprintf(f.GetHandle(), "%08x\t%s\t%" PRIu64 "\t???\t%.2lf\t???\t???\t%i\n", block->originalAddress, name.c_str(), stat.cost, percent, block->codeSize); - #endif + #endif } } - #endif } bool HandleFault(uintptr_t access_address, SContext* ctx) {