Information processing apparatus, including occurrence number counter
counting events that occurred in each of a plurality of CPUs. Apparatus
performs functions of; storing accumulated occurrence number of events,
which occurred while the thread is being executed by each of the CPUs, in
a thread storage area of the thread associating accumulated occurrence
number with CPU; storing, in the thread storage area, a value of
occurrence number counter of the CPU, the value having been counted
before the thread is resumed by the CPU; and adding, to accumulated
occurrence number which has been stored in accumulated number storing
unit while corresponding to the CPU, a difference value obtained by
subtracting a counter value, which has been stored in the start-time
number storing unit of the thread, from a counter value of the occurrence
number counter of the CPU, in a case where the CPU terminates an
execution of the thread.