---
name: "uperf"
section: "4"
platform: "openbsd"
package: "man"
version: "8.0-current-20261101"
release: "OpenBSD 8.0-current (2026-11-01)"
platforms: ["openbsd"]
url: "https://new.carta.tech/uperf"
---

# uperf(4)

performance counters driver

## NAME

**uperf** – performance counters driver

## SYNOPSIS

**uperf\* at ebus?** **uperf\* at sbus?**

## DESCRIPTION

Some UltraSPARC host bridges provide performance counters on their host bridges. The counters are a part of the system controller chip (usc, dsc, or qsc). On PCI machines the system controller shows up as a device on the EBus, but on SBus machines the system controller exists in SBus space. The **uperf** driver provides access to these counters via [ioctl(2)](/ioctl/2.md).

## IOCTLS

All of the ioctl calls supported by the **uperf** driver take the following structure as an argument:

```
struct uperf_io {
	int cnt_flags;
	int cnt_src0;
	int cnt_src1;
	u_int32_t cnt_val0;
	u_int32_t cnt_val1;
};
```

The *cnt\_flags* field specifies which counters are being operated on and is a bit mask of *UPERF\_CNT0* and/or *UPERF\_CNT1*.

The *cnt\_src0* and *cnt\_src1* fields specify the source for the counter. Not all counters support monitoring all sources and specifying an invalid source for a counter to monitor will result in an error. The sources are specified below:

- *UPERFSRC\_SYSCK*

  system clock ticks

- *UPERFSRC\_PRALL*

  all p-requests

- *UPERFSRC\_PRP0*

  p-requests from processor 0

- *UPERFSRC\_PRU2S*

  p-requests from the U2S

- *UPERFSRC\_UPA128*

  cycles UPA 128 bit data is busy

- *UPERFSRC\_UPA64*

  cycles UPA 64 bit data is busy

- *UPERFSRC\_PIOS*

  cycles stalled during PIO

- *UPERFSRC\_MEMRI*

  memory requests issued

- *UPERFSRC\_MCBUSY*

  cycles memory controller is busy

- *UPERFSRC\_PXSH*

  stall cycles due to pending transaction scoreboard hit

- *UPERFSRC\_P0CWMR*

  coherent write miss requests, processor 0

- *UPERFSRC\_P1CWMR*

  coherent write miss requests, processor 1

- *UPERFSRC\_CIT*

  coherent intervention transactions

- *UPERFSRC\_U2SDAT*

  data transactions on U2S

- *UPERFSRC\_CRXI*

  coherent read transactions issued

- *UPERFSRC\_RDP0*

  read requests, processor 0

- *UPERFSRC\_P0CRMR*

  coherent read misses, processor 0

- *UPERFSRC\_P0PIO*

  PIO accesses, processor 0

- *UPERFSRC\_MEMRC*

  memory requests completed

- *UPERFSRC\_P1RR*

  read requests, processor 1

- *UPERFSRC\_CRMP1*

  coherent read misses, processor 1

- *UPERFSRC\_PIOP1*

  PIO accesses, processor 1

- *UPERFSRC\_CWXI*

  coherent write transactions issued

- *UPERFSRC\_RP0*

  read requests, processor 0

- *UPERFSRC\_SDVRA*

  streaming DVMA read transfers, PCI bus A

- *UPERFSRC\_SDVWA*

  streaming DVMA write transfers, PCI bus A

- *UPERFSRC\_CDVRA*

  consistent DVMA read transfers, PCI bus A

- *UPERFSRC\_CDVWA*

  consistent DVMA write transfers, PCI bus A

- *UPERFSRC\_SBMA*

  streaming buffer misses, PCI bus A

- *UPERFSRC\_DVA*

  DVMA cycles, PCI bus A

- *UPERFSRC\_DVWA*

  words transferred via DVMA, PCI bus A

- *UPERFSRC\_PIOA*

  cycles consumed by PIO, bus A

- *UPERFSRC\_SDVRB*

  streaming DVMA read transfers, PCI bus B

- *UPERFSRC\_SDVWB*

  streaming DVMA write transfers, PCI bus B

- *UPERFSRC\_CDVRB*

  consistent DVMA read transfers, PCI bus B

- *UPERFSRC\_CDVWB*

  consistent DVMA write transfers, PCI bus B

- *UPERFSRC\_SBMB*

  streaming buffer misses, PCI bus B

- *UPERFSRC\_DVB*

  DVMA cycles, PCI bus B

- *UPERFSRC\_DVWB*

  words transferred via DVMA, PCI bus B

- *UPERFSRC\_PIOB*

  cycles consumed by PIO, bus B

- *UPERFSRC\_TLBMISS*

  TLB misses

- *UPERFSRC\_NINTRS*

  interrupts

- *UPERFSRC\_INACK*

  interrupt NACKS on UPA

- *UPERFSRC\_PIOR*

  PIO read transfers

- *UPERFSRC\_PIOW*

  PIO write transfers

- *UPERFSRC\_MERGE*

  merge buffer transactions

- *UPERFSRC\_TBLA*

  DMA requests retried due to tablewalks, PCI bus A

- *UPERFSRC\_STCA*

  DMA requests retries due to STC, PCI bus A

- *UPERFSRC\_TBLB*

  DMA requests retries due to tablewalks, PCI bus B

- *UPERFSRC\_STCB*

  DMA requests retries due to STC, PCI bus B

The *cnt\_val0* and *cnt\_val1* contain the values fetched for the counters. Software using this interface should be prepared to handle the counters rolling over.

The **uperf** device responds to the following [ioctl(2)](/ioctl/2.md) calls, which are defined in ⟨dev/sun/uperfio.h⟩.

- UPIO\_GCNTSRC

  (struct uperf\_io) Retrieve the source the counters are monitoring. The *cnt\_flags* is a bit mask for which of the counters is to be fetched. The result is returned in *cnt\_src0* and/or *cnt\_src1*.

- UPIO\_SCNTSRC

  (struct uperf\_io) Set the source the counters should monitor. This call also clears the current value of the counters that are set. The *cnt\_flags* is a bit mask for which of the counters is to be set. The *cnt\_src0* and/or *cnt\_src1* fields specify the source to be set for the respective counter.

- UPIO\_CLRCNT

  (struct uperf\_io) Clear the counters specified in *cnt\_flags*.

- UPIO\_GETCNT

  (struct uperf\_io) Retrieve the value for the counters specified in *cnt\_flags*. The values are returned in *cnt\_val0* and/or *cnt\_val1*.

## SEE ALSO

[ioctl(2)](/ioctl/2.md), [ebus(4)](/ebus/4.md), [intro(4)](/intro/4.md), [sbus(4)](/sbus/4.md)

## HISTORY

The **uperf** driver was first supported in OpenBSD 3.1.

## AUTHORS

The driver was written by Jason Wright ⟨*jason@thought.net*⟩.
