Skip to content

Commit 80a15bf

Browse files
authored
Merge pull request #2980 from MicrosoftEdge/Diagnostics-Update
Diagnostics update
2 parents fb9508d + 990db10 commit 80a15bf

File tree

9 files changed

+266
-41
lines changed

9 files changed

+266
-41
lines changed

diagnostics.md

Lines changed: 0 additions & 41 deletions
This file was deleted.

diagnostics/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Gathering Diagnostics and Logs
2+
This folder contains directions for gathering various detailed diagnostics/logs when reporting WV2-related issues. There's generally no need to proactively get any of these diagnostics before opening an issue, but if one seems obvious feel free to get it before opening an issue. Otherwise, a WV2 developer might link you to one of these pages to help them investigate an issue:
3+
4+
- [Crash Dumps](crash.md): Crash dumps are used to better understand why a WV2 process is crashing and firing a [ProcessFailed](https://learn.microsoft.com/dotnet/api/microsoft.web.webview2.core.corewebview2.processfailed) event.
5+
- [ETW Trace](etw.md): Event Tracing for Windows (ETW) traces include detailed events on system state and the activities WV2 was doing before and when an issue occurs.
6+
- [Installer Logs](install.md): Installer logs include information about any errors that WV2's installer/updater hit when trying to install or update the WV2 runtime.
7+
- [GPU Info](gpu.md): GPU logs include details on the user's GPU and any potential graphics or rendering issues.
8+
- [Network Logs](network.md): Network logs include the network requests, responses, and details on any errors when loading files.

diagnostics/WebView2.wprp

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<WindowsPerformanceRecorder Version="1.0" Comments="" Company="Microsoft Corporation" Copyright="Microsoft Corporation">
3+
<Profiles>
4+
<SystemProvider Id="SystemProvider_Light">
5+
<Keywords>
6+
<!-- CPU -->
7+
<Keyword Value="ProcessThread"/>
8+
<Keyword Value="Loader"/>
9+
<Keyword Value="Power"/>
10+
<Keyword Value="CSwitch"/>
11+
<Keyword Value="ReadyThread"/>
12+
<Keyword Value="DPC"/>
13+
<Keyword Value="Interrupt"/>
14+
<Keyword Value="IdleStates"/>
15+
16+
<!-- Disk -->
17+
<Keyword Value="DiskIO"/>
18+
<Keyword Value="FileIO"/>
19+
<Keyword Value="HardFaults"/>
20+
21+
<!-- Memory -->
22+
<Keyword Value="MemoryInfo"/>
23+
<Keyword Value="MemoryInfoWS"/>
24+
</Keywords>
25+
<Stacks>
26+
<Stack Value="CSwitch"/>
27+
<Stack Value="ReadyThread"/>
28+
</Stacks>
29+
</SystemProvider>
30+
31+
<!-- Crash reporting events -->
32+
<EventProvider Id="EventProvider-Microsoft-Windows-WindowsErrorReporting" Name="cc79cf77-70d9-4082-9b52-23f3a3e92fe4"/>
33+
<EventProvider Id="EventProvider-Microsoft.Windows.FaultReportingTracingGuid" Name="1377561D-9312-452C-AD13-C4A1C9C906E0"/>
34+
35+
<!-- Process, thread, and image load events -->
36+
<EventProvider Id="EventProvider_Microsoft-Windows-Kernel-Process_16_0_68_1_0_0" Name="22fb2cd6-0e7b-422b-a0c7-2fad1fd0e716" NonPagedMemory="true" Stack="true" Level="0" EventKey="true">
37+
<Keywords>
38+
<Keyword Value="0x190" />
39+
</Keywords>
40+
</EventProvider>
41+
42+
<!-- WV2 events. Edge providers are included to support tracing when using pre-release runtimes. -->
43+
<EventProvider Id="Edge" Name="3A5F2396-5C8F-4F1F-9B67-6CCA6C990E61" Level="5">
44+
<Keywords>
45+
<Keyword Value="0x10000000202F"/>
46+
</Keywords>
47+
</EventProvider>
48+
<EventProvider Id="Edge_Canary" Name="C56B8664-45C5-4E65-B3C7-A8D6BD3F2E67" Level="5">
49+
<Keywords>
50+
<Keyword Value="0x3F0000054404"/>
51+
</Keywords>
52+
</EventProvider>
53+
<EventProvider Id="Edge_Dev" Name="D30B5C9F-B58F-4DC9-AFAF-134405D72107" Level="5">
54+
<Keywords>
55+
<Keyword Value="0x3F0000054404"/>
56+
</Keywords>
57+
</EventProvider>
58+
<EventProvider Id="Edge_Beta" Name="BD089BAA-4E52-4794-A887-9E96868570D2" Level="5">
59+
<Keywords>
60+
<Keyword Value="0x3F0000054404"/>
61+
</Keywords>
62+
</EventProvider>
63+
<EventProvider Id="Edge_WebView" Name="E16EC3D2-BB0F-4E8F-BDB8-DE0BEA82DC3D" Level="5">
64+
<Keywords>
65+
<Keyword Value="0x3F0000054404"/>
66+
</Keywords>
67+
</EventProvider>
68+
<EventProvider Id="Provider_V8js" Name="57277741-3638-4A4B-BDBA-0AC6E45DA56C" Level="5" Stack="true"></EventProvider>
69+
70+
<Profile Id="Edge.WebView2.General.Verbose.File" Name="Edge.WebView2.General" LoggingMode="File" DetailLevel="Verbose" Description="Edge.WebView2.General" Default="true">
71+
<Collectors Operation="Add">
72+
<SystemCollectorId Value="SystemCollector_WPRSystemCollectorInFile">
73+
<BufferSize Value="1024"/>
74+
<Buffers Value="100"/>
75+
<SystemProviderId Value="SystemProvider_Light" />
76+
</SystemCollectorId>
77+
<EventCollectorId Value="EventCollector_WPREventCollectorInFile">
78+
<BufferSize Value="1024" />
79+
<Buffers Value="3" PercentageOfTotalMemory="true"/>
80+
<EventProviders Operation="Add">
81+
<EventProviderId Value="EventProvider-Microsoft-Windows-WindowsErrorReporting"/>
82+
<EventProviderId Value="EventProvider-Microsoft.Windows.FaultReportingTracingGuid"/>
83+
<EventProviderId Value="EventProvider_Microsoft-Windows-Kernel-Process_16_0_68_1_0_0" />
84+
<EventProviderId Value="Edge" />
85+
<EventProviderId Value="Edge_Canary" />
86+
<EventProviderId Value="Edge_Dev" />
87+
<EventProviderId Value="Edge_Beta" />
88+
<EventProviderId Value="Edge_WebView" />
89+
<EventProviderId Value="Provider_V8js"></EventProviderId>
90+
</EventProviders>
91+
</EventCollectorId>
92+
</Collectors>
93+
</Profile>
94+
</Profiles>
95+
</WindowsPerformanceRecorder>

diagnostics/WebView2_CPU.wprp

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<WindowsPerformanceRecorder Version="1.0" Comments="" Company="Microsoft Corporation" Copyright="Microsoft Corporation">
3+
<Profiles>
4+
<SystemProvider Id="SystemProvider_Light">
5+
<Keywords>
6+
<!-- CPU -->
7+
<Keyword Value="ProcessThread"/>
8+
<Keyword Value="Loader"/>
9+
<Keyword Value="Power"/>
10+
<Keyword Value="CSwitch"/>
11+
<Keyword Value="ReadyThread"/>
12+
<Keyword Value="SampledProfile"/>
13+
<Keyword Value="DPC"/>
14+
<Keyword Value="Interrupt"/>
15+
<Keyword Value="IdleStates"/>
16+
17+
<!-- Disk -->
18+
<Keyword Value="DiskIO"/>
19+
<Keyword Value="FileIO"/>
20+
<Keyword Value="HardFaults"/>
21+
22+
<!-- Memory -->
23+
<Keyword Value="MemoryInfo"/>
24+
<Keyword Value="MemoryInfoWS"/>
25+
</Keywords>
26+
<Stacks>
27+
<Stack Value="CSwitch"/>
28+
<Stack Value="ReadyThread"/>
29+
<Stack Value="SampledProfile"/>
30+
</Stacks>
31+
</SystemProvider>
32+
33+
<!-- Crash reporting events -->
34+
<EventProvider Id="EventProvider-Microsoft-Windows-WindowsErrorReporting" Name="cc79cf77-70d9-4082-9b52-23f3a3e92fe4"/>
35+
<EventProvider Id="EventProvider-Microsoft.Windows.FaultReportingTracingGuid" Name="1377561D-9312-452C-AD13-C4A1C9C906E0"/>
36+
37+
<!-- Process, thread, and image load events -->
38+
<EventProvider Id="EventProvider_Microsoft-Windows-Kernel-Process_16_0_68_1_0_0" Name="22fb2cd6-0e7b-422b-a0c7-2fad1fd0e716" NonPagedMemory="true" Stack="true" Level="0" EventKey="true">
39+
<Keywords>
40+
<Keyword Value="0x190" />
41+
</Keywords>
42+
</EventProvider>
43+
44+
<!-- WV2 events. Edge providers are included to support tracing when using pre-release runtimes. -->
45+
<EventProvider Id="Edge" Name="3A5F2396-5C8F-4F1F-9B67-6CCA6C990E61" Level="5">
46+
<Keywords>
47+
<Keyword Value="0x10000000202F"/>
48+
</Keywords>
49+
</EventProvider>
50+
<EventProvider Id="Edge_Canary" Name="C56B8664-45C5-4E65-B3C7-A8D6BD3F2E67" Level="5">
51+
<Keywords>
52+
<Keyword Value="0x3F0000054404"/>
53+
</Keywords>
54+
</EventProvider>
55+
<EventProvider Id="Edge_Dev" Name="D30B5C9F-B58F-4DC9-AFAF-134405D72107" Level="5">
56+
<Keywords>
57+
<Keyword Value="0x3F0000054404"/>
58+
</Keywords>
59+
</EventProvider>
60+
<EventProvider Id="Edge_Beta" Name="BD089BAA-4E52-4794-A887-9E96868570D2" Level="5">
61+
<Keywords>
62+
<Keyword Value="0x3F0000054404"/>
63+
</Keywords>
64+
</EventProvider>
65+
<EventProvider Id="Edge_WebView" Name="E16EC3D2-BB0F-4E8F-BDB8-DE0BEA82DC3D" Level="5">
66+
<Keywords>
67+
<Keyword Value="0x3F0000054404"/>
68+
</Keywords>
69+
</EventProvider>
70+
<EventProvider Id="Provider_V8js" Name="57277741-3638-4A4B-BDBA-0AC6E45DA56C" Level="5" Stack="true"></EventProvider>
71+
72+
<Profile Id="Edge.WebView2.General.Verbose.File" Name="Edge.WebView2.General" LoggingMode="File" DetailLevel="Verbose" Description="Edge.WebView2.General" Default="true">
73+
<Collectors Operation="Add">
74+
<SystemCollectorId Value="SystemCollector_WPRSystemCollectorInFile">
75+
<BufferSize Value="1024"/>
76+
<Buffers Value="100"/>
77+
<SystemProviderId Value="SystemProvider_Light" />
78+
</SystemCollectorId>
79+
<EventCollectorId Value="EventCollector_WPREventCollectorInFile">
80+
<BufferSize Value="1024" />
81+
<Buffers Value="3" PercentageOfTotalMemory="true"/>
82+
<EventProviders Operation="Add">
83+
<EventProviderId Value="EventProvider-Microsoft-Windows-WindowsErrorReporting"/>
84+
<EventProviderId Value="EventProvider-Microsoft.Windows.FaultReportingTracingGuid"/>
85+
<EventProviderId Value="EventProvider_Microsoft-Windows-Kernel-Process_16_0_68_1_0_0" />
86+
<EventProviderId Value="Edge" />
87+
<EventProviderId Value="Edge_Canary" />
88+
<EventProviderId Value="Edge_Dev" />
89+
<EventProviderId Value="Edge_Beta" />
90+
<EventProviderId Value="Edge_WebView" />
91+
<EventProviderId Value="Provider_V8js"></EventProviderId>
92+
</EventProviders>
93+
</EventCollectorId>
94+
</Collectors>
95+
</Profile>
96+
</Profiles>
97+
</WindowsPerformanceRecorder>

diagnostics/crash.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Crash Dumps
2+
Crash dumps are used to better understand why a WV2 process is crashing and firing a [ProcessFailed](https://learn.microsoft.com/dotnet/api/microsoft.web.webview2.core.corewebview2.processfailed) event. If you're experiencing crashes, the information included in the [ProcessFailed event arguments](https://learn.microsoft.com/dotnet/api/microsoft.web.webview2.core.corewebview2processfailedeventargs) is a good starting point:
3+
- ExitCode
4+
- ProcessDescription
5+
- ProcessFailedKind
6+
- Reason
7+
8+
In addition to that, crash dumps are extremely helpful. WV2 crash dumps are located in a subfolder of the app's user data folder (UDF): `<UDF>\EBWebView\Crashpad\reports\`.
9+
By default the user data folder is created in the app's folder by default with a name like
10+
`<App Exe Name>.exe.WebView2`. If an app sets its user data folder location manually when creating a [WV2 Environment object](https://learn.microsoft.com/dotnet/api/microsoft.web.webview2.core.corewebview2environment), it may be in a different location.

diagnostics/etw.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Gathering an ETW Trace
2+
[Event Tracing for Windows (ETW)](https://learn.microsoft.com/en-us/windows-hardware/test/wpt/event-tracing-for-windows)traces include detailed events on system state and the activities WV2 was doing before and when an issue occurs.
3+
4+
This repo has a WV2 recording profile - [WebView2.wprp](WebView2.wprp) that includes the events that we find most useful.
5+
6+
ETW traces can get fairly large, so try to keep the amount of extra time spent when recording as small as possible.
7+
8+
1. Close Edge and any other apps using WV2 to make the trace more clear. Common apps using WV2 may include `widgets.exe`, `msteams.exe`, and Microsoft Office products.
9+
1. Download [WebView2.wprp](WebView2.wprp) from this repo.
10+
2. In an elevated command prompt run `wpr -start WebView2.wppr -filemode` (wpr.exe is included in Windows)
11+
3. Reproduce the issue.
12+
4. In an elevated command prompt run `wpr -stop trace.etl "trace"`.
13+
14+
ETW traces can contain sensitive information, if you're concerned with sharing one publicly in a GitHub issue, you can ask the WV2 developer you're working with for an email address to send to them privately.

diagnostics/gpu.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Graphics and GPU info
2+
GPU logs include details on the user's GPU and any potential graphics or rendering issues. If your WV2 has been created successfully but the content is not there, it might be due to a hosting and/or GPU driver issue.
3+
4+
There's a few pieces of information that can help us investigate these issues:
5+
## DirectX Details
6+
On the device that is hitting the issue:
7+
1. Run `dxdiag` from a console window
8+
1. Once the dialog displays and is done capturing info (there is a small progress bar) hit the "Save All Information" button to save the info to a `dxdiag.txt` file
9+
1. Share the `dxdiag.txt` file
10+
11+
## GPU Logs
12+
1. Navigate your WV2 to `edge://gpu`. This needs to be done programmatically inside the application, and can't be done via DevTools console or similar means.
13+
1. Wait for the page to load content under the "Log Messages" header towards the bottom.
14+
1. Hit "Copy Report to Clipboard" at the top
15+
1. Paste it into a text file, and share it.

diagnostics/install.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Installer / Setup Logs
2+
Installer logs include information about any errors that WV2's installer/updater hit when trying to install or update the WV2 runtime. There are a few different logs that we need to best look in to any issues.
3+
4+
## Installer History & File List
5+
There are some registry keys that contain important update information like when the last update occurred, recent error codes, and updater version information. The list of installed files that actually exist the device is also helpful in case there are errors or other processes removing them.
6+
7+
1. Open a command prompt.
8+
2. Run `reg export HKCU\SOFTWARE\Microsoft\EdgeUpdate\ClientState EdgeRegistryUser.txt`
9+
3. Run `reg export HKLM\SOFTWARE\Microsoft\EdgeUpdate\ClientState EdgeRegistryMachine.txt /reg:32`
10+
4. Run `dir "c:\Program Files (x86)\Microsoft\EdgeWebView" /s > EdgeFiles.txt`
11+
5. Run `dir "c:\Program Files (x86)\Microsoft\EdgeCore" /s >> EdgeFiles.txt`
12+
13+
You should now have three files: `EdgeRegistryUser.txt`, `EdgeRegistryMachine.txt`, and `EdgeFiles.txt`.
14+
15+
## Installer Logs
16+
There are four places where WV2's updater will write important details about any install or update issues. If you don't have all of these that's not a problem, include what exists:
17+
18+
1. `C:\ProgramData\Microsoft\EdgeUpdate\Log\MicrosoftEdgeUpdate.log`
19+
2. `%localappdata%\Temp\MicrosoftEdgeUpdate.log`
20+
3. `C:\Windows\Temp\msedge_installer.log`
21+
3. `%systemroot%\Temp\msedge_installer.log`
22+
23+
Once you have these files, share them with the WV2 developer who is helping you.

diagnostics/network.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Network Logs
2+
Network logs include the network requests, responses, and details on any errors when loading files. The easiest way to gather network logs for WV2 is to pass the `--log-net-log` command-line parameter to your WV2 app by setting the `WEBVIEW_ADDITIONAL_BROWSER_ARGUMENTS` environment variable to `--log-net-log=C:\MyPath\Log.json` (replacing the path with a location that your app can write to).
3+
4+
If that doesn't work in your scenario, there's more options for gathering network logs [in this post](https://textslashplain.com/2020/01/17/capture-network-logs-from-edge-and-chrome/). Additionally, [Chromium documentation](https://dev.chromium.org/for-testers/providing-network-details) has more details on some of the options.

0 commit comments

Comments
 (0)