mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Improve systrace markers
Reviewed By: mhorowitz Differential Revision: D4860135 fbshipit-source-id: ce963010883e6b9cc8e34f7ff01b4018cd195eba
This commit is contained in:
committed by
Facebook Github Bot
parent
49e6d3965f
commit
6221053179
@@ -124,27 +124,21 @@ void NativeToJsBridge::callFunction(
|
||||
int systraceCookie = -1;
|
||||
#ifdef WITH_FBSYSTRACE
|
||||
systraceCookie = m_systraceCookie++;
|
||||
std::string tracingName = fbsystrace_is_tracing(TRACE_TAG_REACT_CXX_BRIDGE) ?
|
||||
folly::to<std::string>("JSCall__", module, '_', method) : std::string();
|
||||
SystraceSection s(tracingName.c_str());
|
||||
FbSystraceAsyncFlow::begin(
|
||||
TRACE_TAG_REACT_CXX_BRIDGE,
|
||||
tracingName.c_str(),
|
||||
"JSCall",
|
||||
systraceCookie);
|
||||
#else
|
||||
std::string tracingName;
|
||||
#endif
|
||||
|
||||
runOnExecutorQueue([module = std::move(module), method = std::move(method), arguments = std::move(arguments), tracingName = std::move(tracingName), systraceCookie]
|
||||
runOnExecutorQueue([module = std::move(module), method = std::move(method), arguments = std::move(arguments), systraceCookie]
|
||||
(JSExecutor* executor) {
|
||||
#ifdef WITH_FBSYSTRACE
|
||||
FbSystraceAsyncFlow::end(
|
||||
TRACE_TAG_REACT_CXX_BRIDGE,
|
||||
tracingName.c_str(),
|
||||
"JSCall",
|
||||
systraceCookie);
|
||||
SystraceSection s(tracingName.c_str());
|
||||
SystraceSection s("NativeToJsBridge::callFunction", "module", module, "method", method);
|
||||
#endif
|
||||
|
||||
// This is safe because we are running on the executor's thread: it won't
|
||||
// destruct until after it's been unregistered (which we check above) and
|
||||
// that will happen on this thread
|
||||
@@ -169,9 +163,8 @@ void NativeToJsBridge::invokeCallback(double callbackId, folly::dynamic&& argume
|
||||
TRACE_TAG_REACT_CXX_BRIDGE,
|
||||
"<callback>",
|
||||
systraceCookie);
|
||||
SystraceSection s("NativeToJsBridge.invokeCallback");
|
||||
SystraceSection s("NativeToJsBridge::invokeCallback");
|
||||
#endif
|
||||
|
||||
executor->invokeCallback(callbackId, arguments);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user