Add Systrace-based telemetry to Hermes GC.
Reviewed By: amnn Differential Revision: D6393879 fbshipit-source-id: d35a4647d000356dc99bce3187acc50d3a69ddeb
This commit is contained in:
parent
968c88d141
commit
05e862d48d
|
@ -27,7 +27,7 @@ type RelayProfiler = {
|
|||
|
||||
/* eslint no-bitwise: 0 */
|
||||
const TRACE_TAG_REACT_APPS = 1 << 17;
|
||||
const TRACE_TAG_JSC_CALLS = 1 << 27;
|
||||
const TRACE_TAG_JS_VM_CALLS = 1 << 27;
|
||||
|
||||
let _enabled = false;
|
||||
let _asyncCookie = 0;
|
||||
|
@ -155,9 +155,9 @@ const Systrace = {
|
|||
if (_enabled !== enabled) {
|
||||
if (__DEV__) {
|
||||
if (enabled) {
|
||||
global.nativeTraceBeginLegacy && global.nativeTraceBeginLegacy(TRACE_TAG_JSC_CALLS);
|
||||
global.nativeTraceBeginLegacy && global.nativeTraceBeginLegacy(TRACE_TAG_JS_VM_CALLS);
|
||||
} else {
|
||||
global.nativeTraceEndLegacy && global.nativeTraceEndLegacy(TRACE_TAG_JSC_CALLS);
|
||||
global.nativeTraceEndLegacy && global.nativeTraceEndLegacy(TRACE_TAG_JS_VM_CALLS);
|
||||
}
|
||||
if (_canInstallReactHook) {
|
||||
if (_useFiber) {
|
||||
|
|
|
@ -29,7 +29,7 @@ import static com.facebook.react.bridge.ReactMarkerConstants.SETUP_REACT_CONTEXT
|
|||
import static com.facebook.react.bridge.ReactMarkerConstants.SETUP_REACT_CONTEXT_START;
|
||||
import static com.facebook.systrace.Systrace.TRACE_TAG_REACT_APPS;
|
||||
import static com.facebook.systrace.Systrace.TRACE_TAG_REACT_JAVA_BRIDGE;
|
||||
import static com.facebook.systrace.Systrace.TRACE_TAG_REACT_JSC_CALLS;
|
||||
import static com.facebook.systrace.Systrace.TRACE_TAG_REACT_JS_VM_CALLS;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
|
@ -395,8 +395,9 @@ public class ReactInstanceManager {
|
|||
.logMessage(ReactDebugOverlayTags.RN_CORE, "RNCore: recreateReactContextInBackground");
|
||||
UiThreadUtil.assertOnUiThread();
|
||||
|
||||
if (mUseDeveloperSupport && mJSMainModulePath != null &&
|
||||
!Systrace.isTracing(TRACE_TAG_REACT_APPS | TRACE_TAG_REACT_JSC_CALLS)) {
|
||||
if (mUseDeveloperSupport
|
||||
&& mJSMainModulePath != null
|
||||
&& !Systrace.isTracing(TRACE_TAG_REACT_APPS | TRACE_TAG_REACT_JS_VM_CALLS)) {
|
||||
final DeveloperSettings devSettings = mDevSupportManager.getDevSettings();
|
||||
|
||||
// If remote JS debugging is enabled, load from dev server.
|
||||
|
@ -1094,7 +1095,7 @@ public class ReactInstanceManager {
|
|||
if (mBridgeIdleDebugListener != null) {
|
||||
catalystInstance.addBridgeIdleDebugListener(mBridgeIdleDebugListener);
|
||||
}
|
||||
if (Systrace.isTracing(TRACE_TAG_REACT_APPS | TRACE_TAG_REACT_JSC_CALLS)) {
|
||||
if (Systrace.isTracing(TRACE_TAG_REACT_APPS | TRACE_TAG_REACT_JS_VM_CALLS)) {
|
||||
catalystInstance.setGlobalVariable("__RCTProfileIsProfiling", "true");
|
||||
}
|
||||
ReactMarker.logMarker(ReactMarkerConstants.PRE_RUN_JS_BUNDLE_START);
|
||||
|
|
|
@ -22,7 +22,7 @@ public class Systrace {
|
|||
public static final long TRACE_TAG_REACT_APPS = 0L;
|
||||
public static final long TRACE_TAG_REACT_FRESCO = 0L;
|
||||
public static final long TRACE_TAG_REACT_VIEW = 0L;
|
||||
public static final long TRACE_TAG_REACT_JSC_CALLS = 0L;
|
||||
public static final long TRACE_TAG_REACT_JS_VM_CALLS = 0L;
|
||||
|
||||
public enum EventScope {
|
||||
THREAD('t'),
|
||||
|
|
Loading…
Reference in New Issue