Techniques for Zooming in Xperf Trace Viewers

Exploring an xperf trace involves a lot of zooming in. And zooming out. Zooming in to look at a problem area, then zooming out to see the context. Wash, rinse, repeat.

Zooming in is often done by selecting a region of interest and then using the context menu to zoom to that time range, but zooming out is less obvious. The two most convenient ways to zoom out are undocumented and undiscoverable.

This is a pet-peeve of mine. Discoverability of keyboard shortcuts lets users smoothly graduate from beginners to intermediates to power users. Keyboard mnemonics for dialogs and menus are unknown to many people because the underlined characters now default to being hidden. And vital options like ‘zoom out a bit’ show up nowhere in the xperfview or imageWPA menus, so many users don’t find them. Because they don’t show up in the menus, and because these programs have no built-in help, many users have to resort to clumsy methods such as zooming out all the way (Unzoom in the context menu) and then zooming back in, or using Select Time Range… and typing in a zoomed-out time range.

(See my article WPA–Xperf Trace Analysis Reimagined for WPA details)

Anyway, enough of the discoverability ranting. There are two handy ways to zoom in and out. Some people will have discovered these through experimentation, but for those of you who haven’t, here you go.

Ctrl+mouse-wheel zooms in and out. Not too shocking, but for some reason I kept trying without holding down the control key. This works in xperfview and WPA.

Ctrl together with ‘+‘ or ‘-’ zooms in or out. As usual you can use the ‘=’/’+’ key without holding down shift. This shortcut is particularly important when I’m looking at traces on my laptop because there I don’t have a mouse wheel. This shortcut does not work with xperfview – it only works with WPA. If I hadn’t already upgraded then this would have been enough to push me over the edge.

Note that these methods of zooming all zoom in/out around the mouse (as they should) so make sure your mouse is  placed on the area of interest.

The control plus/minus shortcuts for zooming in and out should be put in the menus (okay, a bit more discoverability ranting). Not because it makes sense to use them from the menus (although some users might) but because putting them in the menus, with keyboard accelerators listed, makes them discoverable.

Similarly, since xperfview and WPA lack any real documentation, ctrl+mouse-wheel should be mentioned somewhere in the menus. It can be listed on an always disabled menu for all I care, but I think there is value in listing it.

I also think that WPA needs even better zoom support – it needs multi-level undo. When exploring a trace it is common to want to zoom in to look at something and then want to go back out to where you were. You can simulate this by zooming one or all graphs in a new view, but multi-level undo would be an easy addition WPA that would often be better.

See my xperf series for more detail on how to use xperf, and my Investigative Reporting series for additional examples of how xperf can be used to investigate tricky problems.

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 xperf and tagged , , , . Bookmark the permalink.

One Response to Techniques for Zooming in Xperf Trace Viewers

  1. Pingback: Xperf Basics: Recording a Trace (the easy way) | 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