1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
|
.\" $OpenBSD: uperf.4,v 1.15 2011/09/03 22:59:07 jmc Exp $
.\"
.\" Copyright (c) 2002 Jason L. Wright (jason@thought.net)
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
.\" DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd $Mdocdate: September 3 2011 $
.Dt UPERF 4 sparc64
.Os
.Sh NAME
.Nm uperf
.Nd performance counters driver
.Sh SYNOPSIS
.Cd "uperf* at ebus?"
.Cd "uperf* at sbus?"
.Sh 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
.Nm
driver provides access to these counters via
.Xr ioctl 2 .
.Sh IOCTLS
All of the ioctl calls supported by the
.Nm
driver take the following structure as an argument:
.Bd -literal -offset indent
struct uperf_io {
int cnt_flags;
int cnt_src0;
int cnt_src1;
u_int32_t cnt_val0;
u_int32_t cnt_val1;
};
.Ed
.Pp
The
.Fa cnt_flags
field specifies which counters are being operated on and is a bit mask
of
.Fa UPERF_CNT0
and/or
.Fa UPERF_CNT1 .
.Pp
The
.Fa cnt_src0
and
.Fa 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:
.Pp
.Bl -tag -width "UPERFSRC_TLBMISS" -offset indent -compact
.It Em UPERFSRC_SYSCK
system clock ticks
.It Em UPERFSRC_PRALL
all p-requests
.It Em UPERFSRC_PRP0
p-requests from processor 0
.It Em UPERFSRC_PRU2S
p-requests from the U2S
.It Em UPERFSRC_UPA128
cycles UPA 128 bit data is busy
.It Em UPERFSRC_UPA64
cycles UPA 64 bit data is busy
.It Em UPERFSRC_PIOS
cycles stalled during PIO
.It Em UPERFSRC_MEMRI
memory requests issued
.It Em UPERFSRC_MCBUSY
cycles memory controller is busy
.It Em UPERFSRC_PXSH
stall cycles due to pending transaction scoreboard hit
.It Em UPERFSRC_P0CWMR
coherent write miss requests, processor 0
.It Em UPERFSRC_P1CWMR
coherent write miss requests, processor 1
.It Em UPERFSRC_CIT
coherent intervention transactions
.It Em UPERFSRC_U2SDAT
data transactions on U2S
.It Em UPERFSRC_CRXI
coherent read transactions issued
.It Em UPERFSRC_RDP0
read requests, processor 0
.It Em UPERFSRC_P0CRMR
coherent read misses, processor 0
.It Em UPERFSRC_P0PIO
PIO accesses, processor 0
.It Em UPERFSRC_MEMRC
memory requests completed
.It Em UPERFSRC_P1RR
read requests, processor 1
.It Em UPERFSRC_CRMP1
coherent read misses, processor 1
.It Em UPERFSRC_PIOP1
PIO accesses, processor 1
.It Em UPERFSRC_CWXI
coherent write transactions issued
.It Em UPERFSRC_RP0
read requests, processor 0
.It Em UPERFSRC_SDVRA
streaming DVMA read transfers, PCI bus A
.It Em UPERFSRC_SDVWA
streaming DVMA write transfers, PCI bus A
.It Em UPERFSRC_CDVRA
consistent DVMA read transfers, PCI bus A
.It Em UPERFSRC_CDVWA
consistent DVMA write transfers, PCI bus A
.It Em UPERFSRC_SBMA
streaming buffer misses, PCI bus A
.It Em UPERFSRC_DVA
DVMA cycles, PCI bus A
.It Em UPERFSRC_DVWA
words transferred via DVMA, PCI bus A
.It Em UPERFSRC_PIOA
cycles consumed by PIO, bus A
.It Em UPERFSRC_SDVRB
streaming DVMA read transfers, PCI bus B
.It Em UPERFSRC_SDVWB
streaming DVMA write transfers, PCI bus B
.It Em UPERFSRC_CDVRB
consistent DVMA read transfers, PCI bus B
.It Em UPERFSRC_CDVWB
consistent DVMA write transfers, PCI bus B
.It Em UPERFSRC_SBMB
streaming buffer misses, PCI bus B
.It Em UPERFSRC_DVB
DVMA cycles, PCI bus B
.It Em UPERFSRC_DVWB
words transferred via DVMA, PCI bus B
.It Em UPERFSRC_PIOB
cycles consumed by PIO, bus B
.It Em UPERFSRC_TLBMISS
TLB misses
.It Em UPERFSRC_NINTRS
interrupts
.It Em UPERFSRC_INACK
interrupt NACKS on UPA
.It Em UPERFSRC_PIOR
PIO read transfers
.It Em UPERFSRC_PIOW
PIO write transfers
.It Em UPERFSRC_MERGE
merge buffer transactions
.It Em UPERFSRC_TBLA
DMA requests retried due to tablewalks, PCI bus A
.It Em UPERFSRC_STCA
DMA requests retries due to STC, PCI bus A
.It Em UPERFSRC_TBLB
DMA requests retries due to tablewalks, PCI bus B
.It Em UPERFSRC_STCB
DMA requests retries due to STC, PCI bus B
.El
.Pp
The
.Fa cnt_val0
and
.Fa cnt_val1
contain the values fetched for the counters.
Software using this interface should be prepared to handle the counters
rolling over.
.Pp
The
.Nm
device responds to the following
.Xr ioctl 2
calls, which are defined in
.Aq Pa dev/sun/uperfio.h .
.Bl -tag -width UPIO_GCNTSRC
.It Dv UPIO_GCNTSRC
.Pq Li "struct uperf_io"
Retrieve the source the counters are monitoring.
The
.Fa cnt_flags
is a bit mask for which of the counters is to be fetched.
The result is returned in
.Fa cnt_src0
and/or
.Fa cnt_src1 .
.It Dv UPIO_SCNTSRC
.Pq Li "struct uperf_io"
Set the source the counters should monitor.
This call also clears the current value of the counters that are set.
The
.Fa cnt_flags
is a bit mask for which of the counters is to be set.
The
.Fa cnt_src0
and/or
.Fa cnt_src1
fields specify the source to be set for the respective counter.
.It Dv UPIO_CLRCNT
.Pq Li "struct uperf_io"
Clear the counters specified in
.Fa cnt_flags .
.It Dv UPIO_GETCNT
.Pq Li "struct uperf_io"
Retrieve the value for the counters specified in
.Fa cnt_flags .
The values are returned in
.Fa cnt_val0
and/or
.Fa cnt_val1 .
.El
.Sh SEE ALSO
.Xr ioctl 2 ,
.Xr ebus 4 ,
.Xr intro 4 ,
.Xr sbus 4
.Sh HISTORY
The
.Nm
driver was first supported in
.Ox 3.1 .
.Sh AUTHORS
The driver was written by
.An Jason Wright Aq jason@thought.net .
|