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
fix: extend tracing startRecording API to take a full tracing config #13914
Conversation
@ZacWalk would you still like to land this? |
050e71a
to
e1ac839
Compare
a361d32
to
4ff6f96
Compare
@codebytere I'm going to land this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs a test.
} | ||
|
||
base::DictionaryValue memory_dump_config; | ||
if (ConvertFromV8(isolate, val, &memory_dump_config)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this come before the dictionary version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a comment in code why it should go after.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nornagon Can you take a look again?
Yeah. That's why two checkboxes in the description are left unchecked, and the |
4ff6f96
to
2c395ad
Compare
2c395ad
to
fc87e40
Compare
e84d93d
to
58d03dc
Compare
@@ -52,8 +52,6 @@ Once all child processes have acknowledged the `getCategories` request the | |||
### `contentTracing.startRecording(options, callback)` | |||
|
|||
* `options` Object | |||
* `categoryFilter` String | |||
* `traceOptions` String |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MarshallOfSound How properly reflect in the docs the fact that the options
Object can have two different formats?
First format is {categoryFilter: "...", traceOptions: "..."}
, another one something like
{
"included_categories": ["disabled-by-default-memory-infra"],
"excluded_categories": ["*"],
"memory_dump_config": {
"triggers": [
{ "mode": "light", "periodic_interval_ms": 50 },
{ "mode": "detailed", "periodic_interval_ms": 1000 }
]
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a little 😬 that one of these formats uses camelCase
and the other uses snake_case
. Is it worth converting one of them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nornagon the {categoryFilter: "...", traceOptions: "..."}
variant is the only currently available, I don't want to break existing code.
The other one is a Chromium thing, and I don't want to overcomplicate it by adding format converting logic.
58d03dc
to
31ef93b
Compare
31ef93b
to
79443b2
Compare
@MarshallOfSound What does this error mean? How we can fix it? electron-lint job
|
@alexeykuzmin it's erroring here; you'll need to update that test to correspond to the new parameters and structures introduced in this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we deprecate the old way of doing it or are they both useful in some cases?
@@ -52,8 +52,6 @@ Once all child processes have acknowledged the `getCategories` request the | |||
### `contentTracing.startRecording(options, callback)` | |||
|
|||
* `options` Object | |||
* `categoryFilter` String | |||
* `traceOptions` String |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a little 😬 that one of these formats uses camelCase
and the other uses snake_case
. Is it worth converting one of them?
79443b2
to
8cc9609
Compare
Ok, but I'll create a PR anyway. We'll merge it after the stable release then. |
Release Notes Persisted
|
I have automatically backported this PR to "3-0-x", please check out #16157 |
I have automatically backported this PR to "4-0-x", please check out #16158 |
/trop run backport-to 3-1-x |
The backport process for this PR has been manually initiated, |
I have automatically backported this PR to "3-1-x", please check out #16159 |
This allows memory-infra to be traced correctly. For memory-infra to be traced memory_dump_config and triggers need to be defined.
Fixes #12506.
Example usage:
More? docs https://chromium.googlesource.com/chromium/src/+/master/docs/memory-infra/memory_infra_startup_tracing.md#the-advanced-way
npm test
passesRelease Notes
Notes: allow passing a trace config as options to a "contentTracing.startRecording" call