1

我需要在 Windows 10 中创建文件日志记录模式。为此,我需要在 Windows 10 通用应用程序中创建自定义配置文件,以便我可以将默认日志记录模式从内存更改为文件,并更改缓冲区设置。

请帮忙。

4

1 回答 1

1

C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\SampleWPRControlProfiles.wprp微软在“ ”中提供了一个演示 WPR 配置文件

它显示了如何配置日志到文件 ( 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中提取最新的 WPRControlProfiles.xsd并将其加载到 Visual Studio

  1. 在 Visual Studio 中打开 .wprp 文件。

  2. 在主菜单中,选择XML,然后选择Schemas...</p>

  3. 在出现的 XML Schemas 对话框中,选择Add...</p>

  4. 选择 WPRControlProfiles.xsd 架构。

稍后将 WPRP 文件与 WPR.exe 一起使用:

"C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\wpr.exe" -start MyProfile.wprp

运行您的应用程序并停止录制运行此:

"C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\wpr.exe" -stop Result.etl

现在使用 WPA.exe 或 Perfview 分析 ETL 文件。

于 2016-05-21T08:55:44.760 回答