I have a problem with my computer. It’s not a major problem, but one nonetheless. Quite often, when I’m playing a game on my desktop in fullscreen mode, something happens in Windows that tells my game to minimize two times. Never more, never less. I’ll be playing along, and BOOM, game minimizes. The worst part is I know – I KNOW – that when I click on it to start playing again, after a couple seconds it will happen a second time.
How can I figure out what’s going on? What can I do to stop this? It’s just one of those black box problems in Windows that can’t be solved, right?
Well, not anymore! (I know that sounds a little cheesy, but go with me on this.) Windows actually provides tools to debug problems like this. For several years this tool was xperf, but they’ve recently deprecated it for one call ETW, or Event Tracing for Windows. This is a utility that will record all activity in your operating system into a circular buffer for potential future review. When my game minimizes, I can jump over to the utility, record the data to disk, and start analyzing it with a separate tool called WPA, Windows Performance Analyzer.
ETW by default holds this information in memory, and will use 5% of your available memory for the circular buffer. The recording process takes a negligible amount of processor time, somewhere along the lines of 1-2%.
Bruce Dawson of Valve Software has spent several years on his blog posting about xperf and now ETW/WPA. He has also created several videos for the website WintellectNow. I’ve just watched them, and they’ve given me a solid understanding of how the tool works, and based on his suggestion I will be allowing this tool to run constantly in the background. Next time there’s a problem, I’ll be on top of it.
His videos require a membership to watch, but he has a promo code that gives a 14 day free trial period, with no credit card necessary. He also mentions a tutorial series on Windows debugging using WinDbg, the next series I’m going to be watching on the site. Go to Bruce’s website now to get the code, and you should probably just be following him overall, since his writing is smart and easy to read, some of the easiest reading this side of Joel Spolsky. For those of you who know me, that’s a pretty serious compliment.
I’ll update this post when I figure out my game problem – maybe I’ll even start playing something now in hopes of catching it. You know, for science.