A method and system for counting non-speculative events in a speculative
processor is provided. The speculative processor contains a number of
counters within a performance monitor for counting occurrences of
specified events within a data processing system. An event to be
monitored is specified. The specified event is monitored during the
execution of instructions by the speculative processor. A count of
occurrences of the specified event for all instructions executed by the
speculative processor is generated, and a count of occurrences of the
specified event for instructions completely executed by the speculative
processor is generated. A difference between the count of occurrences of
the specified event for all instructions and the count of occurrences of
the specified event for all completed instructions may be generated as a
count of occurrences of the specified event for instructions
speculatively executed by the speculative processor.