# US 6,725,363 B1 · Method for filtering instructions to get more precise event counts

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 6,725,363 B1
- Document ID: US6725363B1
- Status: Granted
- Kind: B1
- Application number: 09/629,317
- Filed: 2000-07-31
- Granted: 2004-04-20
- Earliest claimed: 2000-07-31
- Assignees: Sun Microsystems, Inc.
- Inventors: Peter Damron
- Web page: https://patentgrep.com/patent/US6725363B1

## CPC

- G06F 11/3612: {by runtime analysis (performance monitoring G06F11/3466)}
- G06F 11/3466: {Performance evaluation by tracing or monitoring}
- G06F 2201/86: Event-based monitoring
- G06F 2201/88: Monitoring involving counting
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

This invention provides for filtering instructions to obtain more precise event counts with a plurality of instructions having a counter enable bit, executing the instructions thereby causing a plurality of events, filtering the instructions, activating the counter enable bit if the instructions fall within the filter, which then determines whether an event counter coupled to the event is incremented.

## Claims

### Claim 1

A method for obtaining precise event counts in a computer system, said method comprising:
executing an instruction, said execution creating one or more associated events;
filtering said instruction based on a filter range, said filter range providing a range of instructions indicating events to be counted;
activating a counter enable bit in said instruction if said instruction is within said filter range;
deactivating said counter enable bit in said instruction if said instruction is not within said filter range; and
incrementing an associated event counter corresponding to each of said one or more associated events if said counter enable bit on said instruction is activated.

### Claim 2 (depends on 1)

The method of claim 1 further comprising:
trapping said associated event counter when it reaches a maximum bit count.

### Claim 3 (depends on 1)

The method of claim 1 further comprising:
setting said filter range substantially between a high number and a low number.

### Claim 4 (depends on 1)

The method of claim 1 further comprising:
setting said filter range on a mask and compare operation.

### Claim 5 (depends on 1)

The method of claim 1 wherein said filtering further comprises:
filtering said instruction based on an effective virtual address value.

### Claim 6 (depends on 1)

The method of claim 1 wherein said filtering further comprises:
filtering said instruction based on an effective physical address value.

### Claim 7 (depends on 1)

The method of claim 1 wherein said filtering further comprises:
filtering said instruction based on an instruction operation code.

### Claim 8 (depends on 1)

The method of claim 1 wherein said filtering further comprises:
filtering said instruction based on a cache miss value.

### Claim 9 (depends on 1)

The method of claim 1 wherein said filtering further comprises:
filtering said instruction based on a program counter value.

### Claim 10

A program storage device readable by a machine, tangibly embodying a program of instructions executable by the machine to perform a method for obtaining precise event counts in a computer system, said method comprising:
executing an instruction, said execution creating one or more associated events;
filtering said instruction based on a filter range, said filter range providing a range of instructions indicating events to be counted;
activating a counter enable bit in said instruction if said instruction is within said filter range;
deactivating said counter enable bit in said instruction if said instruction is not within said filter range; and
incrementing an associated event counter corresponding to each of said one or more associated events if said counter enable bit on said instruction is activated.

### Claim 11

An apparatus for obtaining precise event counts in a computer system, said apparatus comprising:
means for executing an instruction, said execution creating one or more associated events;
means for filtering said instruction based on a filter range, said filter range providing a range of instructions indicating events to be counted;
means for activating a counter enable bit in said instruction if said instruction is within said filter range;
means for deactivating said counter enable bit in said instruction if said instruction is not within said filter range; and
means for incrementing an associated event counter corresponding to each of said one or more associated events if said counter enable bit on said instruction is activated.

### Claim 12 (depends on 11)

The apparatus of claim 11 further comprising:
means for trapping said associated event counter when it reaches a maximum bit count.

### Claim 13 (depends on 11)

The apparatus of claim 11 further comprising:
means for setting said filter range substantially between a high number and a low number.

### Claim 14 (depends on 11)

The apparatus of claim 11 further comprising:
means for setting said filter range on a mask and compare operation.

### Claim 15 (depends on 11)

The apparatus of claim 11 wherein said means for filtering further comprises:
means for filtering said instruction based on an effective virtual address value.

### Claim 16 (depends on 11)

The apparatus of claim 11 wherein said means for filtering further comprises:
means for filtering said instruction based on an effective physical address value.

### Claim 17 (depends on 11)

The apparatus of claim 11 wherein said means for filtering further comprises:
means for filtering said instruction based on an instruction operation code.

### Claim 18 (depends on 11)

The apparatus of claim 11 wherein said means for filtering further comprises:
means for filtering said instruction based on a cache miss value.

### Claim 19 (depends on 11)

The apparatus of claim 11 wherein said means for filtering further comprises:
means for filtering said instruction based on a program counter value.
