From d79c5263cffd151a9ec54c71c4084f89c88a77be Mon Sep 17 00:00:00 2001 From: vinjn Date: Tue, 30 Nov 2021 10:52:43 +0800 Subject: [PATCH] Improve Export feature --- deploy.bat | 5 ++- src/LightSpeedApp.cpp | 76 ++++++++++++++++++++++++++----------------- 2 files changed, 48 insertions(+), 33 deletions(-) diff --git a/deploy.bat b/deploy.bat index ec73b39..5a5059c 100644 --- a/deploy.bat +++ b/deploy.bat @@ -6,9 +6,8 @@ mkdir %OUTPUT% set SRC=bin/ robocopy %SRC%/ %OUTPUT% *.bat -robocopy %SRC%/ %OUTPUT% *.dll robocopy %SRC%/ %OUTPUT% *.py -robocopy %SRC%/ %OUTPUT% *.exe -robocopy %SRC%/ %OUTPUT% *.txt +robocopy %SRC%/ %OUTPUT% perf-doctor.exe +robocopy %SRC%/ %OUTPUT% unreal-cmd.txt robocopy %SRC%/ %OUTPUT% *.ini robocopy %SRC%/adb %OUTPUT%/adb * \ No newline at end of file diff --git a/src/LightSpeedApp.cpp b/src/LightSpeedApp.cpp index 5f8417a..75560ab 100644 --- a/src/LightSpeedApp.cpp +++ b/src/LightSpeedApp.cpp @@ -1113,39 +1113,55 @@ struct PerfDoctorApp : public App FILE* fp = fopen((getAppPath() / name).string().c_str(), "w"); if (!fp) return false; - fprintf(fp, "%s,%s\n", - ts.c_str(), mPackageName.c_str()); - fprintf(fp, "\n"); - - fprintf(fp, "DeviceInfo\n"); - fprintf(fp, "Device Name,OS,OpenGL,SerialNum,CPU Info\n" - "%s,%s,%s,%s,%s\n", - mDeviceNames[DEVICE_ID].c_str(), - mDeviceStat.os_version.c_str(), - mDeviceStat.gfx_api_version.c_str(), - mSerialNames[DEVICE_ID].c_str(), - mDeviceStat.hardware.c_str() - ); - fprintf(fp, "\n"); - - fprintf(fp, "Num,FPS," - "Memory[MB],NativePss[MB],Gfx[MB],EGL[MB],GL[MB],Unknown[MB]," - "CpuTemp,GpuTemp,BatteryTemp\n"); - - int memory_count = min(mFpsArray.size(), mMemoryStats.size()); - int fps_offset = mFpsArray.size() - memory_count; - for (int i = 0; i < memory_count; i++) { - fprintf(fp, "%d,%.1f," - "%.0f,%.0f,%.0f,%.0f,%.0f,%.0f," - "%.0f,%.0f,%.0f\n", - i, mFpsArray[fps_offset+i].second, - mMemoryStats[i].second.pssTotal, mMemoryStats[i].second.pssNativeHeap, mMemoryStats[i].second.pssUnknown, - mMemoryStats[i].second.pssGfx, mMemoryStats[i].second.pssEGL, mMemoryStats[i].second.pssGL, - mTemperatureStats[i].second.cpu, mTemperatureStats[i].second.gpu, mTemperatureStats[i].second.battery + fprintf(fp, "%s,%s\n", + ts.c_str(), mPackageName.c_str()); + fprintf(fp, "\n"); + } + + { + fprintf(fp, "DeviceInfo\n"); + fprintf(fp, "Device Name,OS,OpenGL,SerialNum,CPU Info\n" + "%s,%s,%s,%s,%s\n", + mDeviceNames[DEVICE_ID].c_str(), + mDeviceStat.os_version.c_str(), + mDeviceStat.gfx_api_version.c_str(), + mSerialNames[DEVICE_ID].c_str(), + mDeviceStat.hardware.c_str() ); + fprintf(fp, "\n"); } - fprintf(fp, "\n"); + + { + fprintf(fp, "Avg(FPS),Avg(Memory)[MB],Peak(Memory)[MB]\n" + "%.1f,%.0f,%.0f\n", + mFpsSummary.Avg, + mMemorySummary.Avg, + mMemorySummary.Max); + fprintf(fp, "\n"); + } + + { + fprintf(fp, "Num,FPS," + "Memory[MB],NativePss[MB],Gfx[MB],EGL[MB],GL[MB],Unknown[MB]," + "CpuTemp,GpuTemp,BatteryTemp\n"); + + int memory_count = min(mFpsArray.size(), mMemoryStats.size()); + int fps_offset = mFpsArray.size() - memory_count; + for (int i = 0; i < memory_count; i++) + { + fprintf(fp, "%d,%.1f," + "%.0f,%.0f,%.0f,%.0f,%.0f,%.0f," + "%.0f,%.0f,%.0f\n", + i, mFpsArray[fps_offset+i].second, + mMemoryStats[i].second.pssTotal, mMemoryStats[i].second.pssNativeHeap, mMemoryStats[i].second.pssUnknown, + mMemoryStats[i].second.pssGfx, mMemoryStats[i].second.pssEGL, mMemoryStats[i].second.pssGL, + mTemperatureStats[i].second.cpu, mTemperatureStats[i].second.gpu, mTemperatureStats[i].second.battery + ); + } + fprintf(fp, "\n"); + } + fclose(fp); return true;