SlideShare a Scribd company logo
Intro to ETW tracing and
OSVR
Ryan A. Pavlik, Ph.D.
Senior Software Engineer, Sensics, Inc.
August-September 2015
“Event Tracing for Windows (ETW) is an efficient kernel-level tracing
facility that lets you log kernel or application-defined events to a log file.
You can consume the events in real time or from a log file and use them
to debug an application or to determine where performance issues are
occurring in the application.
ETW lets you enable or disable event tracing dynamically, allowing you to
perform detailed tracing in a production environment without requiring
computer or application restarts.”
Source: MSDN, “Windows Events: About Event Tracing”
What is Event Tracing for Windows?
aka ETW, xperf, Windows Performance Toolkit (WPT), Windows Performance Analyzer (WPA), …
What about the rest of those? xperf is the command-line tool to control ETW, so often used synonymously with ETW. Windows Performance Toolkit is the name given by MS to the installable package that provides user-level tools for ETW. WPT
includes Windows Performance Analyzer, the GUI we’ll use to display and explore tracing data, as well as other tools like WPRUI (Win. Perf. Recorder UI, a limited GUI for controlling tracing that we won’t use).
What is Event Tracing for Windows
really?
● Effectively, a collection of tools and technologies to get very in-depth performance
details across an entire running environment at minimal performance impact.
● With UIforETW, an open-source tool that (among other things) automates the
complex command lines to start, stop, and manage traces, it can be a great
investigative tool (including high rate sampling and wait-analysis profiling) on its
own: I’ve used it like this for some time now.
● OSVR on Windows now augments ETW traces made by UIforETW with custom
events on both the client and server side.
● The following screenshots barely scratch the surface of what you can do with ETW,
especially now with OSVR emitting custom events.
Settings I used for this trace: I chose to turn on fast sampling, but not GPU tracing,
and traced to an in-memory circular buffer that gets saved on a keystroke. This can
let you leave tracing running continuously, then after you notice unusual behavior or
something you’d like to investigate, you can hit the shortcut key and save a trace of
the last x seconds, for after-the-fact performance investigation.
● Double-clicked on trace name in UIforETW. Screenshot shows only the top pane shown
here: these are the “custom events” emitted by UIforETW and OSVR. Other panes show
lots more data.
● UIforETW “marks” processor speed, temp, etc. at regular intervals (is thermal throttling
affecting your performance?) and also marks keyboard and mouse movements
(customizable - was a key press or mouse click a trigger for an unusual behavior?).
Trace opened in WPA
Focusing in: App startup
Select an area of interest, and “Zoom all” - usually
in new view. Hold shift to snap selection ends to
marks. Here, we’re looking at app startup.
Here, by expanding the providers in the top pane and zooming in, we find that the
first two calls to OSVR “get state” for the head are 0.1s apart, so presumably OSVR
is starting up early in the app launch process while the app is still loading. If you
wanted to know what your app (or others!) was doing during that time, you could
“zoom” again and use the other panes of WPA to investigate your code.
These two sections correspond and show the first two “GetState” calls by the app.
The app process is here:
note the triangle is
“expanded”
We created a
new selection
snapped at either
end to those two
event markers.
The selection
tooltip shows the
duration.
We can zoom out in a number of ways: Ctrl-scroll, context (right-click) menu, etc.
Right clicking on events lets you filter them. Here, we’ve zoomed out, filtered to just
the “ClientUpdate” events, and selected some “steady-state” running after startup
finishes, to zoom in again.
Here, we’ve zoomed in to a “steady state” portion of the trace recording, and also
filtered the custom events so that only the “Begin” marks of a ClientKit update are
shown. Some basic analysis reveals the app was making just over 150 calls to
ClientUpdate per second on average: slower than the tracker update rate, but higher
than the framerate.
All the ClientUpdate
events in the period are
in this table along with
their timestamp relative
to the beginning of the
trace. (These tables can
be exported to
spreadsheets if you
want to do more in-
depth number crunching
than the WPA GUI
provides)
All tables shown in WPA
show only information
corresponding to the
current “zoomed
region”. Here, you can
see in the summary row
that 265 ClientUpdates
took place in this view (it
looks like fewer since
many were very close
together)
This area shows
information about the
current zoomed
region. The duration
we’re viewing is
1.72777 seconds.
Comparing multiple events, within and between processes
Removing the filter: in that same
1.7s time period, the server
update ran 892 times, and the
application got the state of
/me/head 53 times. (The fact that
53 < 265 (update calls) means the
app doesn’t care about head pose
as often as it is updating OSVR.
Since this is a Unity app making
those accesses from managed (.
NET) code, that means it was
probably a good choice to use the
state interface here, since the
alternative would have been >265
native-to-managed callbacks.)
Same time region, different panes of ETW functionality - correlated with events
The highlighted
graph line here is
the app CPU usage,
which shows a fairly
regular spike to
approximately one
logical CPU on this
machine.
Links and References
UIforETW release v1.13 and WPT 10 were used for these screenshots. More info:
● Intro blog post (Bruce Dawson): https://randomascii.wordpress.com/2015/04/14/uiforetw-
windows-performance-made-easier/
● GitHub repo (click Releases for downloads): https://github.com/google/UIforETW
● Be sure to “Copy startup profiles” and “Copy symbol DLLs” from the Settings dialog when you first
launch UIforETW or after updating it.
● UIforETW was initially written by Bruce Dawson, formerly of Microsoft and Valve, currently at Google
working on Chrome performance (hence why there are some extra features in UIforETW that are
Chrome-specific - it originated as an internal tool)
○ He’s posted a lot on his blog (see above) about ETW/xperf in the past few years (filter posts by
the “xperf” tag), much of it is still applicable and very useful reading (although UIforETW takes
away much of the pain described in the earliest posts)
○ His role in the creation of UIforETW is also why “Randomascii” (one of his handles - see blog
URL) appeared in these screenshots: he provides useful custom views for WPA in the “startup
profiles” mentioned above.
● GPUView (linked from UIforETW when GPU tracing enabled) intro page: http://graphics.stanford.
edu/~mdfisher/GPUView.html
Note
To avoid increasing dependencies and potential performance impacts, tracing is disabled by default
in the provided binaries as of September 2015. However, corresponding tracing-enabled DLLs are
now shipped in the “tracing” folder in binary snapshots.
You can directly replace the DLLs with ones built with tracing turned on to add tracing as needed.
See the readme in that folder for details.
If you build from source, I’d suggest turning on tracing (as I do) - never know when you might need
it.
For additional information:
● OSVR developer portal
○ http://osvr.github.io
● Sensics – Founding contributor to OSVR,
experts working in VR/AR for over a decade
○ http://www.sensics.com

More Related Content

PDF
ECS architecture with Unity by example - Unite Europe 2016
PPT
Jsunit
PDF
Creating Asha Games: Game Pausing, Orientation, Sensors and Gestures
PDF
VR API Evolution, Generic Interfaces, and Factoring
PDF
OSVR Plugin Design
PDF
OSVR Operating System Platforms and Portability
PPTX
Introduction to OSVR - Apr 2015
PDF
OSVR Client Application Design
ECS architecture with Unity by example - Unite Europe 2016
Jsunit
Creating Asha Games: Game Pausing, Orientation, Sensors and Gestures
VR API Evolution, Generic Interfaces, and Factoring
OSVR Plugin Design
OSVR Operating System Platforms and Portability
Introduction to OSVR - Apr 2015
OSVR Client Application Design

Similar to Intro to ETW Tracing and OSVR (11)

PPTX
Debugging IE Performance Issues with xperf, ETW and NavigationTiming
PPT
Capturing comprehensive storage workload traces in windows
PPTX
Optimizing windows 8 for virtual desktops - teched 2013 Jeff Stokes
PPTX
Demystifying Visual Studio 2012 Performance Tools
PDF
GOoDA tutorial
PPTX
Understanding the characteristics of android wear os
PDF
ETW - Monitor Anything, Anytime, Anywhere (Velocity NYC 2017)
PDF
ITCamp 2013 - Martin Kulov - Demystifying Visual Studio 2012 Performance Tools
PPTX
Achieving maximum performance in microsoft vdi environments - Jeff Stokes
PDF
Linux Performance Analysis: New Tools and Old Secrets
PDF
Linux Perf Tools
Debugging IE Performance Issues with xperf, ETW and NavigationTiming
Capturing comprehensive storage workload traces in windows
Optimizing windows 8 for virtual desktops - teched 2013 Jeff Stokes
Demystifying Visual Studio 2012 Performance Tools
GOoDA tutorial
Understanding the characteristics of android wear os
ETW - Monitor Anything, Anytime, Anywhere (Velocity NYC 2017)
ITCamp 2013 - Martin Kulov - Demystifying Visual Studio 2012 Performance Tools
Achieving maximum performance in microsoft vdi environments - Jeff Stokes
Linux Performance Analysis: New Tools and Old Secrets
Linux Perf Tools
Ad

Recently uploaded (20)

PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Machine learning based COVID-19 study performance prediction
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
DOCX
The AUB Centre for AI in Media Proposal.docx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Cloud computing and distributed systems.
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
NewMind AI Weekly Chronicles - August'25 Week I
Machine learning based COVID-19 study performance prediction
sap open course for s4hana steps from ECC to s4
Unlocking AI with Model Context Protocol (MCP)
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
The AUB Centre for AI in Media Proposal.docx
“AI and Expert System Decision Support & Business Intelligence Systems”
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Understanding_Digital_Forensics_Presentation.pptx
Chapter 3 Spatial Domain Image Processing.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Cloud computing and distributed systems.
Building Integrated photovoltaic BIPV_UPV.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Ad

Intro to ETW Tracing and OSVR

  • 1. Intro to ETW tracing and OSVR Ryan A. Pavlik, Ph.D. Senior Software Engineer, Sensics, Inc. August-September 2015
  • 2. “Event Tracing for Windows (ETW) is an efficient kernel-level tracing facility that lets you log kernel or application-defined events to a log file. You can consume the events in real time or from a log file and use them to debug an application or to determine where performance issues are occurring in the application. ETW lets you enable or disable event tracing dynamically, allowing you to perform detailed tracing in a production environment without requiring computer or application restarts.” Source: MSDN, “Windows Events: About Event Tracing” What is Event Tracing for Windows? aka ETW, xperf, Windows Performance Toolkit (WPT), Windows Performance Analyzer (WPA), … What about the rest of those? xperf is the command-line tool to control ETW, so often used synonymously with ETW. Windows Performance Toolkit is the name given by MS to the installable package that provides user-level tools for ETW. WPT includes Windows Performance Analyzer, the GUI we’ll use to display and explore tracing data, as well as other tools like WPRUI (Win. Perf. Recorder UI, a limited GUI for controlling tracing that we won’t use).
  • 3. What is Event Tracing for Windows really? ● Effectively, a collection of tools and technologies to get very in-depth performance details across an entire running environment at minimal performance impact. ● With UIforETW, an open-source tool that (among other things) automates the complex command lines to start, stop, and manage traces, it can be a great investigative tool (including high rate sampling and wait-analysis profiling) on its own: I’ve used it like this for some time now. ● OSVR on Windows now augments ETW traces made by UIforETW with custom events on both the client and server side. ● The following screenshots barely scratch the surface of what you can do with ETW, especially now with OSVR emitting custom events.
  • 4. Settings I used for this trace: I chose to turn on fast sampling, but not GPU tracing, and traced to an in-memory circular buffer that gets saved on a keystroke. This can let you leave tracing running continuously, then after you notice unusual behavior or something you’d like to investigate, you can hit the shortcut key and save a trace of the last x seconds, for after-the-fact performance investigation.
  • 5. ● Double-clicked on trace name in UIforETW. Screenshot shows only the top pane shown here: these are the “custom events” emitted by UIforETW and OSVR. Other panes show lots more data. ● UIforETW “marks” processor speed, temp, etc. at regular intervals (is thermal throttling affecting your performance?) and also marks keyboard and mouse movements (customizable - was a key press or mouse click a trigger for an unusual behavior?). Trace opened in WPA
  • 6. Focusing in: App startup Select an area of interest, and “Zoom all” - usually in new view. Hold shift to snap selection ends to marks. Here, we’re looking at app startup.
  • 7. Here, by expanding the providers in the top pane and zooming in, we find that the first two calls to OSVR “get state” for the head are 0.1s apart, so presumably OSVR is starting up early in the app launch process while the app is still loading. If you wanted to know what your app (or others!) was doing during that time, you could “zoom” again and use the other panes of WPA to investigate your code. These two sections correspond and show the first two “GetState” calls by the app. The app process is here: note the triangle is “expanded” We created a new selection snapped at either end to those two event markers. The selection tooltip shows the duration.
  • 8. We can zoom out in a number of ways: Ctrl-scroll, context (right-click) menu, etc. Right clicking on events lets you filter them. Here, we’ve zoomed out, filtered to just the “ClientUpdate” events, and selected some “steady-state” running after startup finishes, to zoom in again.
  • 9. Here, we’ve zoomed in to a “steady state” portion of the trace recording, and also filtered the custom events so that only the “Begin” marks of a ClientKit update are shown. Some basic analysis reveals the app was making just over 150 calls to ClientUpdate per second on average: slower than the tracker update rate, but higher than the framerate. All the ClientUpdate events in the period are in this table along with their timestamp relative to the beginning of the trace. (These tables can be exported to spreadsheets if you want to do more in- depth number crunching than the WPA GUI provides) All tables shown in WPA show only information corresponding to the current “zoomed region”. Here, you can see in the summary row that 265 ClientUpdates took place in this view (it looks like fewer since many were very close together) This area shows information about the current zoomed region. The duration we’re viewing is 1.72777 seconds.
  • 10. Comparing multiple events, within and between processes Removing the filter: in that same 1.7s time period, the server update ran 892 times, and the application got the state of /me/head 53 times. (The fact that 53 < 265 (update calls) means the app doesn’t care about head pose as often as it is updating OSVR. Since this is a Unity app making those accesses from managed (. NET) code, that means it was probably a good choice to use the state interface here, since the alternative would have been >265 native-to-managed callbacks.)
  • 11. Same time region, different panes of ETW functionality - correlated with events The highlighted graph line here is the app CPU usage, which shows a fairly regular spike to approximately one logical CPU on this machine.
  • 12. Links and References UIforETW release v1.13 and WPT 10 were used for these screenshots. More info: ● Intro blog post (Bruce Dawson): https://randomascii.wordpress.com/2015/04/14/uiforetw- windows-performance-made-easier/ ● GitHub repo (click Releases for downloads): https://github.com/google/UIforETW ● Be sure to “Copy startup profiles” and “Copy symbol DLLs” from the Settings dialog when you first launch UIforETW or after updating it. ● UIforETW was initially written by Bruce Dawson, formerly of Microsoft and Valve, currently at Google working on Chrome performance (hence why there are some extra features in UIforETW that are Chrome-specific - it originated as an internal tool) ○ He’s posted a lot on his blog (see above) about ETW/xperf in the past few years (filter posts by the “xperf” tag), much of it is still applicable and very useful reading (although UIforETW takes away much of the pain described in the earliest posts) ○ His role in the creation of UIforETW is also why “Randomascii” (one of his handles - see blog URL) appeared in these screenshots: he provides useful custom views for WPA in the “startup profiles” mentioned above. ● GPUView (linked from UIforETW when GPU tracing enabled) intro page: http://graphics.stanford. edu/~mdfisher/GPUView.html
  • 13. Note To avoid increasing dependencies and potential performance impacts, tracing is disabled by default in the provided binaries as of September 2015. However, corresponding tracing-enabled DLLs are now shipped in the “tracing” folder in binary snapshots. You can directly replace the DLLs with ones built with tracing turned on to add tracing as needed. See the readme in that folder for details. If you build from source, I’d suggest turning on tracing (as I do) - never know when you might need it.
  • 14. For additional information: ● OSVR developer portal ○ http://osvr.github.io ● Sensics – Founding contributor to OSVR, experts working in VR/AR for over a decade ○ http://www.sensics.com