Record React Native process and Main thread#49370
Closed
hoxyq wants to merge 4 commits into
Closed
Conversation
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D69465926 |
4eabc3d to
eb863d7
Compare
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D69465926 |
Summary: # Changelog: [Internal] Added OS-agnostic module that will implement 2 basic capabilities: - Getting current process id - Getting current thread id Reviewed By: javache Differential Revision: D69316093
Summary: # Changelog: [Internal] Use newly added module to get real OS-level process and thread ids. We will keep process id on an instance, because I don't think it could change over time? For thread id, we will get it at the time of event registration. Reviewed By: rozele Differential Revision: D69316094
…k#49083) Summary: # Changelog: [Internal] > NOTE: Some CI jobs are expected to fail, because changes in Hermes D67353585 should be landed first, and then grafted to Static Hermes. Added 2 new public methods to `PerformanceTracer` instance for registering metadata Trace Events for processes and threads. Reviewed By: huntie Differential Revision: D68439733
Summary: # Changelog: [Internal] When we start tracing, we will record metadata event for current process. We will base it off the assumption that the thread where we handle `Tracing.start` event is the main one. We can't register the main thread yet: 1. We can't assume that CDP messages are handled on it - this is not the case for Windows and in a long term Inspector will be moved to its own thread 2. We don't have any similar mechanism as Runtime Executor, but for Main thread. This will require Host providing an executor for it. I've validated at the top of the stack that not registering the main thread should not affect how trace is displayed in CDT. Reviewed By: rozele Differential Revision: D69465926
eb863d7 to
b712138
Compare
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D69465926 |
Contributor
|
This pull request has been merged in 13dae06. |
ghost
pushed a commit
to discord/react-native
that referenced
this pull request
Jul 29, 2025
Summary: Pull Request resolved: facebook#49370 # Changelog: [Internal] When we start tracing, we will record metadata event for current process. We will base it off the assumption that the thread where we handle `Tracing.start` event is the main one. We can't register the main thread yet: 1. We can't assume that CDP messages are handled on it - this is not the case for Windows and in a long term Inspector will be moved to its own thread 2. We don't have any similar mechanism as Runtime Executor, but for Main thread. This will require Host providing an executor for it. I've validated at the top of the stack that not registering the main thread should not affect how trace is displayed in CDT. Reviewed By: rozele Differential Revision: D69465926 fbshipit-source-id: 103de1da9d00564bf201456ad04a465387c1d542
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Changelog: [Internal]
When we start tracing, we will record metadata events for current process and thread.
Once we have a separate thread for inspector, we should move this code to be explicitly run on Main thread.
Differential Revision: D69465926