mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
07153dd8f2
Summary: Thanks for submitting a pull request! Please provide enough information so that others can review your pull request: > **Unless you are a React Native release maintainer and cherry-picking an *existing* commit into a current release, ensure your pull request is targeting the `master` React Native branch.** Explain the **motivation** for making this change. What existing problem does the pull request solve? Prefer **small pull requests**. These are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it. **Test plan (required)** Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI. Make sure tests pass on both Travis and Circle CI. **Code formatting** Look around. Match the style of the rest of the codebase. See also the simple [style guide](https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#style-guide). For more info, see Closes https://github.com/facebook/react-native/pull/12818 Differential Revision: D4680312 Pulled By: AaaChiuuu fbshipit-source-id: d8410e99c3ced4e2c94145186a450923029d5b22
107 lines
2.4 KiB
Java
107 lines
2.4 KiB
Java
/**
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*/
|
|
|
|
package com.facebook.systrace;
|
|
|
|
import android.os.Build;
|
|
import android.os.Trace;
|
|
|
|
/**
|
|
* Systrace stub that mostly does nothing but delegates to Trace for beginning/ending sections.
|
|
* The internal version of this file has not been opensourced yet.
|
|
*/
|
|
public class Systrace {
|
|
|
|
public static final long TRACE_TAG_REACT_JAVA_BRIDGE = 0L;
|
|
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 enum EventScope {
|
|
THREAD('t'),
|
|
PROCESS('p'),
|
|
GLOBAL('g');
|
|
|
|
private final char mCode;
|
|
|
|
private EventScope(char code) {
|
|
mCode = code;
|
|
}
|
|
|
|
public char getCode() {
|
|
return mCode;
|
|
}
|
|
}
|
|
|
|
public static void registerListener(TraceListener listener) {
|
|
}
|
|
|
|
public static void unregisterListener(TraceListener listener) {
|
|
}
|
|
|
|
public static boolean isTracing(long tag) {
|
|
return false;
|
|
}
|
|
|
|
public static void traceInstant(
|
|
long tag,
|
|
final String title,
|
|
EventScope scope) {
|
|
}
|
|
|
|
public static void beginSection(long tag, final String sectionName) {
|
|
if (Build.VERSION.SDK_INT >= 18) {
|
|
Trace.beginSection(sectionName);
|
|
}
|
|
}
|
|
|
|
public static void endSection(long tag) {
|
|
if (Build.VERSION.SDK_INT >= 18) {
|
|
Trace.endSection();
|
|
}
|
|
}
|
|
|
|
public static void beginAsyncSection(
|
|
long tag,
|
|
final String sectionName,
|
|
final int cookie) {
|
|
}
|
|
|
|
public static void endAsyncSection(
|
|
long tag,
|
|
final String sectionName,
|
|
final int cookie) {
|
|
}
|
|
|
|
public static void traceCounter(
|
|
long tag,
|
|
final String counterName,
|
|
final int counterValue) {
|
|
}
|
|
|
|
public static void startAsyncFlow(
|
|
long tag,
|
|
final String sectionName,
|
|
final int cookie) {
|
|
}
|
|
|
|
public static void stepAsyncFlow(
|
|
long tag,
|
|
final String sectionName,
|
|
final int cookie) {
|
|
}
|
|
|
|
public static void endAsyncFlow(
|
|
long tag,
|
|
final String sectionName,
|
|
final int cookie) {
|
|
}
|
|
}
|