If any of you have tried to run PerfView a Surface or other WinRT device, you will find that it does not work. Basically any program that is NOT a windows store application needs to be signed with a special key or it simply will fail to run on a ‘locked’ device (most devices are locked). At some point PerfView might be signed in this way, but at present it is not.
This blog is about working around this problem when you want to do a performance investigation on a Windows RT device (e.g. Surface). Currently your options are
Getting WPR for Windows RT
Any easy way to get WPR is to simply download the Windows App Certification Kit. The download is small and takes 10-20 seconds. After installation the WPR.exe tool will live in at the path
"c:\Program Files\Windows Kits\8.0\Windows Performance ToolKit\wpr.exe"
Note that if you wish to do further investigations on other WinRT devices you don't actually need to download/reintall the Windows App Certification Kit. WPR.exe is XCOPY depoyable, so you could simply copy the directory to a USB drive / cloud drive, transfer to the target machine and run it from where you copied it
xcopy "c:\Program Files\Windows Kits\8.0\Windows Performance ToolKit" d:\WPR\
d:\WPR\Wpr.exe command line parameters discussed below...
Using WPR to collect ETW data
WPR is a command line tool for collecting ETW data. It was designed for 'flight recorder' style recording, where you keep a circular buffer going, and when interesting events happen, you take a snapshot. It has three basic commands
The first command starts the logging, and the 3rd command dumps what is in the memory log and stops logging. These commands need to be done from a administrator window, so
Please don't forget the WPR -cancel command! If you forget this command everything will seem to work, however WPR has left collection running. This will slow your machine down by 10% or so but perhaps more importantly, it will use up 100s of meg of memory in its circular buffer, making apps die more frequently to free us space.
Using ETW data to Collect PerfView-Style Data
The instructions use the 'GeneralProfile' which does not collect any .NET specific events (it does include the Thread Time events). This is fine if your code has no JIT compiled code in it. For Windows Store application that have been on the machine a while (so that the OS has had a chance to precompile (NGEN) your application, this data is OK. However you have just installed or updated the application, or if you want to understand more about the .NET GC (that is you want the 'GCStats' view), or if you want the 'with Tasks' view which stitches together async operations, you need more events.
To get this, download the DotNetRuntimeProfile.wprp file at the end of this blog entry and then change the collection start command to
This will tell WPR to collect most of the events that PerfView collects by default (along with the /ThreadTIme events that WPR would have normally collected anyway) The rest of the procedure (WPR -stop OUTPUTFILE.etl and WPR -cancel) is the same as before.
Uploading your ETW data
The output of the WPR commands will be the 'OUTPUTFILE.ETL' but it will also be a set of PDB files for precompiled (NGENed) .NET assemblies. These NGEN pdbs are needed to properly decode .NET Framework code as well as some application code. WPR places these PDBS in a directory called OUTPUTFILE.NGENPDBS
Thus to upload the data to a USB drive you might do
You can also ZIP them so that they are a single file for easier upload . Simply open windows explorer, select the OUTPUTFILE.ETL and OUTPUTFILE.NGENPDB files, right click and select SendTo -> Compressed (Zip) folder. When it is done it will allow you to rename it, name it OUTPUTFILE.ETLl (it will put the ZIP suffix on automatically). The resulting .etl.zip file can be copied to another machine and opened with PerfView directly (PerfView will automatically unpack things into the proper places).
Once you the data (either as two pieces or as a ZIP file) to an X86 machine, you can use PerfView to open the OUTPUTFILE.ETL or OUTPUTFILE.ETL.ZIP file (it knows to find the PDBS in the OUTPUTFILE.NGENPDBS directory in either case). You are also welcome to use the WPA tool that comes with the Windows Performance toolkit to look at the ETW data (but for that you do have to unzip the .ETL.ZIP file). From this point it is just like you collected the data with PerfView.