UPERF(4) | Device Drivers Manual (sparc64) | UPERF(4) |
uperf
—
performance counters driver
uperf* at ebus?
uperf* at sbus?
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).
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:
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) 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.The uperf
driver was first supported in
OpenBSD 3.1.
The driver was written by Jason Wright <jason@thought.net>.
February 15, 2015 | OpenBSD-6.9 |