Patent ID: 7620801

Claim:
A method in a data processing system for randomly, without bias, selecting instructions for performance analysis in a microprocessor, the method comprising: associating ones of instruction tags to corresponding ones of instructions in an instruction buffer such that each instruction in the instruction buffer has a corresponding instruction tag, wherein the ones of instruction tags comprise corresponding ones of addresses of the corresponding ones of instructions, wherein the instruction buffer comprises a circular queue, and wherein the circular queue comprises a queue in which the corresponding ones of addresses are unrelated to a code stream running on the microprocessor; responsive to reading a first instruction in the instruction buffer, comparing first values of first bits of a first instruction tag against second values of second bits, wherein the first instruction tag is associated with the first instruction, and wherein the second values are generated by a pseudo-random pattern generator; responsive to the first values matching at least higher orders of the second values, associating an associated mark bit with the first instruction, wherein the associated mark bit indicates that the first instruction is a marked instruction; and storing the marked instruction.