JNIEXPORT void JNICALL Java_com_insightfullogic_honest_1profiler_core_control_Agent_setFilePath(JNIEnv *env, jclass klass, jstring filePath) { Profiler *prof = getProfiler(); if (filePath == NULL) { prof->setFilePath(NULL); } else { const char *nativeString = env->GetStringUTFChars(filePath, 0); prof->setFilePath((char*)nativeString); env->ReleaseStringUTFChars(filePath, nativeString); } }
PSPSDLProfiler* PSPSDLProfilerMg::createProfiler(const char* functionName, bool begin) { // Do not create a new profiler if one already exists PSPSDLProfiler* p = getProfiler(functionName); // If it doesn't exists than create one and push it in the list if (!p) { p = new PSPSDLProfiler(functionName); if (!p) return NULL; profilers.push_back(p); } // Anyway if instructed to do so, begin. if (begin) this->begin(p); return p; }
//! constructor CGUIProfiler::CGUIProfiler(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle, IProfiler* profiler) : IGUIProfiler(environment, parent, id, rectangle, profiler) , Profiler(profiler) , DisplayTable(0), CurrentGroupIdx(0), CurrentGroupPage(0), NumGroupPages(1) , DrawBackground(false), Frozen(false), UnfreezeOnce(false), ShowGroupsTogether(false) , MinCalls(0), MinTimeSum(0), MinTimeAverage(0.f), MinTimeMax(0) { if ( !Profiler ) Profiler = &getProfiler(); core::recti r(0, 0, rectangle.getWidth(), rectangle.getHeight()); // Really just too lazy to code a complete new element for this. // If anyone can do this nicer he's welcome. DisplayTable = Environment->addTable(r, this, -1, DrawBackground); DisplayTable->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT); DisplayTable->setSubElement(true); rebuildColumns(); }
void PSPSDLProfilerMg::end(const char* functionName) { end(getProfiler(functionName)); }
JNIEXPORT void JNICALL Java_com_insightfullogic_honest_1profiler_core_control_Agent_setMaxFramesToCapture(JNIEnv *env, jclass klass, jint maxFramesToCapture) { Profiler *prof = getProfiler(); prof->setMaxFramesToCapture(maxFramesToCapture); }
JNIEXPORT void JNICALL Java_com_insightfullogic_honest_1profiler_core_control_Agent_setSamplingInterval(JNIEnv *env, jclass klass, jint intervalMin, jint intervalMax) { Profiler *prof = getProfiler(); prof->setSamplingInterval(intervalMin, intervalMax); }
JNIEXPORT jstring JNICALL Java_com_insightfullogic_honest_1profiler_core_control_Agent_getFilePath(JNIEnv *env, jclass klass) { Profiler *prof = getProfiler(); return env->NewStringUTF(prof->getFilePath().c_str()); }
JNIEXPORT jint JNICALL Java_com_insightfullogic_honest_1profiler_core_control_Agent_getSamplingIntervalMax(JNIEnv *env, jclass klass) { Profiler *prof = getProfiler(); return prof->getSamplingIntervalMax(); }
JNIEXPORT jint JNICALL Java_com_insightfullogic_honest_1profiler_core_control_Agent_getMaxFramesToCapture(JNIEnv *env, jclass klass) { Profiler *prof = getProfiler(); return prof->getMaxFramesToCapture(); }
JNIEXPORT jboolean JNICALL Java_com_insightfullogic_honest_1profiler_core_control_Agent_isRunning(JNIEnv *env, jclass klass) { Profiler *prof = getProfiler(); return prof->isRunning(); }
JNIEXPORT void JNICALL Java_com_insightfullogic_honest_1profiler_core_control_Agent_stop(JNIEnv *env, jclass klass) { Profiler *prof = getProfiler(); prof->stop(); }
void sectionEnd(const string &name) { getProfiler().sectionEnd(name); }
void sectionBegin(const string &name) { getProfiler().sectionBegin(name); }
void profileEnd(){ getProfiler().close(); }