Patent ID: 8181185

Claim:
An apparatus comprising: an execution unit to execute instructions of a plurality of threads; a storage to store state information and an identity for the plurality of threads; and a performance monitor coupled to the storage, the performance monitor including a configuration register to store event information for events to be monitored, a plurality of counters to count occurrence of events associated with the event information, and a filter register having a plurality of fields each field associated with one of the plurality of threads to indicate whether monitoring of events of the thread is enabled, wherein the plurality of counters include a first set of counters each to count events that occur in the plurality of threads during execution on the execution unit and a second set of counters each to count events that occur in a single one of the plurality of threads enabled for filtered monitoring, the filter register controlled by a first user level instruction to enable the filtered monitoring and a second user level instruction to disable the filtered monitoring, the field of the filter register associated with a thread to be stored in a destination storage with state information of the thread on a context switch from the thread, and the stored field is to be loaded into a different field of the filter register when the thread is loaded into a different hardware thread on a second context switch.