Patent ID: 8769344

Claim:
A trace unit for generating items of trace data indicative of processing activities of at least one processor executing at least one stream of instructions, said at least one stream of instructions comprising a plurality of groups of instructions, said at least one processor executing at least some of said instructions speculatively, said trace unit comprising: trace circuitry for monitoring a behaviour of said at least one processor, said trace circuitry being controlled by current trace control data; a data store for storing at least some of said trace control data associated with a corresponding one of said groups of executed instructions; said trace circuit being configured to store said trace control data in said data store in response to detection of execution of said one of said groups of instructions; said trace circuitry being responsive to detecting said at least one processor cancelling at least one group of said speculatively executed instructions to retrieve at least sonic of said trace control data stored in said data store and to control said trace circuitry with said retrieved trace control data, wherein said trace control data comprises a previous-traced value, and said trace circuitry is responsive to detecting trace not being enabled when a final instruction in a preceding group is executed to set said previous-traced value to indicate said detecting trace not being enabled for a subsequent group of instructions, and said trace circuitry is responsive to detecting said processor cancelling a group of speculatively executed instructions and to said previous-traced value stored associated with said cancelled group is set to indicate said detecting trace not being enabled to output a trace element indicating said trace is turning on.