Finer granularity systracing

Reviewed By: astreet

Differential Revision: D3234826

fbshipit-source-id: 900ab93b847949413a134a87a20b0d826c58da3d
This commit is contained in:
Marc Horowitz 2016-05-13 17:15:00 -07:00 committed by Facebook Github Bot 8
parent 86e18ace94
commit b7fe8e68be
1 changed files with 21 additions and 5 deletions

View File

@ -177,6 +177,11 @@ void JSCExecutor::destroy() {
} }
void JSCExecutor::initOnJSVMThread() { void JSCExecutor::initOnJSVMThread() {
#ifdef WITH_FBSYSTRACE
FbSystraceSection s(
TRACE_TAG_REACT_CXX_BRIDGE, "JSCExecutor.initOnJSVMThread");
#endif
#if defined(WITH_FB_JSC_TUNING) #if defined(WITH_FB_JSC_TUNING)
configureJSCForAndroid(m_jscConfig); configureJSCForAndroid(m_jscConfig);
#endif #endif
@ -236,15 +241,26 @@ void JSCExecutor::terminateOnJSVMThread() {
void JSCExecutor::loadApplicationScript( void JSCExecutor::loadApplicationScript(
const std::string& script, const std::string& script,
const std::string& sourceURL) { const std::string& sourceURL) {
ReactMarker::logMarker("loadApplicationScript_startStringConvert");
String jsScript = String::createExpectingAscii(script);
ReactMarker::logMarker("loadApplicationScript_endStringConvert");
String jsSourceURL(sourceURL.c_str());
#ifdef WITH_FBSYSTRACE #ifdef WITH_FBSYSTRACE
FbSystraceSection s(TRACE_TAG_REACT_CXX_BRIDGE, "JSCExecutor::loadApplicationScript", FbSystraceSection s(TRACE_TAG_REACT_CXX_BRIDGE, "JSCExecutor::loadApplicationScript",
"sourceURL", sourceURL); "sourceURL", sourceURL);
#endif #endif
#ifdef WITH_FBSYSTRACE
fbsystrace_begin_section(
TRACE_TAG_REACT_CXX_BRIDGE,
"JSCExecutor::loadApplicationScript-createExpectingAscii");
#endif
ReactMarker::logMarker("loadApplicationScript_startStringConvert");
String jsScript = String::createExpectingAscii(script);
ReactMarker::logMarker("loadApplicationScript_endStringConvert");
#ifdef WITH_FBSYSTRACE
fbsystrace_end_section(TRACE_TAG_REACT_CXX_BRIDGE);
#endif
String jsSourceURL(sourceURL.c_str());
evaluateScript(m_context, jsScript, jsSourceURL); evaluateScript(m_context, jsScript, jsSourceURL);
flush(); flush();
ReactMarker::logMarker("CREATE_REACT_CONTEXT_END"); ReactMarker::logMarker("CREATE_REACT_CONTEXT_END");