-
Notifications
You must be signed in to change notification settings - Fork 650
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce format-agnostic API for JS Sampling #1603
Open
hoxyq
wants to merge
2
commits into
facebook:main
Choose a base branch
from
hoxyq:export-D67353585
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+625
−30
Conversation
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
facebook-github-bot
added
the
CLA Signed
Do not delete this pull request or issue due to inactivity.
label
Jan 28, 2025
This pull request was exported from Phabricator. Differential Revision: D67353585 |
hoxyq
added a commit
to hoxyq/hermes
that referenced
this pull request
Jan 28, 2025
Summary: This diff adds a new API on `HermesRuntime`, which will emit a `struct` with all necessary information about completed JavaScript Sampling Profile. This `struct` can later be used by other third parties, such as React Native. The reason for creating a data source, and not just providing a stream to which Hermes will emit serialized information is that on React Native side we own the format in which data should be serialized, together with the data from other potential sources, such as User Timings, Interactions, Network, etc. HermesRuntime will have 2 new API endpoints: - `dumpAsProfile`. A method on `HermesRuntime` instance, which returns `Profile` that contains all relevant information about the recorded sampled stack trace. - `dumpAsProfilesGlobal`. A static method, which returns vector of all recorded Profiles for all registered sampling profiler instances. The actual conversion to Trace Event Format will hapen on React Native side, Hermes will only emit data structure that is agnostic to format and operates only with JavaScript runtime-level entities and general stuff: call stack frame information, timestamps, information about OS process and thread where sampling occured. Differential Revision: D67353585
hoxyq
force-pushed
the
export-D67353585
branch
from
January 28, 2025 19:15
64f3216
to
3486e70
Compare
This pull request was exported from Phabricator. Differential Revision: D67353585 |
hoxyq
added a commit
to hoxyq/hermes
that referenced
this pull request
Jan 28, 2025
Summary: This diff adds a new API on `HermesRuntime`, which will emit a `struct` with all necessary information about completed JavaScript Sampling Profile. This `struct` can later be used by other third parties, such as React Native. The reason for creating a data source, and not just providing a stream to which Hermes will emit serialized information is that on React Native side we own the format in which data should be serialized, together with the data from other potential sources, such as User Timings, Interactions, Network, etc. HermesRuntime will have 2 new API endpoints: - `dumpAsProfile`. A method on `HermesRuntime` instance, which returns `Profile` that contains all relevant information about the recorded sampled stack trace. - `dumpAsProfilesGlobal`. A static method, which returns vector of all recorded Profiles for all registered sampling profiler instances. The actual conversion to Trace Event Format will hapen on React Native side, Hermes will only emit data structure that is agnostic to format and operates only with JavaScript runtime-level entities and general stuff: call stack frame information, timestamps, information about OS process and thread where sampling occured. Reviewed By: dannysu Differential Revision: D67353585
hoxyq
force-pushed
the
export-D67353585
branch
from
January 28, 2025 19:28
3486e70
to
80fcff0
Compare
This pull request was exported from Phabricator. Differential Revision: D67353585 |
Summary: The sampling profiler tracks the type of each frame. A "suspend" frame denotes that execution is suspended, with an arbitrary string providing details. We would like to identify GC frames for the sake of Chrome DevTools visualizations/stats about GC time. This diff adds an enum to suspend frames to allow GC frames to be identified without depending on specific contents of the details string. Another option would be to replace the "suspend" frame with multiple different frame types for debugger, GC, etc. Differential Revision: D68442991
Summary: This diff adds a new API on `HermesRuntime`, which will emit a `struct` with all necessary information about completed JavaScript Sampling Profile. This `struct` can later be used by other third parties, such as React Native. The reason for creating a data source, and not just providing a stream to which Hermes will emit serialized information is that on React Native side we own the format in which data should be serialized, together with the data from other potential sources, such as User Timings, Interactions, Network, etc. HermesRuntime will have 2 new API endpoints: - `dumpAsProfile`. A method on `HermesRuntime` instance, which returns `Profile` that contains all relevant information about the recorded sampled stack trace. - `dumpAsProfilesGlobal`. A static method, which returns vector of all recorded Profiles for all registered sampling profiler instances. The actual conversion to Trace Event Format will hapen on React Native side, Hermes will only emit data structure that is agnostic to format and operates only with JavaScript runtime-level entities and general stuff: call stack frame information, timestamps, information about OS process and thread where sampling occured. Reviewed By: dannysu Differential Revision: D67353585
hoxyq
force-pushed
the
export-D67353585
branch
from
January 31, 2025 13:05
80fcff0
to
94d5eef
Compare
This pull request was exported from Phabricator. Differential Revision: D67353585 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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:
This diff adds a new API on
HermesRuntime
, which will emit astruct
with all necessary information about completed JavaScript Sampling Profile.This
struct
can later be used by other third parties, such as React Native. The reason for creating a data source, and not just providing a stream to which Hermes will emit serialized information is that on React Native side we own the format in which data should be serialized, together with the data from other potential sources, such as User Timings, Interactions, Network, etc.HermesRuntime will have 2 new API endpoints:
dumpAsProfile
. A method onHermesRuntime
instance, which returnsProfile
that contains all relevant information about the recorded sampled stack trace.dumpAsProfilesGlobal
. A static method, which returns vector of all recorded Profiles for all registered sampling profiler instances.The actual conversion to Trace Event Format will hapen on React Native side, Hermes will only emit data structure that is agnostic to format and operates only with JavaScript runtime-level entities and general stuff: call stack frame information, timestamps, information about OS process and thread where sampling occured.
Differential Revision: D67353585