问题描述
我需要在Windows 10中创建文件日志记录模式.为此,我需要在Windows 10通用应用程序中创建自定义配置文件,以便可以将默认日志记录模式从内存"更改为文件",还可以更改缓冲区设置.
I need to create a file logging mode in windows 10. In order to do this, I need to create a custom profile in windows 10 universal apps so that I may change default logging mode from Memory to File and also change buffer settings.
请帮助.
推荐答案
Microsoft在"C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\SampleWPRControlProfiles.wprp
"中提供了演示WPR配置文件
Microsoft provides a demo WPR Profile in "C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\SampleWPRControlProfiles.wprp
"
它显示了如何配置记录到文件(LoggingMode="File"
)
It shows how to configure to log to file (LoggingMode="File"
)
<Profile
Description="Sample profile: File I/O activity"
DetailLevel="Verbose"
Id="MyFileIO.Verbose.File"
LoggingMode="File"
Name="MyFileIO"
>
<ProblemCategories>
<ProblemCategory Value="First Level Triage"/>
</ProblemCategories>
<Collectors>
<SystemCollectorId Value="SystemCollector_FileIO">
<SystemProviderId Value="SystemProvider_FileIO"/>
</SystemCollectorId>
<EventCollectorId Value="EventCollector_KernelPower">
<EventProviders>
<EventProviderId Value="EventProvider_DotNetProvider"/>
<EventProviderId Value="EventProvider_Microsoft-Windows-Kernel-Power_AC-DC-State"/>
</EventProviders>
</EventCollectorId>
</Collectors>
</Profile>
要验证WPRP文件,请在Visual Studio中将其打开,从 windowsperformancerecordercontrol.dll 和在Visual Studio中加载
To validate the WPRP file, open it in Visual Studio, extract the latest WPRControlProfiles.xsd from the windowsperformancerecordercontrol.dll and load it in Visual Studio
-
在Visual Studio中打开您的.wprp文件.
Open your .wprp file in Visual Studio.
在主菜单中,选择XML
,然后选择Schemas
…
In the main menu, choose XML
, and then choose Schemas
…
在出现的"XML模式"对话框中,选择Add
…
In the XML Schemas dialog that appears, choose Add
…
选择WPRControlProfiles.xsd模式.
Choose the WPRControlProfiles.xsd schema.
以后将WPRP文件与WPR.exe一起使用:
Later use the WPRP file with WPR.exe:
"C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\wpr.exe" -start MyProfile.wprp
运行您的应用程序并停止录制,请运行以下命令:
Run your app and to stop recording run this:
"C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\wpr.exe" -stop Result.etl
现在使用WPA.exe或Perfview分析ETL文件.
Now analyze the ETL file with WPA.exe or Perfview.
这篇关于如何在Windows 10通用应用中创建自定义WPR配置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!