From 5d7f834cde09e3bf6fe657ca1607e85d14be3800 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Fri, 4 Sep 2015 20:15:13 -0500 Subject: [PATCH] Add run count to the JIT profile information --- Source/Core/Core/PowerPC/JitInterface.cpp | 9 +++++---- Source/Core/Core/PowerPC/Profiler.h | 5 +++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Source/Core/Core/PowerPC/JitInterface.cpp b/Source/Core/Core/PowerPC/JitInterface.cpp index adced3cd0a..a970f87bdb 100644 --- a/Source/Core/Core/PowerPC/JitInterface.cpp +++ b/Source/Core/Core/PowerPC/JitInterface.cpp @@ -118,14 +118,14 @@ namespace JitInterface PanicAlert("Failed to open %s", filename.c_str()); return; } - fprintf(f.GetHandle(), "origAddr\tblkName\tcost\ttimeCost\tpercent\ttimePercent\tOvAllinBlkTime(ms)\tblkCodeSize\n"); + fprintf(f.GetHandle(), "origAddr\tblkName\trunCount\tcost\ttimeCost\tpercent\ttimePercent\tOvAllinBlkTime(ms)\tblkCodeSize\n"); for (auto& stat : prof_stats.block_stats) { std::string name = g_symbolDB.GetDescription(stat.addr); double percent = 100.0 * (double)stat.cost / (double)prof_stats.cost_sum; double timePercent = 100.0 * (double)stat.tick_counter / (double)prof_stats.timecost_sum; - fprintf(f.GetHandle(), "%08x\t%s\t%llu\t%llu\t%.2f\t%.2f\t%.2f\t%i\n", - stat.addr, name.c_str(), stat.cost, + fprintf(f.GetHandle(), "%08x\t%s\t%llu\t%llu\t%llu\t%.2f\t%.2f\t%.2f\t%i\n", + stat.addr, name.c_str(), stat.run_count, stat.cost, stat.tick_counter, percent, timePercent, (double)stat.tick_counter*1000.0/(double)prof_stats.countsPerSec, stat.block_size); } @@ -156,7 +156,8 @@ namespace JitInterface // Todo: tweak. if (block->runCount >= 1) prof_stats->block_stats.emplace_back(i, block->originalAddress, - cost, timecost, block->codeSize); + cost, timecost, + block->runCount, block->codeSize); prof_stats->cost_sum += cost; prof_stats->timecost_sum += timecost; } diff --git a/Source/Core/Core/PowerPC/Profiler.h b/Source/Core/Core/PowerPC/Profiler.h index e3785847fe..040eb7c88f 100644 --- a/Source/Core/Core/PowerPC/Profiler.h +++ b/Source/Core/Core/PowerPC/Profiler.h @@ -44,12 +44,13 @@ struct BlockStat { - BlockStat(int bn, u32 _addr, u64 c, u64 ticks, u32 size) : - blockNum(bn), addr(_addr), cost(c), tick_counter(ticks), block_size(size) {} + BlockStat(int bn, u32 _addr, u64 c, u64 ticks, u64 run, u32 size) : + blockNum(bn), addr(_addr), cost(c), tick_counter(ticks), run_count(run), block_size(size) {} int blockNum; u32 addr; u64 cost; u64 tick_counter; + u64 run_count; u32 block_size; bool operator <(const BlockStat &other) const