annotate "CREATE_MODULE" QP log with the name of the module being created

Reviewed By: achen1

Differential Revision: D4513001

fbshipit-source-id: b98024796c0b0cd2489a67bf0695c86d994689d6
This commit is contained in:
Aaron Chiu 2017-02-10 12:40:36 -08:00 committed by Facebook Github Bot
parent c7c3e4c5d8
commit 15ceed4069
2 changed files with 9 additions and 4 deletions

View File

@ -13,10 +13,10 @@ import com.facebook.proguard.annotations.DoNotStrip;
public class ReactMarker {
public interface MarkerListener {
void logMarker(String name);
void logMarker(String name, @Nullable String tag);
};
@Nullable static private MarkerListener sMarkerListener = null;
private static @Nullable MarkerListener sMarkerListener = null;
public static void setMarkerListener(MarkerListener listener) {
SoftAssertions.assertCondition(
@ -27,8 +27,13 @@ public class ReactMarker {
@DoNotStrip
public static void logMarker(String name) {
logMarker(name, null);
}
@DoNotStrip
public static void logMarker(String name, String tag) {
if (sMarkerListener != null) {
sMarkerListener.logMarker(name);
sMarkerListener.logMarker(name, tag);
}
}
}

View File

@ -105,7 +105,7 @@ public class ModuleHolder {
private NativeModule create() {
boolean isEagerModule = mModule != null;
if (!isEagerModule) {
ReactMarker.logMarker(CREATE_MODULE_START);
ReactMarker.logMarker(CREATE_MODULE_START, mName);
}
SystraceMessage.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "createModule")
.arg("name", mName)