scstat(8) scstat(8)
NAME
scstat - system call statistics monitor
SYNOPSIS
/usr/sbin/scstat -[z]a
/usr/sbin/scstat -[z]p pid
/usr/sbin/scstat -[z]d
/usr/sbin/scstat -z
/usr/sbin/scstat [-cste] [-o output] [interval [count]]
/usr/sbin/scstat [-u user] [-g group] -x command]
DESCRIPTION
The kernel can keep track of which system calls are being executed on
each processor and the amount of time that each processor is devoting
to the execution of each system call. Unless this capability is
activated, the kernel does not keep track of such system call statis-
tics.
scstat provides the user the ability to do the following: activate and
deactivate the kernel system call monitoring, clear the system call
statistics that have been gathered by the kernel, and report the sys-
tem call statistics that the kernel has gathered.
OPTIONS
The following options may be supplied to scstat to control the state
of kernel system call monitoring:
-a Activates the kernel system call monitoring for all processes.
-p pid Activates the kernel system call monitoring only for the
process that has a process ID of pid.
-d Deactivates the kernel system call monitoring.
-z Clears the system call monitoring statistics that the ker-
nel has gathered.
-x command Executes command with system call monitoring activated.
-u user Sets the user ID before executing command.
-g group Sets the group ID before executing command.
Note that the -a, -p, and -d options are mutually exclusive, and that
these three options are only available for use by the superuser.
When either no options or the following options are supplied, scstat
Page 1 Reliant UNIX 5.44 Printed 11/98
scstat(8) scstat(8)
samples the system call statistics being gathered by the kernel every
interval seconds and dynamically updates a report on the terminal
screen count times. If the output is to be redirected to a file, you
must use the -o option. The default interval is 5 seconds and the
default count is 10000. Note that this can only be done while kernel
system call monitoring is active.
-c Reports detailed system call activity on a per-CPU basis.
The default is to report detailed system call activity
collectively for all processors.
-s Reports cumulative system call activity since kernel sys-
tem call monitoring has been activated. This option causes
the total number of system calls, as opposed to the system
call rate, to be reported.
-t Sorts the detailed system call information being reported
by the percentage of time for each system call instead of
by total number of system calls or system call rate.
-e Includes statistics for exit(2).
-o output Outputs the system call report information to the speci-
fied output file instead of the terminal screen.
The first line of the report is a summary of the system call activity
that occurred during the time interval.
Here are two examples:
If activated with -p 266 and the -s option has been specified, and the
machine has two processors, the first line of the report may appear as
follows:
(pid 266) Total calls 75. By CPU:
(0) 25 (1) 50
This summary shows that process ID 266 has executed a total of 75 sys-
tem calls, 25 executed on processor number 0 and 50 executed on pro-
cessor number 1.
If activated with -a and the -s option has not been specified, and the
machine has four processors, the first line of the report may appear
as follows:
Total calls/sec 100. By CPU:
(0) 26 (1) 24 (2) 23 (3) 27
Page 2 Reliant UNIX 5.44 Printed 11/98
scstat(8) scstat(8)
This summary shows that all processors collectively are executing 100
system calls per second; 26 calls per second are being executed on
processor number 0, 24 calls per second are being executed on proces-
sor number 1, 23 calls per second are being executed on processor
number 2, and 27 calls per second are being executed on processor
number 3.
The remainder of the report provides detailed information about which
system calls are being executed, the execution rate or total number of
executions, and the percentage of system call time that is being spent
for execution. When the -c option is specified, this detailed informa-
tion is reported for each processor on a separate section of the ter-
minal screen or in a separate portion of the output file when the -o
option is specified.
EXAMPLES
The following command will activate kernel system call monitoring for
all processes:
/usr/sbin/scstat -a
The following command deactivates kernel system call monitoring and
clears the statistics that the kernel has been gathering:
/usr/sbin/scstat -dz
The following command samples the kernel system call statistics every
10 seconds, for 20 iterations. Each iteration updates the terminal
screen with system call rate information for each processor installed
in the system, sorted by system call rate:
/usr/sbin/scstat -c 10 20
The following command samples the kernel system call statistics every
five seconds, for 10000 iterations. Each iteration updates the termi-
nal screen with cumulative system call information for all processors,
sorted by percentage of system call time:
/usr/sbin/scstat -st
Note that in the above example, an interrupt will cause program termi-
nation so that the full 10000 iterations do not have to be performed.
The following command samples the kernel system call statistics every
20 seconds, for 50 iterations. Each iteration outputs system call rate
information to file output for each processor installed in the system,
sorted by system call rate:
/usr/sbin/scstat -c -o output 20 50
SEE ALSO
truss(1).
Page 3 Reliant UNIX 5.44 Printed 11/98