How to create custom wpr profile in windows 10 universal apps

2.2k Views Asked by At

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.

Please help.

1

There are 1 best solutions below

0
On BEST ANSWER

Microsoft provides a demo WPR Profile in "C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\SampleWPRControlProfiles.wprp"

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>

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

  1. Open your .wprp file in Visual Studio.

  2. In the main menu, choose XML, and then choose Schemas

  3. In the XML Schemas dialog that appears, choose Add

  4. Choose the WPRControlProfiles.xsd schema.

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

Now analyze the ETL file with WPA.exe or Perfview.