@samitouri / QOSAMI-WSL / commits / 64bcf39a

Add more providers and packet capture to networking.bat (#6465)

Blue committed Jan 27, 2021 at 10:07 UTC 64bcf39a3c309cb3361ac1ae5692ea2fd8995344
2 files changed +28 -2
diagnostics/networking.bat
+8
@@ -19,15 +19,23 @@ powershell.exe -NoProfile "Get-HnsNetwork | Where-Object {$_.Name -eq 'WSL'} | R
19 :: Stop WSL
20 net.exe stop LxssManager
21
22 +:: Start packet capture
23 +powershell.exe -NoProfile "New-NetEventSession HnsPacketCapture -CaptureMode SaveToFile -LocalFilePath %cd%\\packets.etl" || goto :fail
24 +powershell.exe -NoProfile "Add-NetEventPacketCaptureProvider -Level 5 -SessionName HnsPacketCapture -CaptureType BothPhysicalAndSwitch " || goto :fail
25 +powershell.exe -NoProfile "Start-NetEventSession HnsPacketCapture" || goto :fail
26 +
27 :: Collect WSL logs
28 wpr -start wsl_networking.wprp -filemode || goto :fail
29 wsl.exe tr -d "\r" ^| bash < ./networking.sh
30 +
31 wpr -stop wsl.etl || goto :fail
32 +powershell -NoProfile "Stop-NetEventSession HnsPacketCapture; Remove-NetEventSession HnsPacketCapture" || goto :fail
33
34 exit /b 0
35
36 :fail
37 echo Failed to collect WSL logs
38 +powershell -NoProfile "Stop-NetEventSession HnsPacketCapture; Remove-NetEventSession HnsPacketCapture"
39 exit /b 1
40
41 :admin
diagnostics/wsl_networking.wprp
+20 -2
@@ -147,7 +147,16 @@
147 <EventProvider Id="WinNatSys" Name="aa7387cf-3639-496a-b3bf-dc1e79a6fc5a" />
148 <EventProvider Id="Microsoft-Windows-TCPIP" Name="2f07e2ee-15db-40f1-90ef-9d7ba282188a" NonPagedMemory="true" EventKey="true" Strict="true"/>
149 <EventProvider Id="WinNat" Name="66C07ECD-6667-43FC-93F8-05CF07F446EC" />
150 - <EventProvider Id="VmSwitch" Name="67DC0D66-3695-47C0-9642-33F76F7BD7AD" />
150 + <EventProvider Id="Microsoft-Windows-Overlay-HNSPlugin" Name="564368D6-577B-4af5-AD84-1C54464848E6" />
151 + <EventProvider Id="Microsoft.Windows.HyperV.Compute" Name="80CE50DE-D264-4581-950D-ABADEEE0D340" />
152 + <EventProvider Id="Microsoft.Windows.HostNetworkingService.PrivateCloudPlugin" Name="D0E4BC17-34C7-43fc-9A72-D89A59D6979A" />
153 + <EventProvider Id="Microsoft-Windows-Host-Network-Management" Name="93f693dc-9163-4dee-af64-d855218af242" />
154 + <EventProvider Id="Microsoft-Windows-SharedAccess_NAT" Name="A6F32731-9A38-4159-A220-3D9B7FC5FE5D" />
155 + <EventProvider Id="Microsoft.Windows.Hyper.V.VmsIf" Name="6C28C7E5-331B-4437-9C69-5352A2F7F296" />
156 + <EventProvider Id="VmSwitch_wpp" Name="1F387CBC-6818-4530-9DB6-5F1058CD7E86"/>
157 + <EventProvider Id="Microsoft-Windows-Hyper-V-VmSwitch" Name="67DC0D66-3695-47C0-9642-33F76F7BD7AD"/>
158 + <EventProvider Id="Microsoft.Windows.Hyper.V.NetSetupHelper" Name="94DEB9D1-0A52-449B-B368-41E4426B4F36"/>
159 + <EventProvider Id="Microsoft-Windows-Hyper-V-VfpExt" Name="9F2660EA-CFE7-428F-9850-AECA612619B0"/>
160 <Profile
161 Id="WSL.Verbose.File"
162 Name="WSL"
@@ -299,7 +308,16 @@
308 <EventProviderId Value="WinNat"/>
309 <EventProviderId Value="WinNatSys"/>
310 <EventProviderId Value="Microsoft-Windows-TCPIP"/>
302 - <EventProviderId Value="VmSwitch"/>
311 + <EventProviderId Value="Microsoft-Windows-Overlay-HNSPlugin"/>
312 + <EventProviderId Value="Microsoft.Windows.HyperV.Compute"/>
313 + <EventProviderId Value="Microsoft.Windows.HostNetworkingService.PrivateCloudPlugin"/>
314 + <EventProviderId Value="Microsoft-Windows-Host-Network-Management"/>
315 + <EventProviderId Value="Microsoft-Windows-SharedAccess_NAT"/>
316 + <EventProviderId Value="Microsoft.Windows.Hyper.V.VmsIf"/>
317 + <EventProviderId Value="VmSwitch_wpp"/>
318 + <EventProviderId Value="Microsoft-Windows-Hyper-V-VmSwitch"/>
319 + <EventProviderId Value="Microsoft.Windows.Hyper.V.NetSetupHelper"/>
320 + <EventProviderId Value="Microsoft-Windows-Hyper-V-VfpExt"/>
321 </EventProviders>
322 </EventCollectorId>
323 </Collectors>