System Administration Commands busstat(1M)
NAME
busstat - report bus-related performance statistics
SYNOPSIS
busstat -e device-inst -h -l
busstat [-a] [-n]
[-w device-inst [,pic0=event,picn=event ]...
[-r device-inst]... [interval [count]
DESCRIPTION
busstat provides access to the bus-related performance
counters in the system. These performance counters allow for
the measurement of statistics like hardware clock cycles,
bus statistics including DMA and cache coherency transac-
tions on a multiprocessor system. Each bus device that sup-
ports these counters can be programmed to count a number of
events from a specified list. Each device supports one or
more Performance Instrumentation Counters (PIC) that are
capable of counting events independently of each other.
Separate events can be selected for each PIC on each
instance of these devices. busstat summarizes the counts
over the last interval seconds, repeating forever. If a
count is given, the statistics are repeated count times.
Only root users can program these counters. Non-root users
have the option of reading the counters that have been pro-
grammed by a root user.
The default value for the interval argument is 1 second, and
the default count is unlimited.
The devices that export these counters are highly platform-
dependent and the data may be difficult to interpret without
an in-depth understanding of the operation of the components
that are being measured and of the system they reside in.
OPTIONS
The following options are supported:
-a
Display absolute counter values. The default is delta
values.
SunOS 5.11 Last change: 1 Nov 1999 1
System Administration Commands busstat(1M)
-e device-inst
Display the list of events that the specified device
supports for each pic.
Specify device-inst as device (name) followed by an
optional instance number. If an instance number is
specified, the events for that instance are displayed.
If no instance number is specified, the events for the
first instance of the specified device are displayed.
-h
Print a usage message.
-l
List the devices in the system which support performance
counters.
-n
Do not display a title in the output. The default is to
display titles.
-r device-inst
Read and display all pic values for the specified device
Specify device-inst as device (name) followed by
instance number, if specifying an instance number of a
device whose counters are to be read and displayed. If
all instances of this device are to be read, use device
(name) without an instance number. All pic values will
be sampled when using the -r option.
-w device-inst [,pic0=event] [,picn=event]
Program (write) the specified devices to count the
specified events. Write access to the counters is res-
tricted to root users only. Non-root users can use -r
option.
Specify device-inst as device (name) followed by an
optional instance number. If specifying an instance
number of a device to program these events on. If all
instances of this device are to be programmed the same,
SunOS 5.11 Last change: 1 Nov 1999 2
System Administration Commands busstat(1M)
then use device without an instance number. Specify an
event to be counted for a specified pic by providing a
comma separated list of picn=event values.
The -e option displays all valid event names for each
device. Any devices that are programmed will be sampled
every interval seconds and repeated count times. It is
recommended that the interval specified is small enough
to ensure that counter wraparound will be detected. The
rate at which counters wraparound varies from device to
device. If a user is programming events using the -w
option and busstat detects that another user has changed
the events that are being counted, the tool will ter-
minate as the programmed devices are now being con-
trolled by another user. Only one user can be program-
ming a device instance at any one time. Extra devices
can be sampled using the -r option. Using multiple
instances of the -w option on the same command line,
with the same device-inst specifying a different list of
events for the pics will give the effect of multiplexing
for that device. busstat will switch between the list of
events for that device every interval seconds. Event can
be a string representing the event name, or even a
number representing the bit pattern to be programmed
into the Performance Control Register (PCR). This
assumes explicit knowledge of the meaning of the con-
trol register bits for a device. The number can be
specified in hexadecimal, decimal, or octal, using the
usual conventions of strtol(3C).
EXIT STATUS
The following exit values are returned:
0 Successful completion.
1 An error occurred.
2 Another user is writing to the same devices.
EXAMPLES
SPARC Only
Example 1 Programming and monitoring the Address Controller
counters
In this example, ac0 refers to the Address Controller
instance 0. The counters are programmed to count Memory Bank
stalls on an Ultra Enterprise system at 10 second intervals
SunOS 5.11 Last change: 1 Nov 1999 3
System Administration Commands busstat(1M)
with the values displayed in absolute form instead of del-
tas.
# busstat -a -w ac0,pic0=membank0stall,pic1=membank1stall 10
time dev event0 pic0 event1 pic1
10 ac0 membank0stall 1234 membank1stall 5678
20 ac0 membank0stall 5678 membank1stall 12345
30 ac0 membank0stall 12345 membank1stall 56789
...
For a complete list of the supported events for a device,
use the -e option.
Example 2 Programming and monitoring the counters on all
instances of the Address Controller
In this example, ac refers to all ac instances. This example
programs all instances of the Address Controller counters to
countclock cycles and membank0rds at 2 second intervals,
100 times, displaying the values as deltas.
# busstat -w ac,pic0=clockcycles,pic1=membank0rds 2 100
time dev event0 pic0 event1 pic1
2 ac0 clockcycles 167242902 membank0rds 3144
2 ac1 clockcycles 167254476 membank0rds 1392
4 ac0 clockcycles 168025190 membank0rds 40302
4 ac1 clockcycles 168024056 membank0rds 40580
...
Example 3 Monitoring the events being counted
This example monitors the events that are being counted on
the sbus1 device, 100 times at 1 second intervals. It sug-
gests that a root user has changed the events that sbus1 was
counting to be dvmatlbmisses and interrupts instead of
piocycles.
% busstat -r sbus0 1 100
time dev event0 pic0 event1 pic1
1 sbus1 piocycles 2321 piocycles 2321
SunOS 5.11 Last change: 1 Nov 1999 4
System Administration Commands busstat(1M)
2 sbus1 piocycles 48 piocycles 48
3 sbus1 piocycles 49 piocycles 49
4 sbus1 piocycles 2281 piocycles 2281
5 sbus1 dvmatlbmisses 0 interrupts 0
6 sbus1 dvmatlbmisses 6 interrupts 2
7 sbus1 dvmatlbmisses 8 interrupts 11
...
Example 4 Event Multiplexing
This example programs ac0 to alternate between counting
(clock cycles, membank0rds) and (addrpkts, datapkts) at
2 second intervals while also monitoring what ac1 is count-
ing :
It shows the expected output of the above busstat command.
Another root user on the machine has changed the events that
this user had programmed and busstat has detected this and
terminates the command with a message.
# busstat -w ac0,pic0=clockcycles,pic1=membank0rds \
-w ac0,pic0=addrpkts,pic1=datapkts \
-r ac1 2
time dev event0 pic0 event1 pic1
2 ac0 addrpkts 12866 datapkts 17015
2 ac1 riopkts 385 riopkts 385
4 ac0 clockcycles 168018914 membank0rds 2865
4 ac1 riopkts 506 riopkts 506
6 ac0 addrpkts 144236 datapkts 149223
6 ac1 riopkts 522 riopkts 522
8 ac0 clockcycles 168021245 membank0rds 2564
8 ac1 riopkts 387 riopkts 387
10 ac0 addrpkts 144292 datapkts 159645
10 ac1 riopkts 506 riopkts 506
12 ac0 clockcycles 168020364 membank0rds 2665
12 ac1 riopkts 522 riopkts 522
busstat: events changed (possibly by another busstat).
#
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
SunOS 5.11 Last change: 1 Nov 1999 5
System Administration Commands busstat(1M)
ATRIBUTE TYPE ATRIBUTE VALUE
Availability SUNWcsu
SEE ALSO
iostat(1M), mpstat(1M), vmstat(1M), strtol(3C), attri-
butes(5)
SunOS 5.11 Last change: 1 Nov 1999 6
|