-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate perfetto with UserTiming API (#44702)
Summary: Pull Request resolved: #44702 Based on bgirard initial changes in D53478653, this creates an initial integration of the Perfetto SDK with the User Timing API, allowing performance information to be logged from JS to Perfetto traces. We only enable this for Android right now, but may be able to leverage this on other platforms too in the future. The logic in `initializePerfetto` may need to moved to another common target (eg reactperflogger) once we want to make this usable in other components, but keeping it scoped to User Timing for now. Changelog: [Internal] Reviewed By: bgirard Differential Revision: D57881823 fbshipit-source-id: 11ba09cbc01a102a72eee65ce6d6aeca508e864a
- Loading branch information
Showing
5 changed files
with
140 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...ages/react-native/ReactCommon/reactperflogger/reactperflogger/ReactPerfettoCategories.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
#include "ReactPerfettoCategories.h" | ||
|
||
#ifdef WITH_PERFETTO | ||
|
||
PERFETTO_TRACK_EVENT_STATIC_STORAGE(); | ||
|
||
#endif |
18 changes: 18 additions & 0 deletions
18
packages/react-native/ReactCommon/reactperflogger/reactperflogger/ReactPerfettoCategories.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#ifdef WITH_PERFETTO | ||
|
||
#include <perfetto.h> | ||
|
||
PERFETTO_DEFINE_CATEGORIES( | ||
perfetto::Category("react-native") | ||
.SetDescription("User timing events from React Native")); | ||
|
||
#endif |