Trace Chromium Network Traffic: RayFo/Chromium - #52
Conversation
…RayFo/Chromium
…into RayFo/Chromium
|
Harold Pratt (@htpiv) Rob Grimes (@rgrimes-ms) Can you please take a look and approve the pull to main? I'll update the documentation once there's a new build. Thank you! |
|
FYI, WPA (x64 or ARM64) loads these modules as provided by the NETBLAME installation. |
Quick Steps to Download, Build, and Run this version/PR via PowerShell:
|
| public ODispatchQTable odqTable; | ||
| public IdleManTable idleTable; | ||
| public ThreadTable threadTable; | ||
| public ChromiumTable chromiumTable; |
There was a problem hiding this comment.
Do we need to account for this new table in EventCount()?
There was a problem hiding this comment.
Hmm... Yes, ideally EventCount (in NetBlameDataProcessor.cs) should add:
+ this.chromiumTable.Count
Because if EventCount()==0 then NetBlame will return: "No Data"
As a practical matter, when there are Chromium events there will be TCP events, so: EventCount()!=0
For the main NetBlame view, Chromium events link to WinSock events, which link to TCP events. But such links to lower-level transport activity are not required for showing Chromium activity.
| AssertInfo(session != null); | ||
| if (session == null) | ||
| { | ||
| session = new Session(StreamType.QUIC, in evt); |
There was a problem hiding this comment.
This handler is processing HTTP2_SESSION_SEND_DATA and HTTP2_SESSION_RECV_DATA , but the recovery path creates a QUIC session. If tracing starts after the original HTTP/2 session-creation event, this can classify HTTP/2 traffic as HTTP/3 and split subsequent events across different sessions. Should this be StreamType.HTTP2, matching the surrounding HTTP/2 recovery paths?
There was a problem hiding this comment.
Good catch:
session = new Session(StreamType.HTTP2, in evt);
| { | ||
| IPEndPoint addrRemote; | ||
| if (this.socket == null && this.resolver?.rgstrAddress?.Length > 0) | ||
| addrRemote = new(IPAddress.Parse(this.resolver.rgstrAddress[0]), this.port); |
There was a problem hiding this comment.
Use TryParse or a helper to avoid aborting on a throw?
There was a problem hiding this comment.
Yeah, to be really defensive it should use: IPAddress.TryParse
if (this.socket == null && this.resolver?.rgstrAddress?.Length > 0 && IPAddress.TryParse(this.resolver.rgstrAddress[0], out IPAddress addrParse))
addrRemote = new(addrParse, this.port);
| stream = session.EnsureStream(iStream, evt.Timestamp.ToGraphable()); | ||
|
|
||
| if (evt.TaskName.Equals("HTTP3_DATA_SENT")) | ||
| stream.cbSend = cb; |
There was a problem hiding this comment.
stream.cbSend += cb ?
Same question on line 4554
There was a problem hiding this comment.
Preliminary assessment: Yes, use: +=
|
|
Ricardo Esquivel (richybourne)
left a comment
There was a problem hiding this comment.
Resubmitting "request changes" PR review on GH account with access to repo.
Trace Chromium Network Traffic: Chrome, Edge, WebView2 browsers
This commit adds the "Chromium" protocol class to the main NetBlame data table (in addition to WinINet, WinHTTP, Winsock, TcpIp).
It also adds a new Chromium-specific table: "NetBlame Chromium Requests"
In the DEBUG build (enable AUX_TABLES) there is also a table oriented around HTTP2/3 Streams.
It enables these Providers for Chrome, Edge, WebView2:
Update NetBlame Add-in
Add Chromium ETW processing:
.\src\netblame\providers\chromium.cs.\src\netblame\gathertables.cs.\src\netblame\tables\netblametable.url.cs.\src\netblame\netblamedataprocessor.cs.\src\netblame\auxiliary\callstack.cs.\src\netblame\auxiliary\extensions.cs.\src\netblame\auxiliary\netutil.csMinor Update:
.\src\netblame\providers\dnsclient.cs.\src\netblame\providers\winsockafd.csNits:
.\src\netblame\providers\tcpip.cs.\src\netblame\tables\netblametable.webio.request.cs.\src\netblame\tables\netblametable.winsock.cs.\src\netblame\tables\tablebase.csUpdate Scripts
PowerShell:
.\src\tracenetwork.ps1.\src\beta\tracenetwork.ps1WPR Profiles:
.\src\wprp\edgechrome.15002.wprp.\src\wprp\edgechrome.wprpComments for Build:
.\src\netblame\.editorconfigBUILD
RELEASE:
dotnet build -c RELEASEDEBUG:
dotnet build -c DEBUG -p AUX_TABLES=1TEST
Capture a trace:
.\src\TraceNetwork StartLaunch Edge or Chrome and navigate to a site.
.\src\TraceNetwork StopThe script knows how to pick up the built version of the NetBlame add-in:
.\src\BETA\TraceNetwork View -fastsym -verboseThis update resolves #50
Chromium Integration into NetBlame WPA Network Plug-in