From 41d54cbcbc4146752387ac11e23f2285d503b9df Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Wed, 27 May 2015 19:45:33 -0700 Subject: [PATCH 1/3] Adjust frame profiler graph to be more readable. --- UI/DevScreens.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/UI/DevScreens.cpp b/UI/DevScreens.cpp index ace5459b1a..1812283db2 100644 --- a/UI/DevScreens.cpp +++ b/UI/DevScreens.cpp @@ -788,19 +788,19 @@ static const uint32_t nice_colors[] = { 0xFFFF40, 0x40FFFF, - 0xFF40FF, + 0xFF70FF, 0xc0c0c0, - 0x8040c0, + 0xb040c0, - 0x990099, + 0x184099, 0xCC3333, 0xFF99CC, 0x3399CC, - 0x003366, 0x990000, - 0x33FFFF, + 0x003366, 0xF8F8F8, + 0x33FFFF, }; void DrawProfile(UIContext &ui) { @@ -808,7 +808,7 @@ void DrawProfile(UIContext &ui) { int numCategories = Profiler_GetNumCategories(); int historyLength = Profiler_GetHistoryLength(); - float legendWidth = 100.0f; + float legendWidth = 80.0f; for (int i = 0; i < numCategories; i++) { const char *name = Profiler_GetCategoryName(i); float w = 0.0f, h = 0.0f; @@ -817,11 +817,13 @@ void DrawProfile(UIContext &ui) { legendWidth = w; } } + legendWidth += 20.0f; - float legendStartY = ui.GetBounds().centerY(); + float rowH = 30.0f; + float legendHeight = rowH * numCategories; + float legendStartY = legendHeight > ui.GetBounds().centerY() ? ui.GetBounds().y2() - legendHeight : ui.GetBounds().centerY(); float legendStartX = ui.GetBounds().x2() - std::min(legendWidth, 200.0f); - float rowH = 30; const uint32_t opacity = 140 << 24; for (int i = 0; i < numCategories; i++) { @@ -833,7 +835,7 @@ void DrawProfile(UIContext &ui) { ui.DrawTextShadow(name, legendStartX + rowH + 2, y, 0xFFFFFFFF, ALIGN_VBASELINE); } - float graphWidth = ui.GetBounds().x2() - 120; + float graphWidth = ui.GetBounds().x2() - legendWidth - 20.0f; float graphHeight = ui.GetBounds().h * 0.8f; std::vector history; @@ -878,12 +880,14 @@ void DrawProfile(UIContext &ui) { if (area) col = opacity | (col & 0xFFFFFF); UI::Drawable color(col); + UI::Drawable outline(opacity | 0xFFFFFF); if (area) { for (int n = 0; n < historyLength; n++) { float val = history[n]; float valY1 = ui.GetBounds().y2() - 10 - (val + total[n]) * scale; float valY2 = ui.GetBounds().y2() - 10 - total[n] * scale; + ui.FillRect(outline, Bounds(x, valY1, dx, valY2 - valY1 + 0.5f)); ui.FillRect(color, Bounds(x, valY1, dx, valY2 - valY1)); x += dx; total[n] += val; From d323dd472f49f7f94ef477212f6739cf4721a891 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Wed, 27 May 2015 20:02:09 -0700 Subject: [PATCH 2/3] Account for io sync time in io statistics. --- Core/HLE/sceIo.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Core/HLE/sceIo.cpp b/Core/HLE/sceIo.cpp index dbbf582cec..ecba48f4f4 100644 --- a/Core/HLE/sceIo.cpp +++ b/Core/HLE/sceIo.cpp @@ -290,6 +290,8 @@ static void __IoFreeFd(int fd, u32 &error) { CoreTiming::UnscheduleEvent(syncNotifyEvent, ((u64)f->waitingSyncThreads[i] << 32) | fd); } + PROFILE_THIS_SCOPE("io_rw"); + // Discard any pending results. AsyncIOResult managerResult; ioManager.WaitResult(f->handle, managerResult); @@ -315,6 +317,8 @@ static void __IoFreeFd(int fd, u32 &error) { // TODO: We don't do any of that yet. // For now, let's at least delay the callback notification. static void __IoAsyncNotify(u64 userdata, int cyclesLate) { + PROFILE_THIS_SCOPE("io_rw"); + int fd = (int) userdata; u32 error; @@ -368,6 +372,8 @@ static void __IoAsyncNotify(u64 userdata, int cyclesLate) { } static void __IoSyncNotify(u64 userdata, int cyclesLate) { + PROFILE_THIS_SCOPE("io_rw"); + SceUID threadID = userdata >> 32; int fd = (int) (userdata & 0xFFFFFFFF); @@ -616,6 +622,8 @@ static u32 sceKernelStderr() { } u64 __IoCompleteAsyncIO(FileNode *f) { + PROFILE_THIS_SCOPE("io_rw"); + if (g_Config.iIOTimingMethod == IOTIMING_REALISTIC) { u64 finishTicks = ioManager.ResultFinishTicks(f->handle); if (finishTicks > CoreTiming::GetTicks()) { @@ -762,7 +770,7 @@ static u32 npdrmRead(FileNode *f, u8 *data, int size) { } static bool __IoRead(int &result, int id, u32 data_addr, int size, int &us) { - PROFILE_THIS_SCOPE("ioread"); + PROFILE_THIS_SCOPE("io_rw"); // Low estimate, may be improved later from the ReadFile result. us = size / 100; if (us < 100) { @@ -895,6 +903,7 @@ static u32 sceIoReadAsync(int id, u32 data_addr, int size) { } static bool __IoWrite(int &result, int id, u32 data_addr, int size, int &us) { + PROFILE_THIS_SCOPE("io_rw"); // Low estimate, may be improved later from the WriteFile result. us = size / 100; if (us < 100) { @@ -1085,6 +1094,7 @@ static u32 npdrmLseek(FileNode *f, s32 where, FileMove whence) } static s64 __IoLseekDest(FileNode *f, s64 offset, int whence, FileMove &seek) { + PROFILE_THIS_SCOPE("io_rw"); seek = FILEMOVE_BEGIN; // Let's make sure this isn't incorrect mid-operation. From 8258a7341e3dc2eb7dd3f7040e8908105345bac0 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Thu, 28 May 2015 07:29:05 -0700 Subject: [PATCH 3/3] Soften the outline a bit and fix overlap. --- UI/DevScreens.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UI/DevScreens.cpp b/UI/DevScreens.cpp index 1812283db2..daae1ee91b 100644 --- a/UI/DevScreens.cpp +++ b/UI/DevScreens.cpp @@ -880,14 +880,14 @@ void DrawProfile(UIContext &ui) { if (area) col = opacity | (col & 0xFFFFFF); UI::Drawable color(col); - UI::Drawable outline(opacity | 0xFFFFFF); + UI::Drawable outline((opacity >> 1) | 0xFFFFFF); if (area) { for (int n = 0; n < historyLength; n++) { float val = history[n]; float valY1 = ui.GetBounds().y2() - 10 - (val + total[n]) * scale; float valY2 = ui.GetBounds().y2() - 10 - total[n] * scale; - ui.FillRect(outline, Bounds(x, valY1, dx, valY2 - valY1 + 0.5f)); + ui.FillRect(outline, Bounds(x, valY2, dx, 1.0f)); ui.FillRect(color, Bounds(x, valY1, dx, valY2 - valY1)); x += dx; total[n] += val;