Patent ID: 7383428

Claim:
A method for implementing atomic data tracing in a processor system including an auxiliary processor unit coupled to a central processor unit (CPU), using the auxiliary processor unit (APU) to perform the steps of: identifying a trace instruction; said trace instruction including a primary op code and indicating General Purpose Registers (GPRs) containing information to identify a first GPR containing data to be written into a current trace entry of a single trace buffer and to identify a set of trace engine registers defining a trace engine to use for said trace instruction; said trace engine including said single trace buffer; said data to be written being saved automatically in at least one GPR including said first GPR during normal context switch processing; said trace buffer and said set of trace engine registers defining said trace engine being accessible by the APU; signaling the CPU with a pipeline stall signal for stalling a CPU instruction stream pipeline; checking for an enabled trace engine for said trace instruction, writing trace data into said single trace buffer responsive to an identified enabled trace engine for said trace instruction utilizing said set of trace engine registers defining said trace engine including writing trace data into said single trace buffer from multiple execution contexts; and said trace engine including a set of device control registers (DCRs) accessible by the APU and used to determine where to write the data into said trace buffer; said set of device control registers (DCRs) including a trace buffer pointer register storing a base address of said trace buffer and an offset indicating a current trace buffer entry, and a base address mask register storing a mask indicating which bits in said trace buffer pointer register hold said base address and which hold said offset; said base address mask register used to determine a wrap point of said trace buffer; and signaling the CPU with an op done signal for allowing the CPU to continue with instruction stream pipeline processing.