Easy: Add Java module and method name to systrace in xplat bridge
Summary: We lost java module and method names in systrace when we moved to the xplat bridge. Reviewed By: mhorowitz Differential Revision: D3116042 fb-gh-sync-id: a61181f4d6be04c70122b7f79d426e364df1e988 fbshipit-source-id: a61181f4d6be04c70122b7f79d426e364df1e988
This commit is contained in:
parent
ac03c47895
commit
d3b8846400
|
@ -11,6 +11,7 @@ package com.facebook.react.bridge;
|
|||
|
||||
import com.facebook.infer.annotation.Assertions;
|
||||
import com.facebook.systrace.Systrace;
|
||||
import com.facebook.systrace.SystraceMessage;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
|
@ -160,6 +161,7 @@ public abstract class BaseJavaModule implements NativeModule {
|
|||
private final Object[] mArguments;
|
||||
private String mType = METHOD_TYPE_REMOTE;
|
||||
private final int mJSArgumentsNeeded;
|
||||
private final String mTraceName;
|
||||
|
||||
public JavaMethod(Method method) {
|
||||
mMethod = method;
|
||||
|
@ -169,6 +171,7 @@ public abstract class BaseJavaModule implements NativeModule {
|
|||
// save to allocate only one arguments object per method that can be reused across calls
|
||||
mArguments = new Object[parameterTypes.length];
|
||||
mJSArgumentsNeeded = calculateJSArgumentsNeeded();
|
||||
mTraceName = BaseJavaModule.this.getName() + "." + mMethod.getName();
|
||||
}
|
||||
|
||||
private ArgumentExtractor[] buildArgumentExtractors(Class[] paramTypes) {
|
||||
|
@ -231,7 +234,9 @@ public abstract class BaseJavaModule implements NativeModule {
|
|||
|
||||
@Override
|
||||
public void invoke(CatalystInstance catalystInstance, ExecutorToken executorToken, ReadableNativeArray parameters) {
|
||||
Systrace.beginSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "callJavaModuleMethod");
|
||||
SystraceMessage.beginSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "callJavaModuleMethod")
|
||||
.arg("method", mTraceName)
|
||||
.flush();
|
||||
try {
|
||||
if (mJSArgumentsNeeded != parameters.size()) {
|
||||
throw new NativeArgumentsParseException(
|
||||
|
|
Loading…
Reference in New Issue