Stephan the reason your math is not working out is because Pentium processors since the Pentium Pro can execute and retire multiple instructions per clock cycle (superscalar). The processors are also pipelined so there is overlap in instruction execution. We calculate cycles per instruction retired by dividing the number of clocktick samples by the number of instruction retired samples.
Stephan, the VTune analyzer is calculating the CPI correctly. The reason your calculation is not working is because you are using the number of samples of instructions retired and clocktick events to do your calculation. You should actually use the total number of events. Total events = samples * sample after value In your case the sample after values for clockticks and instructions retired are 346189 and 92150 respectively. So Total events for clockticks for the hightlighted region = 346189 * 1184 Total events for instructions retired for the hightlighted region = 92150 * 4154 Thus CPI = 1.071
If you want the VTune analyzer to show you the number of events and not samples in the source view then right click anywhere in the source view and select View Events As -> Sample Counts
Also, Stephan, Ratios are always computed based on event values i.e. samples * sample after value and not on samples. This is to because VTune lets you configure events so that they have different sample after values. When computing ratios, they need to be normalized to make any sense. So yes, you can choose to see samples collected for an event instead of event values but ratios will always be based on event values.