New Version of Xperf–Upgrade Now

The latest version of xperf/wpa/WPT (Windows Performance Toolkit) was released October 17, 2013 along with Windows 8.1. If you care about performance on Windows (or Xbox One – rumors tell me xperf is used there as well) then you need the latest version of this powerful tool.

This post is mostly obsolete since WPT 10 is now out. However the list of new features is still relevant. To get the latest version of WPT I recommend getting it with UIforETW.

This is just a quick post to explain why you should upgrade.

But first, why should Windows developers use xperf?

  • It’s a free profiler that is more powerful for most uses than anything else available on Windows
  • It includes a sampling profiler that records kernel and user CPU consumption at up to 8 kHz with very low overhead
  • It records all running processes simultaneously
  • It can record every context switch along with call stacks of the switched-in thread and the thread that triggered the context switch (the ready thread)
  • It can record all file I/O, disk I/O (file I/O that went to the disk), GPU activity, the active window, available memory, etc.
  • It can record custom user events such as frame boundaries that give context to the other data
  • It allows definitive diagnosis of virtually any performance problem, in your own software or in others

image

Xperf ships with the Windows Software Development Kit so you can find the latest version through a search for Windows SDK 8.1, or just go to http://msdn.microsoft.com/en-us/library/windows/desktop/bg162891.aspx. If Windows 8.1 is not the latest version of Windows when you read this then you should probably search for a newer version.

New features

imageThere’s an official page describing what’s new in the Windows Performance Toolkit, but my what’s New Features section is better. I provide both editorial comments and links to the documentation of the new features!

Windows Performance Analyze (WPA – the trace viewing UI) offers the following new features:

  • Support for multiple traces in a single session – the big ‘1’ when you open a trace is there in order to identify which trace you are looking at
  • Comparative Analysis Viewsyou can now compare any summary table to find out what changed between two traces. You will need to read the linked instructions to figure this one out
  • Regions of interest that allow you to highlight important time ranges in a trace – you can now auto-highlight and label important time ranges. This looks really valuable but I can’t get it to work in a sane way. If you figure it out let me know
  • A new command line-based exporting toolthis could be really important since it gives lots of opportunities for automated analysis
  • Support for Windows Store app analysis
  • Instrumentation support for events that are fired through the System.Diagnostics.Tracing.EventSource class in .NET 4.5

Other things that I’ve noticed include:

  • If you’ve recorded graphics data (DX provider) there will be a new Video section in WPA that lists GPU details such as GPU Usage – handy for finding whether a game is GPU bound or not
  • The WPA colors are brighter
  • Tooltips! I’ve been complaining for years that the excruciatingly subtle columns in the summary tables need documentation and tooltips. I’ve supplied the lost xperf documentation, and with WPA 8.1 Microsoft has supplied the tooltips.

Bugs and fixes

WPA is the trace viewer of choice for the xperf toolkit. Unfortunately the 8.0 and the 8.1 preview versions contained some annoying bugs that force me to use xperfview occasionally. These are now fixed. That’s a good thing since xperfview no longer ships with WPT. The bug fixes from the 8.0 version are:

  • Numeric custom data (generic events) columns are now sorted numerically instead of alphabetically
  • Custom data is now decoded reliably – previously WPA often had an off-by-one-byte error in the reading of data, causing corruption

I haven’t tested to see whether the bugs with putting control characters or multi-kB strings in custom event payloads are fixed, but those aren’t too hard to work around.

The only new bug I’ve encountered is that WPA crashes when loading one class of traces. I need to characterize that and figure out how to report the crashes (WPT is not one of the products accepting bug reports on connect.microsoft.com).

Getting started

I’ll probably write more about these new features later. Until then the following articles are a good resource to get you get started:

About brucedawson

I'm a programmer, working for Google, focusing on optimization and reliability. Nothing's more fun than making code run 10x faster. Unless it's eliminating large numbers of bugs. I also unicycle. And play (ice) hockey. And juggle.
This entry was posted in Performance, xperf and tagged , . Bookmark the permalink.

15 Responses to New Version of Xperf–Upgrade Now

  1. shanecreamer says:

    Two features I really like about WPR

    WPT 8.0 & 8.1 – If you create an ETL trace it will automatically create public symbols Visual Studio style, so we can get potentially better symbols resolution if an end user sends you both Symbols folder and the .ETL trace in a zip file. Bruce already knows this so I am just mentioning this for anyone reading the comments section.

    WPT 8.1 only – The ability to compress .ETL traces, but they put the feature on the command line version of Xperf instead of WPR.exe. It reduces the trace by about 10 times and is way faster than trying to just compress it with 7zip or WinRAR.

    Trace merge options:
    xperf -merge trace1.etl trace2.etl … merged.etl [options]
    -merge trace1.etl trace2.etl … merged.etl [options] Merge trace1.etl trace2.etl … into
    merged.etl, also adding image identification information required for safe symbol decoding.
    -compress Compress output trace file.
    -suppresspii Do not add personally identifiable (PII)
    information.
    -mergeonly Do not add machine-specific information.

    Example: xperf -merge DiskIOTrace.10-22-2013.10-50-15.etl RandomAsciiDemo.etl -compress
    Took a 2.5GB .ETL file and compressed it down to 250MB.. nice!

    • brucedawson says:

      Thanks for mentioning those features. Regarding the public symbols, is that a wprui feature? I’d noticed wprui creating NGENPDB folders, but that’s not much use to me because I rarely do .Net profiling — in fact I’d like to turn off that feature in order to save time and space. An option to package up public symbols could be handy, but I’d like to know more about how to control it since it will usually be unnecessary.

      The trace compression sounds great and I look forward to being able to use it. I think it’s main advantage is that, unlike using a .zip file, you don’t have to decompress the trace in order to open it in WPA. That said, the Achilles heel of trace compression is the OS requirements. My understanding is that you can only create compressed traces on Windows 8.0 and higher, and I’ve even heard rumors that the decompression requires Windows 8.0 or higher. Is this true? The vast majority of our customers (and developers) are still on Windows 7.

  2. Pingback: WPA–Xperf Trace Analysis Reimagined | Random ASCII

  3. Pingback: Exporting Arbitrary Data from xperf ETL files | Random ASCII

  4. Sarkie says:

    The speed at which it loads symbols seems to have increased on my machine, I might actually be able to analyze my Chrome trace. Thanks for the link!

  5. Alois Kraus says:

    The only drawback to WPT 8.1 is that the VirtualAlloc viewing is broken.
    See: http://geekswithblogs.net/akraus1/archive/2013/11/05/154556.aspx
    A fix is on the way and will hopefully soon be published.

    • brucedawson says:

      Thanks for that information. That could save me a lot of time the next time I need to do memory analysis. I’ll be sure to archive a copy of WPT 8.0.

      I hope you’re right about a fix coming.

  6. Pingback: The Lost Xperf Documentation–CPU Scheduling | Random ASCII

  7. Alois Kraus says:

    Yes the fix will be published with the next release of the SDK. QFE fixes are not accepted by MS for WPT regardless how high your service level is. I am just not certain what they mean with next. I hope not the Windows 8.2 SDK.

  8. Pingback: Bugs I Got Other Companies to Fix in 2013 | Random ASCII

  9. Looks like in 8.1 they’ve removed xperfview, which makes me sad because WPA doesn’t seem to support the method I liked to use most with Generic Events — setting the columns and Orange Bar one way (lots of grouping) to find a “hot point” (value too large or otherwise out of spec), and then using Maintain Selection and switching to a simple sort-by-time view to see what happened before that, which usually includes the cause. I might flick between these two views several times trying to track down particular issues.

    It does support defining multiple profile views and even has a Maintain Selection option — but it doesn’t scroll to the selection when you switch views, so its effectiveness is lost.

    • brucedawson says:

      I think you can do similar things with WPA. Zoom the selection in a new tab and toggle between customized views of the generic events data. Give it a try and I think you’ll be able to get it to work.

      Alternately, keep on using xperfview. Install 8.0 on another machine and xcopy the files to your machine. Then you have 8.0 and 8.1 side-by-side and you can mix-and-match. I do this.

      But, I very rarely use xperfview anymore. I hear the next release of WPA will get stacks displaying for virtual alloc and then I’ll have no need for it.

  10. Pingback: ETW Central | Random ASCII

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s