Commit Graph

3 Commits

Author SHA1 Message Date
eri
f621e54b54 tools: Update DevTools parser flags (#40488)
Rename the `--scan` argument to `-w/--write-file` and the `--use`
argument to `-r/--read-file`. This is more aligned with `tshark`'s
syntax, and I think it is a more intuitive naming scheme.

Remove the `--filter` and `--range` arguments. They are very easily
replaced by more powerful tools like `grep` and `jq`. It seems
unnecessary to have them in this script (specially when the most useful
thing it does is exporting the capture as NDJSON for other tools to
process). This fixes an issue with the last message not being exported.

Change the default port to `6080`. This matches the current information
[in the
book](https://book.servo.org/hacking/using-devtools.html#connecting-to-servo)
on how to run Servo with DevTools enabled.

Testing: Checked with `math test-scripts`

---------

Signed-off-by: eri <eri@igalia.com>
2025-11-08 14:51:29 +00:00
eri
7673629667 tools: Remove wrapped JSON message in the DevTools parser (#40489)
Instead of outputing `{"_to": "...", "message": {"to": "...", ...}}` the
JSON message is simplified to `{"to": "...", ...}`. This is possible
since all valid devtools messages include a "to" or a "from" field.
These two fields will always be placed at the start of the serialized
message, with the rest of fields being sorted alphabetically.

Simplify detection of server or client message, removing the need to
pass the devtools port when reading a .pcap file. Now the pretty message
says "Server" and "Client" instead of "Servo" and "Firefox", which was
innacurate when inspecting one instance of Firefox from another.

Testing: Check with `mach test-scripts`

Signed-off-by: eri <eri@igalia.com>
2025-11-08 09:09:02 +00:00
Delan Azabani
2c94110952 Devtools parser: reassemble fragmented messages (#36033)
* Devtools parser: reassemble fragmented messages

Co-authored-by: Aria Edmonds <8436007+ar1a@users.noreply.github.com>
Signed-off-by: Delan Azabani <dazabani@igalia.com>

* Enable devtools parser tests on Linux only for now

Signed-off-by: Delan Azabani <dazabani@igalia.com>

---------

Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: Aria Edmonds <8436007+ar1a@users.noreply.github.com>
2025-03-29 05:44:43 +00:00