A processor capable of executing an arbitrary application program on an operating system includes an event context register that stores therein an ID of an event to be measured in the arbitrary application program and a context register that records therein an ID of an event executed by the arbitrary application program upon the application program being executed on the operating system. The processor further includes a comparator that compares the ID of the event recorded in the context register and the ID of the event to be measured that is stored in the event context register and an event counter that counts the number of times the ID of the event recorded in the context register and the ID of the event to be measured are determined to coincide by the comparator.
展开▼