Commit Graph

7 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
eri
8433bdabf8 tools: Use ISO8601 timestamps and filter ports correctly in the Devtools parser (#40428)
A recent change in tshark makes it emit timestamps in ISO 8601 format
(https://gitlab.com/wireshark/wireshark/-/merge_requests/17273), which
breaks the existing parser. Simplify the code to simply print the new
timestamp as is.

The captured messages were not being filtered correctly by the devtools
port, which could result in messy logs. The `-f "tcp port ..."` option
filters the port, while `-d "tcp.port==...,http"` just specifies how the
messages from that port should be treated.

Simplify the tshark command function and some variable names.

Testing: Using `mach test-scripts`.

---------

Signed-off-by: eri <eri@igalia.com>
2025-11-05 21:31:48 +00:00
zefr0x
c96de69e80 Use ruff to enforce python code formatting (#37117)
Requires servo/servo#37045 for deps and config.

Testing: No need for tests to test tests.
Fixes: servo/servo#37041

---------

Signed-off-by: zefr0x <zer0-x.7ty50@aleeas.com>
2025-05-26 11:54:43 +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
Delan Azabani
1cd0ea057d Devtools parser: add --json output mode (#36032)
Signed-off-by: Delan Azabani <dazabani@igalia.com>
2025-03-19 09:22:53 +00:00
eri
fb1c57da3e DevTools: Add parser tool (#32684)
* feat: add devtools parser tool

* feat: improve documentation
2024-07-04 09:15:31 +00:00