1. A data processing system for qualifying events when an interrupt occurs, comprising: an interrupt unit including an interrupt unit control register for indicating an interrupt type selected to be monitored; the interrupt unit, responsive to an interrupt occurring during code execution, configured to determine whether the interrupt is of the interrupt type selected to be monitored as indicated by the interrupt unit control register; a performance monitoring unit including a counter control register for indicating a set of interrupt states selected to be monitored; and one or more hardware counters located within the performance monitoring unit; wherein the one or more hardware counters count events that occur during processing of the interrupt responsive to the interrupt unit determining that the interrupt is of the interrupt type selected to be monitored as indicated by the interrupt unit control register, wherein the one or more hardware counters count events that occur during the set of interrupt states selected to be monitored by the counter control registers.