oprofile is a low overhead, open-source tool that hooks into Linux and can keep track of CPU event monitoring information. This is a fairly general statement and for this post I'll be using the Intel Penryn microarchitecture, which should have similar event counters to most recent Intel processors. You can get the canonical list of event counters from Intel's own documentation in Chapter 30, Perfo