mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Make the pattern for adding systrace sections more concise
Reviewed By: astreet Differential Revision: D3234834 fbshipit-source-id: 73e191deb4dd0e06d4c242e46a582051d4bcc9ba
This commit is contained in:
1 parent
267264f1ec
commit
f433ed716c
5 files changed
+59
-66
No files matched your search
@@ -3,11 +3,7 @@
|
||||
#include "ModuleRegistry.h"
|
||||
|
||||
#include "NativeModule.h"
|
||||
|
||||
#ifdef WITH_FBSYSTRACE
|
||||
#include <fbsystrace.h>
|
||||
using fbsystrace::FbSystraceSection;
|
||||
#endif
|
||||
#include "SystraceSection.h"
|
||||
|
||||
namespace facebook {
|
||||
namespace react {
|
||||
@@ -24,9 +20,8 @@ folly::dynamic ModuleRegistry::moduleDescriptions() {
|
||||
folly::dynamic methodDescs = folly::dynamic::object;
|
||||
std::vector<MethodDescriptor> methods;
|
||||
{
|
||||
#ifdef WITH_FBSYSTRACE
|
||||
FbSystraceSection s(TRACE_TAG_REACT_CXX_BRIDGE, "getMethods", "module", module->getName());
|
||||
#endif
|
||||
SystraceSection s("getMethods",
|
||||
"module", module->getName());
|
||||
methods = module->getMethods();
|
||||
}
|
||||
for (size_t methodId = 0; methodId < methods.size(); ++methodId) {
|
||||
@@ -38,9 +33,8 @@ folly::dynamic ModuleRegistry::moduleDescriptions() {
|
||||
|
||||
folly::dynamic constants = folly::dynamic::array();
|
||||
{
|
||||
#ifdef WITH_FBSYSTRACE
|
||||
FbSystraceSection s(TRACE_TAG_REACT_CXX_BRIDGE, "getConstants", "module", module->getName());
|
||||
#endif
|
||||
SystraceSection s("getConstants",
|
||||
"module", module->getName());
|
||||
constants = module->getConstants();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user