Hardware Counter Data

See Also

Why collect hardware counter data?

Hardware counter data tells you about the frequency of selected processor events. It can be used to diagnose data flow and instruction delay problems, among other things.

How is hardware counter data collected by the Collector?

Hardware counters count events for each LWP. When the count for a particular LWP reaches an overflow value, a signal is delivered, the counter is reset, and the count resumes. When the Collector intercepts the signal it records the counter ID, the overflow value, a timestamp and the call stack, as well as the LWP ID, the thread ID and the processor ID. This process is called hardware counter overflow profiling. The overflow is attributed by the Performance Analyzer to the next instruction to be executed at the time the overflow is recorded. The derived count data is therefore statistical in nature.

What kinds of hardware events can be counted?

The kinds of events you can count depend on the specific processor and the operating system. Here is a typical list of some of the common events:

To display the list of available counters, choose one of the following methods:

Some commonly-used counters have aliased names that appear at the beginning of the list. For information on the format of the list, see Hardware Counter Lists. The UltraSPARCTM III hardware counters that have aliased names are listed in the table below, with their metric names and the registers on which they count.

Counter Name Alias Metric Register
Cycle_cnt cycles CPU Cycles 0 or 1
Instr_cnt insts Instructions Executed 0 or 1
IC_miss icm I$ Misses 1
DC_rd_miss dcrm D$ Read Misses 1
DC_wr_miss dcwm D$ Write Misses 1
DC_rd dcr D$ Read Refs 0
DC_wr dcw D$ Write Refs 0
EC_ref ecref E$ Refs 0
ITLB_miss itlbm ITLB Misses 1
DTLB_miss dtlbm DTLB Misses 1
EC_misses ecm E$ Misses 1
EC_rd_miss ecrm E$ Read Misses 0
EC_ic_miss ecim E$ Instr. Misses 1
Dispatch0_IC_miss icstall I$ Stall Cycles 0
Re_DC_miss dcstall D$ and E$ Stall Cycles 1
Re_EC_miss ecstall E$ Stall Cycles 1
Rstall_storeQ sqstall StoreQ Stall Cycles 0
FA_pipe_completion fpadd FP Adds 0
FM_pipe_completion fpmul FP Muls 1

What hardware counter metrics can I see in the Performance Analyzer?

Hardware counter overflow profiling data is converted into count metrics by summing the overflow values. For counters that count in cycles, the count metrics are converted into times using the average clock frequency of all the CPUs in the machine on which the program was run. The metric names are the counter names as used by cputrack(1). The aliased counter names have corresponding metric names. For UltraSPARC III hardware, the metric names are listed in the table above.

What are the limitations on hardware counter data collection?

For more information, see the Performance Analyer manual

See also
Collecting Performance Data
Collecting Performance Data on a Running Process
Programs That Use Hardware Counters

Can't find what you are looking for? Submit your comments at http://www.sun.com/hwdocs/feedback.
Legal Notices