Fix broken systrace message markers

Summary: SystraceMessage needs to have a flush method

Reviewed By: shergin

Differential Revision: D9696709

fbshipit-source-id: 7f8c9422fbc2e3ca8c184015889a4d1aa1500a7c
This commit is contained in:
Ram N 2018-09-06 21:22:17 -07:00 committed by Facebook Github Bot
parent f38ab24a19
commit 4b15eb53ec

View File

@ -804,8 +804,7 @@ public class ReactInstanceManager {
synchronized (mPackages) { synchronized (mPackages) {
Set<String> uniqueNames = new HashSet<>(); Set<String> uniqueNames = new HashSet<>();
for (ReactPackage reactPackage : mPackages) { for (ReactPackage reactPackage : mPackages) {
SystraceMessage.beginSection( SystraceMessage.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "ReactInstanceManager.getViewManagerName")
Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "ReactInstanceManager.getViewManagerName")
.arg("Package", reactPackage.getClass().getSimpleName()) .arg("Package", reactPackage.getClass().getSimpleName())
.flush(); .flush();
if (reactPackage instanceof ViewManagerOnDemandReactPackage) { if (reactPackage instanceof ViewManagerOnDemandReactPackage) {
@ -815,7 +814,7 @@ public class ReactInstanceManager {
uniqueNames.addAll(names); uniqueNames.addAll(names);
} }
} }
Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE); SystraceMessage.endSection(TRACE_TAG_REACT_JAVA_BRIDGE).flush();
} }
Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE); Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);
return new ArrayList<>(uniqueNames); return new ArrayList<>(uniqueNames);
@ -1194,6 +1193,6 @@ public class ReactInstanceManager {
if (reactPackage instanceof ReactPackageLogger) { if (reactPackage instanceof ReactPackageLogger) {
((ReactPackageLogger) reactPackage).endProcessPackage(); ((ReactPackageLogger) reactPackage).endProcessPackage();
} }
SystraceMessage.endSection(TRACE_TAG_REACT_JAVA_BRIDGE); SystraceMessage.endSection(TRACE_TAG_REACT_JAVA_BRIDGE).flush();
} }
} }