Skip to content

Commit 05e862d

Browse files
David Detlefsfacebook-github-bot
David Detlefs
authored andcommitted
Add Systrace-based telemetry to Hermes GC.
Reviewed By: amnn Differential Revision: D6393879 fbshipit-source-id: d35a4647d000356dc99bce3187acc50d3a69ddeb
1 parent 968c88d commit 05e862d

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

Libraries/Performance/Systrace.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ type RelayProfiler = {
2727

2828
/* eslint no-bitwise: 0 */
2929
const TRACE_TAG_REACT_APPS = 1 << 17;
30-
const TRACE_TAG_JSC_CALLS = 1 << 27;
30+
const TRACE_TAG_JS_VM_CALLS = 1 << 27;
3131

3232
let _enabled = false;
3333
let _asyncCookie = 0;
@@ -155,9 +155,9 @@ const Systrace = {
155155
if (_enabled !== enabled) {
156156
if (__DEV__) {
157157
if (enabled) {
158-
global.nativeTraceBeginLegacy && global.nativeTraceBeginLegacy(TRACE_TAG_JSC_CALLS);
158+
global.nativeTraceBeginLegacy && global.nativeTraceBeginLegacy(TRACE_TAG_JS_VM_CALLS);
159159
} else {
160-
global.nativeTraceEndLegacy && global.nativeTraceEndLegacy(TRACE_TAG_JSC_CALLS);
160+
global.nativeTraceEndLegacy && global.nativeTraceEndLegacy(TRACE_TAG_JS_VM_CALLS);
161161
}
162162
if (_canInstallReactHook) {
163163
if (_useFiber) {

ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import static com.facebook.react.bridge.ReactMarkerConstants.SETUP_REACT_CONTEXT_START;
3030
import static com.facebook.systrace.Systrace.TRACE_TAG_REACT_APPS;
3131
import static com.facebook.systrace.Systrace.TRACE_TAG_REACT_JAVA_BRIDGE;
32-
import static com.facebook.systrace.Systrace.TRACE_TAG_REACT_JSC_CALLS;
32+
import static com.facebook.systrace.Systrace.TRACE_TAG_REACT_JS_VM_CALLS;
3333

3434
import android.app.Activity;
3535
import android.content.Context;
@@ -395,8 +395,9 @@ private void recreateReactContextInBackgroundInner() {
395395
.logMessage(ReactDebugOverlayTags.RN_CORE, "RNCore: recreateReactContextInBackground");
396396
UiThreadUtil.assertOnUiThread();
397397

398-
if (mUseDeveloperSupport && mJSMainModulePath != null &&
399-
!Systrace.isTracing(TRACE_TAG_REACT_APPS | TRACE_TAG_REACT_JSC_CALLS)) {
398+
if (mUseDeveloperSupport
399+
&& mJSMainModulePath != null
400+
&& !Systrace.isTracing(TRACE_TAG_REACT_APPS | TRACE_TAG_REACT_JS_VM_CALLS)) {
400401
final DeveloperSettings devSettings = mDevSupportManager.getDevSettings();
401402

402403
// If remote JS debugging is enabled, load from dev server.
@@ -1094,7 +1095,7 @@ private ReactApplicationContext createReactContext(
10941095
if (mBridgeIdleDebugListener != null) {
10951096
catalystInstance.addBridgeIdleDebugListener(mBridgeIdleDebugListener);
10961097
}
1097-
if (Systrace.isTracing(TRACE_TAG_REACT_APPS | TRACE_TAG_REACT_JSC_CALLS)) {
1098+
if (Systrace.isTracing(TRACE_TAG_REACT_APPS | TRACE_TAG_REACT_JS_VM_CALLS)) {
10981099
catalystInstance.setGlobalVariable("__RCTProfileIsProfiling", "true");
10991100
}
11001101
ReactMarker.logMarker(ReactMarkerConstants.PRE_RUN_JS_BUNDLE_START);

ReactAndroid/src/main/java/com/facebook/systrace/Systrace.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class Systrace {
2222
public static final long TRACE_TAG_REACT_APPS = 0L;
2323
public static final long TRACE_TAG_REACT_FRESCO = 0L;
2424
public static final long TRACE_TAG_REACT_VIEW = 0L;
25-
public static final long TRACE_TAG_REACT_JSC_CALLS = 0L;
25+
public static final long TRACE_TAG_REACT_JS_VM_CALLS = 0L;
2626

2727
public enum EventScope {
2828
THREAD('t'),

0 commit comments

Comments
 (0)