From 20f7544a8a7366742ad1c46e992327a86ff57658 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Tue, 17 Mar 2020 20:10:24 +0300 Subject: [PATCH] SPU profiler: minor change Use std::greater to sort --- rpcs3/Emu/CPU/CPUThread.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/rpcs3/Emu/CPU/CPUThread.cpp b/rpcs3/Emu/CPU/CPUThread.cpp index aacbd9c42d..4e107a6bb9 100644 --- a/rpcs3/Emu/CPU/CPUThread.cpp +++ b/rpcs3/Emu/CPU/CPUThread.cpp @@ -84,12 +84,11 @@ struct cpu_prof void print(u32 id) const { // Make reversed map: sample_count -> name - std::multimap chart; + std::multimap> chart; for (auto& [name, count] : freq) { - // Inverse bits to sort in descending order - chart.emplace(~count, name); + chart.emplace(count, name); } // Print results @@ -99,10 +98,8 @@ struct cpu_prof // Fraction of non-idle samples const f64 busy = 1. * (samples - idle) / samples; - for (auto& [rcount, name] : chart) + for (auto& [count, name] : chart) { - // Get correct count value - const u64 count = ~rcount; const f64 _frac = count / busy / samples; // Print only 7 hash characters out of 11 (which covers roughly 48 bits)