Skip to content

Commit 6767a10

Browse files
authored
Merge pull request #14 from jsturtevant/debug-helpers
Adding some more stuff to windows-debug image
2 parents a64f56c + cb6c680 commit 6767a10

5 files changed

Lines changed: 162 additions & 1 deletion

File tree

images/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ WORKDIR /apps
66
ENV PATH="%CONTAINER_SANDBOX_MOUNT_POINT%\apps\vim;%CONTAINER_SANDBOX_MOUNT_POINT%\apps\sysinternals;C:\Windows\system32;C:\Windows"
77

88
COPY --from=installer /ProgramData/scoop/apps/vim/9.0 ./vim/
9+
COPY --from=installer /content/ContainerPlatform.wprp .
10+
COPY --from=installer /content/collect-hcs-traces.md .
11+
COPY --from=installer /debug/net ./network

images/Dockerfile.installer-cache

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
ARG OS=ltsc2022
22
FROM mcr.microsoft.com/windows/servercore:${OS} as installer
3+
4+
# Install VIM via https://scoop.sh/
35
RUN powershell /c "iex ""& {$(irm get.scoop.sh)} -RunAsAdmin"""
4-
RUN scoop install vim@9.0 --global
6+
RUN scoop install vim@9.0 --global
7+
8+
# Get ntwork debugging scripts
9+
COPY ./content /content/
10+
RUN powershell ./content/Get-NetworkDebuggingScripts.ps1 -dest /debug/net/
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
<?xml version="1.0"?>
2+
<WindowsPerformanceRecorder Version="1">
3+
<Profiles>
4+
5+
<EventCollector Id="Collector" Name="Collector">
6+
<BufferSize Value="256"/>
7+
<Buffers Value="1024"/>
8+
</EventCollector>
9+
10+
<EventProvider Id="wincni" Name="c822b598-f4cc-5a72-7933-ce2a816d033f"/>
11+
<EventProvider Id="Moby" Name="6996f090-c5de-5082-a81e-5841acc3a635"/>
12+
<EventProvider Id="Microsoft.Virtualization.GCSRelay" Name="0b54a277-36b7-5c08-e104-a68e85df8bc9"/>
13+
<EventProvider Id="Microsoft.Virtualization.NCProxy" Name="cf9f01fe-87b3-568d-ecef-9f54b7c5ff70">
14+
<CaptureStateOnSave>
15+
<Keyword Value="0x0"/>
16+
</CaptureStateOnSave>
17+
<CaptureStateOnDemand>
18+
<Keyword Value="0x0"/>
19+
</CaptureStateOnDemand>
20+
</EventProvider>
21+
<EventProvider Id="Microsoft.Virtualization.RunHCS" Name="0B52781F-B24D-5685-DDF6-69830ED40EC3">
22+
<CaptureStateOnSave>
23+
<Keyword Value="0x0"/>
24+
</CaptureStateOnSave>
25+
<CaptureStateOnDemand>
26+
<Keyword Value="0x0"/>
27+
</CaptureStateOnDemand>
28+
</EventProvider>
29+
<EventProvider Id="ContainerD" Name="2acb92c0-eb9b-571a-69cf-8f3410f383ad">
30+
<CaptureStateOnSave>
31+
<Keyword Value="0x0"/>
32+
</CaptureStateOnSave>
33+
<CaptureStateOnDemand>
34+
<Keyword Value="0x0"/>
35+
</CaptureStateOnDemand>
36+
</EventProvider>
37+
<EventProvider Id="Microsoft.Windows.HyperV.Compute" Name="80CE50DE-D264-4581-950D-ABADEEE0D340"/>
38+
<EventProvider Id="Microsoft-Windows-Hyper-V-Compute" Name="17103E3F-3C6E-4677-BB17-3B267EB5BE57"/>
39+
<EventProvider Id="Microsoft.Windows.HyperV.Worker" Name="06C601B3-6957-4F8C-A15F-74875B24429D"/>
40+
<EventProvider Id="Microsoft-Windows-Hyper-V-Worker" Name="51ddfa29-d5c8-4803-be4b-2ecb715570fe"/>
41+
<EventProvider Id="Microsoft-Windows-Hyper-V-ComputeLib" Name="AF7FD3A7-B248-460C-A9F5-FEC39EF8468C"/>
42+
<EventProvider Id="Microsoft.Windows.HyperV.GuestCrashServices" Name="9a02f67c-133d-58be-ecad-0d891d8b6fd1"/>
43+
<EventProvider Id="Microsoft-Windows-Hyper-V-CrashDump" Name="C7C9E4F7-C41D-5C68-F104-D72A920016C7"/>
44+
<EventProvider Id="Microsoft-Windows-Hyper-V-Chipset" Name="de9ba731-7f33-4f44-98c9-6cac856b9f83"/>
45+
<EventProvider Id="Microsoft-Windows-Host-Network-Service" Name="0C885E0D-6EB6-476C-A048-2457EED3A5C1"/>
46+
47+
<EventProvider Id="Microsoft-Windows-VHDMP" Name="E2816346-87F4-4F85-95C3-0C79409AA89D"/>
48+
<EventProvider Id="Microsoft.Windows.HyperV.Vhdmp" Name="6141E9F3-E0CF-51EE-244C-063CA47EEE12"/>
49+
<EventProvider Id="Microsoft.Windows.HyperV.VhdmpTrace" Name="DC284FB3-1EAB-4854-828A-B25417280280"/>
50+
<EventProvider Id="Microsoft.Windows.HyperV.Storvsp" Name="544D0787-9F6D-432E-8414-E035A8B0541D"/>
51+
<EventProvider Id="Microsoft.Windows.HyperV.Storage" Name="2174371B-D5F6-422B-BFC4-BB6F97DDAA84"/>
52+
<EventProvider Id="Microsoft.Windows.HyperV.StorageActivity" Name="C7AD62C6-5C99-5A1B-BBC4-0821AE5B765E"/>
53+
<EventProvider Id="Microsoft-Windows-VIRTDISK" Name="4D20DF22-E177-4514-A369-F1759FEEDEB3"/>
54+
<EventProvider Id="Microsoft-Windows-VStack-EmulatedStor" Name="86E15E01-EDF1-4AC7-89CF-B19563FD6894"/>
55+
<EventProvider Id="Microsoft-Windows-Hyper-V-StorageVSP" Name="10B3D268-9782-49A4-AACC-A93C5482CB6F"/>
56+
<EventProvider Id="Microsoft-Windows-VStack-SynthStor" Name="EDACD782-2564-4497-ADE6-7199377850F2"/>
57+
58+
<Profile
59+
Id="ContainerPlatform.Verbose.Memory"
60+
Name="ContainerPlatform"
61+
Description="Events related to the container platform on Windows"
62+
LoggingMode="Memory"
63+
DetailLevel="Verbose"
64+
>
65+
<Collectors>
66+
<EventCollectorId Value="Collector">
67+
<EventProviders>
68+
<EventProviderId Value="wincni"/>
69+
<EventProviderId Value="Moby"/>
70+
<EventProviderId Value="Microsoft.Virtualization.GCSRelay"/>
71+
<EventProviderId Value="Microsoft.Virtualization.RunHCS"/>
72+
<EventProviderId Value="Microsoft.Virtualization.NCProxy"/>
73+
<EventProviderId Value="ContainerD"/>
74+
<EventProviderId Value="Microsoft.Windows.HyperV.Compute"/>
75+
<EventProviderId Value="Microsoft-Windows-Hyper-V-Compute"/>
76+
<EventProviderId Value="Microsoft.Windows.HyperV.Worker"/>
77+
<EventProviderId Value="Microsoft-Windows-Hyper-V-Worker"/>
78+
<EventProviderId Value="Microsoft-Windows-Hyper-V-ComputeLib"/>
79+
<EventProviderId Value="Microsoft.Windows.HyperV.GuestCrashServices"/>
80+
<EventProviderId Value="Microsoft-Windows-Hyper-V-CrashDump"/>
81+
<EventProviderId Value="Microsoft-Windows-Hyper-V-Chipset"/>
82+
<EventProviderId Value="Microsoft-Windows-Host-Network-Service"/>
83+
84+
<EventProviderId Value="Microsoft-Windows-VHDMP"/>
85+
<EventProviderId Value="Microsoft.Windows.HyperV.Vhdmp"/>
86+
<EventProviderId Value="Microsoft.Windows.HyperV.VhdmpTrace"/>
87+
<EventProviderId Value="Microsoft.Windows.HyperV.Storvsp"/>
88+
<EventProviderId Value="Microsoft.Windows.HyperV.Storage"/>
89+
<EventProviderId Value="Microsoft.Windows.HyperV.StorageActivity"/>
90+
<EventProviderId Value="Microsoft-Windows-VIRTDISK"/>
91+
<EventProviderId Value="Microsoft-Windows-VStack-EmulatedStor"/>
92+
<EventProviderId Value="Microsoft-Windows-Hyper-V-StorageVSP"/>
93+
<EventProviderId Value="Microsoft-Windows-VStack-SynthStor"/>
94+
</EventProviders>
95+
</EventCollectorId>
96+
</Collectors>
97+
</Profile>
98+
99+
<Profile
100+
Id="ContainerPlatform.Verbose.File"
101+
Name="ContainerPlatform"
102+
Description="Events related to the container platform on Windows"
103+
LoggingMode="File"
104+
DetailLevel="Verbose"
105+
Base="ContainerPlatform.Verbose.Memory"
106+
/>
107+
108+
</Profiles>
109+
</WindowsPerformanceRecorder>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
param (
2+
[string] $dest = "."
3+
)
4+
5+
$ErrorActionPreference = "Stop"
6+
7+
if (-not(Test-Path -Path $dest)) {
8+
New-Item -Path $dest -ItemType Directory -Force
9+
}
10+
11+
$scripts = @(
12+
"https://raw.githubusercontent.com/microsoft/SDN/master/Kubernetes/windows/hns.psm1",
13+
"https://raw.githubusercontent.com/microsoft/SDN/master/Kubernetes/windows/hns.v2.psm1",
14+
"https://raw.githubusercontent.com/microsoft/SDN/master/Kubernetes/windows/debug/VFP.psm1",
15+
"https://raw.githubusercontent.com/microsoft/SDN/master/Kubernetes/windows/debug/collectlogs.ps1",
16+
"https://raw.githubusercontent.com/microsoft/SDN/master/Kubernetes/windows/debug/dumpVfpPolicies.ps1",
17+
"https://raw.githubusercontent.com/microsoft/SDN/master/Kubernetes/windows/debug/networkhealth.ps1",
18+
"https://raw.githubusercontent.com/microsoft/SDN/master/Kubernetes/windows/debug/portReservationTest.ps1",
19+
"https://raw.githubusercontent.com/microsoft/SDN/master/Kubernetes/windows/debug/starthnstrace.cmd",
20+
"https://raw.githubusercontent.com/microsoft/SDN/master/Kubernetes/windows/debug/starthnstrace.ps1",
21+
"https://raw.githubusercontent.com/microsoft/SDN/master/Kubernetes/windows/debug/startpacketcapture.cmd",
22+
"https://raw.githubusercontent.com/microsoft/SDN/master/Kubernetes/windows/debug/startpacketcapture.ps1",
23+
"https://raw.githubusercontent.com/microsoft/SDN/master/Kubernetes/windows/debug/stoppacketcapture.cmd"
24+
)
25+
26+
foreach ($script in $scripts) {
27+
$filename = Split-Path $script -leaf
28+
Write-Output "Downloading $filename"
29+
$destPath = Join-Path $dest $filename
30+
curl.exe -L $script -o $destPath -s
31+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Collecting HCS traces
2+
3+
Use Windows Performance Recorder and the included ContainerPlatform.wprp file to collect HCS traces.
4+
To do so run:
5+
6+
```cmd
7+
wpr.exe -start c:\hpc\debug\containerplatform.wprp
8+
<reproduce issue>
9+
wpr.exe -stop trace.etl
10+
```
11+
12+
Then use https://docs.microsoft.com/windows-hardware/test/wpt/windows-performance-analyzer to view the traces saved in trace.etl

0 commit comments

Comments
 (0)