There are special service registers storing the reports about various events. Any program analyzing the status of the processor functioning may send a request to these registers if necessary.
Moreover, both, Intel and AMD, have programs like that. Intel’s software is called VTune, and AMD’s – Code Analyst. The major task of this software tool is to analyze the processor operation and give some recommendations to the code developers. This actually means that there are software emulators of the corresponding processors integrated into these programs.
Of course, VTune uses event counters to evaluate the efficiency of this or that code.
However, everything is not that simple here. That thing is that a lot of counters in VTune are undocumented. To be more exact, a small part of the counters is documented (besides it is really hard to call a counter documented if we only know its name). In reality all the documentation does exist in the corporation. But unfortunately, it is not available for the public. I doubt that Intel’s division working on VTune development didn’t know the purpose of these counters. But the truth is that most users have no idea what these counters actually do.
To tell the truth, we were very excited about this great number of counters that we discovered. It made us think whether we really understand correctly what’s going on inside Pentium 4 processor. The number of counters we found turned out somewhat too big for the events we knew about.
Maybe there is something else inside the processor that we didn’t see?
Let me answer this question now: yes, there is. And there are quite a lot of things, actually. The ongoing chapters of our article will be devoted to these particular things. And in the meanwhile, let’s return to our event counters.
As we have already said, we discovered a lot of undocumented counters. So we asked ourselves: what do they actually do?
So, we decided to check their behavior during the execution of a special code we developed. If you have vivid imagination, you can get an idea of the fun we had comparing the registers (if the result stored got increased by one point or not) and figuring out if this counter increase corresponds to what we know about the Pentium 4 architecture.
So, we managed to check the operation of documented counters: they measure understandable parameters and their functioning corresponds to what the whitepapers say.
However, another pretty big group of counters measured some unknown parameters. We managed to find out what that actually was a bit later, when we had discovered something new (see Chapter IX for details).