Welcome to MSDN Blogs Sign in | Join | Help

ETW Event Tracing in WPF

Event Tracing for Windows (ETW) provides application developers the ability to start and stop event tracing sessions, instrument an application to provide trace events, and consume trace events.

In addition to Windows itself, WPF also emits an array of interesting events that can be used to track the execution of an application at the framework level.

Mike Cook wrote a great document that explain the various ETW events emitted by WPF.

Check out the this documentation here.

You are encouraged to use these events to measure and analyze your WPF application performance.

The WpfPerf tool for example, use these events extensively. In addition, the WPF team is also using ETW in its automated tests to analyze WPF performance and catch regressions.

Attached is also a sample that demonstrates how you can consume one of these events (UceNotifyPresent event) to measure frame-rate (aka FPS , Frame-per-Second) in a WPF application.

The sample animates a rectangle and outputs the FPS to a command window . It is writing to a command window and not to the main app window so that it will not affect the real FPS.
image 
You should expect to see frame-rate tied to the refresh rate of your monitor.
Special thanks to Mike Cook and  TJ Hsiang who helped put this sample together.

Published Friday, September 26, 2008 12:00 AM by jgoldb

Attachment(s): FPSMeasurementSample.zip

Comments

Friday, September 26, 2008 3:07 AM by ETW Event Tracing in WPF : EasyCoded

# ETW Event Tracing in WPF : EasyCoded

Friday, September 26, 2008 8:13 AM by No1 Microsoft Fan

# Updated WPFPerf Performance Profiling Tools for WPF

The WPFPerf tool comprises of a suite of performance profiling tools that allow you to analyze the run

Friday, September 26, 2008 11:41 AM by JuanC

# re: ETW Event Tracing in WPF

I uninstalled the old WPF Perf Suite and installed the new x64 bits on a Vista machine (.NET 3.5 SP1, VS 2008 SP1)

It now crashes when WpfPerf is starting.

Could not load file or assembly 'WpfPerf, Version=0.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A)

Is there a registry key/old file  that might be causing this?

Friday, October 10, 2008 8:14 PM by jgoldb

# re: ETW Event Tracing in WPF

Yes , there were some issues w/ x64 & w/ x86 on non-US PCs.

On 10/9/2008 we posted an update.

See: http://windowsclient.net/wpf/perf/wpf-perf-tool.aspx

Monday, October 27, 2008 3:48 PM by Public Sector Developer Weblog

# Introducing Newly Improved WPF Performance Profiling Tools

Thinking about profiling your WPF applications to find out where the performance bottlenecks are? Check

Monday, November 03, 2008 4:33 AM by Notes from a dark corner

# Another pile of new stuff..

I've been a bit busy of late and new and interesting stuff keeps piling into my inbox without enough

Anonymous comments are disabled
 
Page view tracker