1*b3cfaac3Sbentley.\" $OpenBSD: uperf.4,v 1.17 2015/02/15 22:26:45 bentley Exp $ 2e9cd2216Sjason.\" 3e9cd2216Sjason.\" Copyright (c) 2002 Jason L. Wright (jason@thought.net) 4e9cd2216Sjason.\" All rights reserved. 5e9cd2216Sjason.\" 6e9cd2216Sjason.\" Redistribution and use in source and binary forms, with or without 7e9cd2216Sjason.\" modification, are permitted provided that the following conditions 8e9cd2216Sjason.\" are met: 9e9cd2216Sjason.\" 1. Redistributions of source code must retain the above copyright 10e9cd2216Sjason.\" notice, this list of conditions and the following disclaimer. 11e9cd2216Sjason.\" 2. Redistributions in binary form must reproduce the above copyright 12e9cd2216Sjason.\" notice, this list of conditions and the following disclaimer in the 13e9cd2216Sjason.\" documentation and/or other materials provided with the distribution. 14e9cd2216Sjason.\" 15e9cd2216Sjason.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16e9cd2216Sjason.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17e9cd2216Sjason.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18e9cd2216Sjason.\" DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 19e9cd2216Sjason.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20e9cd2216Sjason.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 21e9cd2216Sjason.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22e9cd2216Sjason.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 23e9cd2216Sjason.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 24e9cd2216Sjason.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25e9cd2216Sjason.\" POSSIBILITY OF SUCH DAMAGE. 26e9cd2216Sjason.\" 27*b3cfaac3Sbentley.Dd $Mdocdate: February 15 2015 $ 28e9cd2216Sjason.Dt UPERF 4 sparc64 29e9cd2216Sjason.Os 30e9cd2216Sjason.Sh NAME 31e9cd2216Sjason.Nm uperf 32e9cd2216Sjason.Nd performance counters driver 33e9cd2216Sjason.Sh SYNOPSIS 349156c8a6Sjason.Cd "uperf* at ebus?" 35afb7f3acSmickey.Cd "uperf* at sbus?" 36e9cd2216Sjason.Sh DESCRIPTION 379156c8a6SjasonSome UltraSPARC host bridges provide performance counters on their host 389156c8a6Sjasonbridges. 399156c8a6SjasonThe counters are a part of the system controller chip (usc, dsc, or qsc). 4019902940SsobradoOn PCI machines the system controller shows up as a device on the EBus, but 4119902940Ssobradoon SBus machines the system controller exists in SBus space. 42e9cd2216SjasonThe 43e9cd2216Sjason.Nm 44e9cd2216Sjasondriver provides access to these counters via 45e9cd2216Sjason.Xr ioctl 2 . 46e9cd2216Sjason.Sh IOCTLS 47e9cd2216SjasonAll of the ioctl calls supported by the 48e9cd2216Sjason.Nm 49e9cd2216Sjasondriver take the following structure as an argument: 50e9cd2216Sjason.Bd -literal -offset indent 51e9cd2216Sjasonstruct uperf_io { 52e9cd2216Sjason int cnt_flags; 53e9cd2216Sjason int cnt_src0; 54e9cd2216Sjason int cnt_src1; 55e9cd2216Sjason u_int32_t cnt_val0; 56e9cd2216Sjason u_int32_t cnt_val1; 57e9cd2216Sjason}; 58e9cd2216Sjason.Ed 59e9cd2216Sjason.Pp 60e9cd2216SjasonThe 61e9cd2216Sjason.Fa cnt_flags 62e9cd2216Sjasonfield specifies which counters are being operated on and is a bit mask 63e9cd2216Sjasonof 64e9cd2216Sjason.Fa UPERF_CNT0 65e9cd2216Sjasonand/or 66e9cd2216Sjason.Fa UPERF_CNT1 . 67e9cd2216Sjason.Pp 68e9cd2216SjasonThe 69e9cd2216Sjason.Fa cnt_src0 70e9cd2216Sjasonand 71e9cd2216Sjason.Fa cnt_src1 72cbf6feefSjmcfields specify the source for the counter. 73e9cd2216SjasonNot all counters support monitoring all sources and specifying an invalid 74e9cd2216Sjasonsource for a counter to monitor will result in an error. 75e9cd2216SjasonThe sources are specified below: 76e324319bSjmc.Pp 77e324319bSjmc.Bl -tag -width "UPERFSRC_TLBMISS" -offset indent -compact 78e324319bSjmc.It Em UPERFSRC_SYSCK 79e324319bSjmcsystem clock ticks 80e324319bSjmc.It Em UPERFSRC_PRALL 81e324319bSjmcall p-requests 82e324319bSjmc.It Em UPERFSRC_PRP0 83e324319bSjmcp-requests from processor 0 84e324319bSjmc.It Em UPERFSRC_PRU2S 85e324319bSjmcp-requests from the U2S 86e324319bSjmc.It Em UPERFSRC_UPA128 87e324319bSjmccycles UPA 128 bit data is busy 88e324319bSjmc.It Em UPERFSRC_UPA64 89e324319bSjmccycles UPA 64 bit data is busy 90e324319bSjmc.It Em UPERFSRC_PIOS 91e324319bSjmccycles stalled during PIO 92e324319bSjmc.It Em UPERFSRC_MEMRI 93e324319bSjmcmemory requests issued 94e324319bSjmc.It Em UPERFSRC_MCBUSY 95e324319bSjmccycles memory controller is busy 96e324319bSjmc.It Em UPERFSRC_PXSH 97e324319bSjmcstall cycles due to pending transaction scoreboard hit 98e324319bSjmc.It Em UPERFSRC_P0CWMR 99e324319bSjmccoherent write miss requests, processor 0 100e324319bSjmc.It Em UPERFSRC_P1CWMR 101e324319bSjmccoherent write miss requests, processor 1 102e324319bSjmc.It Em UPERFSRC_CIT 103e324319bSjmccoherent intervention transactions 104e324319bSjmc.It Em UPERFSRC_U2SDAT 105e324319bSjmcdata transactions on U2S 106e324319bSjmc.It Em UPERFSRC_CRXI 107e324319bSjmccoherent read transactions issued 108e324319bSjmc.It Em UPERFSRC_RDP0 109e324319bSjmcread requests, processor 0 110e324319bSjmc.It Em UPERFSRC_P0CRMR 111e324319bSjmccoherent read misses, processor 0 112e324319bSjmc.It Em UPERFSRC_P0PIO 113e324319bSjmcPIO accesses, processor 0 114e324319bSjmc.It Em UPERFSRC_MEMRC 115e324319bSjmcmemory requests completed 116e324319bSjmc.It Em UPERFSRC_P1RR 117e324319bSjmcread requests, processor 1 118e324319bSjmc.It Em UPERFSRC_CRMP1 119e324319bSjmccoherent read misses, processor 1 120e324319bSjmc.It Em UPERFSRC_PIOP1 121e324319bSjmcPIO accesses, processor 1 122e324319bSjmc.It Em UPERFSRC_CWXI 123e324319bSjmccoherent write transactions issued 124e324319bSjmc.It Em UPERFSRC_RP0 125e324319bSjmcread requests, processor 0 126e324319bSjmc.It Em UPERFSRC_SDVRA 127e324319bSjmcstreaming DVMA read transfers, PCI bus A 128e324319bSjmc.It Em UPERFSRC_SDVWA 129e324319bSjmcstreaming DVMA write transfers, PCI bus A 130e324319bSjmc.It Em UPERFSRC_CDVRA 131e324319bSjmcconsistent DVMA read transfers, PCI bus A 132e324319bSjmc.It Em UPERFSRC_CDVWA 133e324319bSjmcconsistent DVMA write transfers, PCI bus A 134e324319bSjmc.It Em UPERFSRC_SBMA 135e324319bSjmcstreaming buffer misses, PCI bus A 136e324319bSjmc.It Em UPERFSRC_DVA 137e324319bSjmcDVMA cycles, PCI bus A 138e324319bSjmc.It Em UPERFSRC_DVWA 139e324319bSjmcwords transferred via DVMA, PCI bus A 140e324319bSjmc.It Em UPERFSRC_PIOA 141e324319bSjmccycles consumed by PIO, bus A 142e324319bSjmc.It Em UPERFSRC_SDVRB 143e324319bSjmcstreaming DVMA read transfers, PCI bus B 144e324319bSjmc.It Em UPERFSRC_SDVWB 145e324319bSjmcstreaming DVMA write transfers, PCI bus B 146e324319bSjmc.It Em UPERFSRC_CDVRB 147e324319bSjmcconsistent DVMA read transfers, PCI bus B 148e324319bSjmc.It Em UPERFSRC_CDVWB 149e324319bSjmcconsistent DVMA write transfers, PCI bus B 150e324319bSjmc.It Em UPERFSRC_SBMB 151e324319bSjmcstreaming buffer misses, PCI bus B 152e324319bSjmc.It Em UPERFSRC_DVB 153e324319bSjmcDVMA cycles, PCI bus B 154e324319bSjmc.It Em UPERFSRC_DVWB 155e324319bSjmcwords transferred via DVMA, PCI bus B 156e324319bSjmc.It Em UPERFSRC_PIOB 157e324319bSjmccycles consumed by PIO, bus B 158e324319bSjmc.It Em UPERFSRC_TLBMISS 159e324319bSjmcTLB misses 160e324319bSjmc.It Em UPERFSRC_NINTRS 161e324319bSjmcinterrupts 162e324319bSjmc.It Em UPERFSRC_INACK 163e324319bSjmcinterrupt NACKS on UPA 164e324319bSjmc.It Em UPERFSRC_PIOR 165e324319bSjmcPIO read transfers 166e324319bSjmc.It Em UPERFSRC_PIOW 167e324319bSjmcPIO write transfers 168e324319bSjmc.It Em UPERFSRC_MERGE 169e324319bSjmcmerge buffer transactions 170e324319bSjmc.It Em UPERFSRC_TBLA 171e324319bSjmcDMA requests retried due to tablewalks, PCI bus A 172e324319bSjmc.It Em UPERFSRC_STCA 173e324319bSjmcDMA requests retries due to STC, PCI bus A 174e324319bSjmc.It Em UPERFSRC_TBLB 175e324319bSjmcDMA requests retries due to tablewalks, PCI bus B 176e324319bSjmc.It Em UPERFSRC_STCB 177e324319bSjmcDMA requests retries due to STC, PCI bus B 178e9cd2216Sjason.El 179e9cd2216Sjason.Pp 180e9cd2216SjasonThe 181e9cd2216Sjason.Fa cnt_val0 182e9cd2216Sjasonand 183e9cd2216Sjason.Fa cnt_val1 184e9cd2216Sjasoncontain the values fetched for the counters. 185954ddbd6SmpechSoftware using this interface should be prepared to handle the counters 186954ddbd6Smpechrolling over. 187e9cd2216Sjason.Pp 188e9cd2216SjasonThe 189e9cd2216Sjason.Nm 190e9cd2216Sjasondevice responds to the following 191e9cd2216Sjason.Xr ioctl 2 192e9cd2216Sjasoncalls, which are defined in 193*b3cfaac3Sbentley.In dev/sun/uperfio.h . 194e9cd2216Sjason.Bl -tag -width UPIO_GCNTSRC 195e9cd2216Sjason.It Dv UPIO_GCNTSRC 196e9cd2216Sjason.Pq Li "struct uperf_io" 197e9cd2216SjasonRetrieve the source the counters are monitoring. 198e9cd2216SjasonThe 199e9cd2216Sjason.Fa cnt_flags 200e9cd2216Sjasonis a bit mask for which of the counters is to be fetched. 201e9cd2216SjasonThe result is returned in 202e9cd2216Sjason.Fa cnt_src0 203e9cd2216Sjasonand/or 204e9cd2216Sjason.Fa cnt_src1 . 205e9cd2216Sjason.It Dv UPIO_SCNTSRC 206e9cd2216Sjason.Pq Li "struct uperf_io" 207e9cd2216SjasonSet the source the counters should monitor. 208e9cd2216SjasonThis call also clears the current value of the counters that are set. 209e9cd2216SjasonThe 210e9cd2216Sjason.Fa cnt_flags 211e9cd2216Sjasonis a bit mask for which of the counters is to be set. 212e9cd2216SjasonThe 213e9cd2216Sjason.Fa cnt_src0 214e9cd2216Sjasonand/or 215e9cd2216Sjason.Fa cnt_src1 216e9cd2216Sjasonfields specify the source to be set for the respective counter. 217e9cd2216Sjason.It Dv UPIO_CLRCNT 218e9cd2216Sjason.Pq Li "struct uperf_io" 219e9cd2216SjasonClear the counters specified in 220e9cd2216Sjason.Fa cnt_flags . 2210d4cd2f3Sjason.It Dv UPIO_GETCNT 222e9cd2216Sjason.Pq Li "struct uperf_io" 223e9cd2216SjasonRetrieve the value for the counters specified in 224e9cd2216Sjason.Fa cnt_flags . 225e9cd2216SjasonThe values are returned in 226e9cd2216Sjason.Fa cnt_val0 227e9cd2216Sjasonand/or 228e9cd2216Sjason.Fa cnt_val1 . 229e9cd2216Sjason.El 230e9cd2216Sjason.Sh SEE ALSO 23117ab3eb8Sjason.Xr ioctl 2 , 2329cf9dc59Smiod.Xr ebus 4 , 2339cf9dc59Smiod.Xr intro 4 , 23417ab3eb8Sjason.Xr sbus 4 235e9cd2216Sjason.Sh HISTORY 236e9cd2216SjasonThe 237e9cd2216Sjason.Nm 238e9cd2216Sjasondriver was first supported in 239e9cd2216Sjason.Ox 3.1 . 240908a2779Sjmc.Sh AUTHORS 241908a2779SjmcThe driver was written by 242e5cc2e7eSschwarze.An Jason Wright Aq Mt jason@thought.net . 243