Wednesday, June 22, 2011

Useful Utilities series

I'm sure we all have our favorite little utility programs we've downloaded from the web over the years. There's nothing quite like finding that cool new program and adding it to your arsenal of tools at your disposal. Most of the tools I have I original discovered either from a friend or a read about it on a blog or forum. So I thought I would share these utilities in a series of posts I'll call "useful utilities."

Shame on you if you haven't heard of today's useful utilities - SysInternals, now officially a part of Microsoft. SysInternals has long created some of the best, most powerful utilities for Windows (probably why Microsoft bought them out). By my count they have at least 69 different utilities, which you should peruse to see what goodies you can find. I'll focus on some of the utils I find more useful.

Process Explorer - Process Explorer is Task Manager on steriods. It does everything Task Manager does plus so much more. It will show you the processes in a hierarchical format so you can see the which processes spawned other processes. It will show you the command line options passed to a process during launch. It will show you handles and DLLs open for each process. If you drill down on a process it will even show you all the threads for that process, what percentage of CPU time each thread is using, and even a call stack for each thread. This last feature has come in handy when tracking down a looping thread in WinINSTALL. It was very easy to find the offending thread and even the function where it was getting caught.

Process Monitor - Process Monitor is the culmination of years of work and at least 3 of SysInternals most powerful and useful tools (File Monitor, Registry Monitor, and the original Process Monitor). Process Monitor shows you in real-time all file, registry, process/thread, and network accesses. Process Monitor has very powerful filtering, so if you only want to see failed file access calls made by Notepad you can easily do that. Have you ever had a program fail and report "file not found" but it doesn't tell you what file? Use Process Monitor and you'll quickly and easily see what file is missing.

Autoruns - Autoruns is a simple utility that shows you everything that runs on your system when you boot up. You might be surprised to see hundreds of items running at startup. Cleaning this up is probably the best way to improve boot times and overall system performance. Just make sure you know what you're deleting - most of the entries are for Windows itself and shouldn't be deleted.

Debug View - Even if you're familiar with SysInternals there's a chance you've never heard of Debug View. It's by no means one of their most popular utilities. But I find it to be very helpful debugging problems. Windows has what is called the debug output stream, any program can write whatever they want to it, but it's only visible if you use a special program like Debug View. Programmatically you write to it using the OutputDebugString() API. Debug View (and debug messages) can be very helpful in tracking down problems in your code, especially in release-mode binaries. I hate bugs that only occur in release-mode, even worse are problems that you cannot reproduce with a debugger attached to your release-mode process. Sometimes having a debugger attached to your process affects the timing and prevents multithreaded bugs from occurring. Debug View and debug messages are how I debug those problems.

There you have it, some of my more favorite tools from SysInternals. But they make so many great tools that I would encourage you to discover (or rediscover) for yourself.

No comments:

Post a Comment