From 90093faffc55e98f6cce511fde1fa3c182541b5a Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 30 May 2015 12:53:57 -0700 Subject: [PATCH] Ensure headless doesn't crash when profiler on. Obviously, the frame profiler graph isn't very useful in headless (maybe it could be?) but at least, it's nice to not have to change the .h and rebuild all kinds of files when using headless for testing. --- headless/Headless.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/headless/Headless.cpp b/headless/Headless.cpp index 5ef9933580..d15a881830 100644 --- a/headless/Headless.cpp +++ b/headless/Headless.cpp @@ -7,6 +7,7 @@ #include #include "file/zip_read.h" +#include "profiler/profiler.h" #include "Common/FileUtil.h" #include "Core/Config.h" #include "Core/Core.h" @@ -201,6 +202,8 @@ bool RunAutoTest(HeadlessHost *headlessHost, CoreParameter &coreParameter, bool int main(int argc, const char* argv[]) { + PROFILE_INIT(); + #ifdef ANDROID_NDK_PROFILER setenv("CPUPROFILE_FREQUENCY", "500", 1); setenv("CPUPROFILE", "/sdcard/gmon.out", 1);