Closed Bug 1622857 Opened 6 years ago Closed 28 days ago

Internal preference for logging RDP request/response packets

Categories

(DevTools :: Framework, enhancement, P4)

enhancement

Tracking

(firefox153 fixed)

RESOLVED FIXED
153 Branch
Tracking Status
firefox153 --- fixed

People

(Reporter: Harald, Assigned: ochameau, NeedInfo)

References

(Blocks 2 open bugs)

Details

User Story

When debugging devtools protocol communication flow, I want to see all the packets and inspect them in detail, so that I can understand which code is making requests and how they are handled.

Attachments

(6 files, 1 obsolete file)

No description provided.
Severity: normal → S3

The RDP packets can still be logged via devtools.debugger.log preference
which turns the flags.wantLogging flag to true and enables the following logs:
https://searchfox.org/firefox-main/search?q=wantLogging&path=transport&case=true&regexp=false
While devtools.debugger.log.verbose pref, enabled these other logs:
https://searchfox.org/firefox-main/search?q=wantLogging&path=transport&case=true&regexp=false

These logs are imperfect, as I think they aren't necessarily logging both inbound and outbound packets.
The verbose helps see more information, but it is only interesting when you care about packet headers, which are super low level and not interesting when you care only about JSON objects.

These stdout logs only works if you also have browser.dom.window.dump.enabled preference set to true, which is a common puzzling issue on release builds where this pref is false (it is true on local builds).

It might be nice to move these logs to MOZ_LOG, the generic logging mechanism used in C++, but now also available in JS.
These is some documentation over here.
The overall idea would be to replace dump methods with:

const logger = console.createInstance({ prefix: "devtools_rdp" });
logger.log(rdpPacket); // Or stringify rdpPacket nicely if stdout logging of the JSON packet isn't nice with stdout logging

so that you can see more easily see the logs in stdout by running firefox like this:

$ MOZ_LOG=devtools_rdp:5 ./firefox  (or ./mach run)

The benefits are that:

  • you no longer need any preference to see the logs on stdout,
  • you can easily control which logs you want to see from the command line,
  • the logs can also be seen in the browser console/toolbox.

Working on this would be a nice step forward re-introducing a RDP inspector UI (UI to see all incoming/outcoming packets).

Lorenz, some improvement recently landed around MOZ_LOG which makes comment 2 suggestion much more actionable.
Are you still interested in contributing something to help seeing RDP packets?

Flags: needinfo?(me)

RDP can be easily traced via stdout by running:
$ MOZ_LOG="devtools_rdp:5" ./mach run

RDP can be easily traced via stdout by running:
$ MOZ_LOG="devtools_rdp:5" ./mach run

Assignee: nobody → poirot.alex
Status: NEW → ASSIGNED

Also remove disabled/commented logging.
You may use "--env MOZ_LOG=devtools_rdp:5" to trace RDP packets on try runs.
Some tests are still toggling the old preference as they may want to
trace other usages of dumpn/dumpv.

The transport layer was the only one using this.

Depends on: 2037827
Attachment #9584031 - Attachment description: WIP: Bug 1622857 - [devtools] Highlights pairs of outgoing/incoming RDP packets in MOZ_LOG output. → Bug 1622857 - [devtools] Highlights pairs of outgoing/incoming RDP packets in MOZ_LOG output. r=#devtools
Attachment #9583069 - Attachment is obsolete: true
Attachment #9584032 - Attachment description: WIP: Bug 1622857 - [devtools] Use MOZ_LOG to trace RDP packets in tests. → Bug 1622857 - [devtools] Use MOZ_LOG to trace RDP packets in tests. r=#devtools
Attachment #9584033 - Attachment description: WIP: Bug 1622857 - [devtools] Migrate transport layer to MOZ_LOG. → Bug 1622857 - [devtools] Migrate transport layer to MOZ_LOG. r=#devtools
Attachment #9584034 - Attachment description: WIP: Bug 1622857 - [devtools] Use a console instance for logging DevToolsWorker messages. → Bug 1622857 - [devtools] Use a console instance for logging DevToolsWorker messages. r=#devtools
Attachment #9584035 - Attachment description: WIP: Bug 1622857 - [devtools] Remove now unused dumpv/verbose logging logic. → Bug 1622857 - [devtools] Remove now unused dumpv/verbose logging logic. r=#devtools
Pushed by apoirot@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/9c63514236db https://hg.mozilla.org/integration/autoland/rev/8eac666269fa [devtools] Log RDP packets via MOZ_LOG. r=devtools-reviewers,jdescottes,nchevobbe https://github.com/mozilla-firefox/firefox/commit/5e8593b7bc21 https://hg.mozilla.org/integration/autoland/rev/c5b50edc9155 [devtools] Highlights pairs of outgoing/incoming RDP packets in MOZ_LOG output. r=devtools-reviewers,nchevobbe https://github.com/mozilla-firefox/firefox/commit/3af4a6d2ad5a https://hg.mozilla.org/integration/autoland/rev/33dd4f7f8e4c [devtools] Use MOZ_LOG to trace RDP packets in tests. r=devtools-reviewers,nchevobbe https://github.com/mozilla-firefox/firefox/commit/0b0b73d5a978 https://hg.mozilla.org/integration/autoland/rev/4d8e40b8c487 [devtools] Migrate transport layer to MOZ_LOG. r=devtools-reviewers,nchevobbe https://github.com/mozilla-firefox/firefox/commit/ff764d01fd1d https://hg.mozilla.org/integration/autoland/rev/a640941015ab [devtools] Use a console instance for logging DevToolsWorker messages. r=devtools-reviewers,nchevobbe https://github.com/mozilla-firefox/firefox/commit/81fd28204b0e https://hg.mozilla.org/integration/autoland/rev/d3f55800bbc2 [devtools] Remove now unused dumpv/verbose logging logic. r=devtools-reviewers,nchevobbe
Blocks: 2041226
Regressions: 2041661
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: