Skip to content

Commit

Permalink
Add Systrace-based telemetry to Hermes GC.
Browse files Browse the repository at this point in the history
Reviewed By: amnn

Differential Revision: D6393879

fbshipit-source-id: d35a4647d000356dc99bce3187acc50d3a69ddeb
  • Loading branch information
David Detlefs authored and facebook-github-bot committed Nov 23, 2017
1 parent 968c88d commit 05e862d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions Libraries/Performance/Systrace.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
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;
Expand Down Expand Up @@ -395,8 +395,9 @@ private void recreateReactContextInBackgroundInner() {
.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.
Expand Down Expand Up @@ -1094,7 +1095,7 @@ private ReactApplicationContext createReactContext(
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down

0 comments on commit 05e862d

Please sign in to comment.