Written for dotnet-trace version 8.0.510501
Download from Microsoft:
dotnet tool install --global dotnet-trace
dotnet-trace ps
Replace <pid> with the value from the previous step
dotnet-trace collect --process-id <pid> --providers Private.InternalDiagnostics.System.Net.Sockets --output sockets.nettrace
Open the output socket.nettrace
file in PerfView
The Private.InternalDiagnostics.System.Net.Sockets value comes from the EventSource attribute in the NetEventSource source code. See: NetEventSource.Sockets.cs