Patent ID: 7945901

Claim:
A system for facilitating software profiling procedures in a target device, comprising: a target CPU that executes software instructions from target routines of said target device; a program counter that is periodically updated with a current program counter value corresponding to one of said software instructions that is being executed by said target CPU; a shadow register that is directly accessible for performing said software profiling procedures, said shadow register containing a profiling program counter value that corresponds to said current program counter value; and a profiler that directly accesses said shadow register, said profiler including a profiling software program that runs on a host computer or said target CPU; and wherein a programmable profiling sample period is defined to specify sampling intervals for said profiler to access said shadow register; said profiler generates a sampling query to said target CPU for determining said current program counter value at the end of each of said sampling intervals; a control unit of said target CPU copies said current program counter value in response to said sampling query, said control unit then writing said current program counter value into said shadow register as said profiling program counter value; said profiler identifies a specific one of said target routines corresponding to said profiling program counter value by referencing a map file; and said software profiling procedures are performed upon a release version of said target routines that does not include a special profiling-support routine.