Allow limiting depth and top level frames being logged when tracing javascript
Categories
(DevTools :: Debugger, enhancement)
Tracking
(firefox123 fixed)
Tracking | Status | |
---|---|---|
firefox123 | --- | fixed |
People
(Reporter: ochameau, Assigned: ochameau)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
Thanks to bug 1870710, it will be easier to start the tracer when we reproduce a bug, but then it may log too many frames.
We could introduce two settings to limit the depth and limit the number of top level frames being logged.
The second setting would automatically stop the tracer, while the first would only reduce the depth of all stack being logged.
Assignee | ||
Comment 1•2 years ago
|
||
The JavaScript Tracer may be initiated by the debugger, or stoped by itself when reaching some limit.
In these cases, the start and stop messages wouldn't have been logged in the console.
Updated•2 years ago
|
Assignee | ||
Comment 2•2 years ago
|
||
These two settings are only available via the web console commands as they expect number as arguments
which is hard to implement via the context menu on the debugger button.
Move stdout logging to a dedicated method as onEnterFrame reached eslint complexity limit.
Comment 3•2 years ago
|
||
Alex, did you got request for that feature from users? I don't see how this could be helpful, as when you're looking for something, you probably want everything ?
Assignee | ||
Comment 4•2 years ago
|
||
(In reply to Nicolas Chevobbe [:nchevobbe] from comment #3)
Alex, did you got request for that feature from users? I don't see how this could be helpful, as when you're looking for something, you probably want everything ?
No. But actually, in the currrent bucket of work around tracing, I only got the explicit request for the logging of DOM Events.
Even the native method tracking was a personal suggestion, as well as argument logging.
But let me explain the reasoning behind this feature:
When we are testing this in reviews, we aren't testing in real world web compat scenarios involving things like Google Tag Manager and heavy loaded pages.
In the wild, the main challenge of the tracer is the overload of data!
While the key shortcut, start on next mousedown/mouseup, start on next page load all help reduce tracer output by delaying the record as much as possible, there should also be features to eagerly stop the record.
Depth and records may feel arbitrar cuts, but I'm convinced it can be useful for thoughtful engineer:
- Depth set to 1 could be useful to only see the dom events and first function being called. You can then set a breakpoint in one of these functions and investigate down the call stack by setting in. Or ideally later have tracer breakpoint to focus on just this method.
- Record set to 1 may help see only the mousedown event listener and nothing asynchronous being running after that, or any other DOM event.
On real (messy) web pages, these limits help when you are reaching the web console size limit. When you are tracing a page load, you quickly hit it.
Also, I wanted to keep the JS Tracer behind a preference to ease working on many features like these.
Similarly to the Profiler, if we want to later expose that to general audience, we may expose simple versus expert settings.
We may keep the advanced features for the console commands, while keeping the UI button simplier.
Comment 5•2 years ago
|
||
alright, I understand. I feel like those could be addressed by more capable UI features, but I agree that it's cheaper to have those as command argument for now so we can prototype and experiment
Comment 7•2 years ago
|
||
Backed out with Bug 1873007 for causing failures on browser_dbg-javascript-tracer.js
- backout: https://hg.mozilla.org/integration/autoland/rev/ea866029ce2e23f03843038e1fd8ba7ca9ea30bb
- push: https://treeherder.mozilla.org/jobs?repo=autoland&group_state=expanded&selectedTaskRun=HN79xa5DQMGMXklk_Mcu1A.0&revision=f94198e20472275db87efe7b903db30b13a368d6
- failure log: TEST-UNEXPECTED-FAIL | devtools/client/debugger/test/mochitest/browser_dbg-javascript-tracer.js | A promise chain failed to handle a rejection: Unsupported tracer log method null - stack: transformTracerStateResource@resource://devtools/client/webconsole/utils/messages.js:431:13
Assignee | ||
Comment 8•2 years ago
|
||
I think I forgot to push latest revision to phabricator before landing.
Try was and is still green on my local, rebased version:
https://treeherder.mozilla.org/jobs?repo=try&revision=f5762db0ae3d38a83db74c66937af4f7377ed0ff
I'll try to land again while having rebased the patch on phab.
Comment 10•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/0759aca1b4fc
https://hg.mozilla.org/mozilla-central/rev/8ba077ee1c37
Comment 11•2 years ago
|
||
== Change summary for alert #40937 (as of Wed, 10 Jan 2024 06:24:27 GMT) ==
Regressions:
Ratio | Test | Platform | Options | Absolute values (old vs new) |
---|---|---|---|---|
2% | browser-console:parent-process objects-with-stacks | linux1804-64-qr | 16,434.00 -> 16,765.00 |
For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=40937
could also be caused by Bug 1873007 , but it sounded less plausible
Description
•