pluralize it...
[unix-history] / usr / src / lib / libcompat / 4.1 / vtimes.3
CommitLineData
af0bc818
KM
1.\" Copyright (c) 1980 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
79e6b3c8 5.\" @(#)vtimes.3 6.4 (Berkeley) %G%
af0bc818 6.\"
c86e0a67 7.TH VTIMES 3C ""
af0bc818
KM
8.UC 4
9.SH NAME
10vtimes \- get information about resource utilization
11.SH SYNOPSIS
12.nf
258190a5
DS
13.PP
14.B "#include <sys/vtimes.h>"
15.PP
af0bc818
KM
16.B "vtimes(par_vm, ch_vm)"
17.B "struct vtimes *par_vm, *ch_vm;"
18.fi
19.SH DESCRIPTION
efad4734 20.ft B
79e6b3c8
KB
21This interface is obsoleted by getrusage(2).
22.br
23It is available from the compatibility library, libcompat.
efad4734
KM
24.ft R
25.PP
af0bc818
KM
26.I Vtimes
27returns accounting information for the current process and for
28the terminated child processes of the current
29process. Either
30.I par_vm
31or
32.I ch_vm
33or both may be 0, in which case only the information for the pointers
34which are non-zero is returned.
35.PP
36After the call, each buffer contains information as defined by the
37contents of the include file
38.I /usr/include/sys/vtimes.h:
39.LP
40.nf
41struct vtimes {
42 int vm_utime; /* user time (*HZ) */
43 int vm_stime; /* system time (*HZ) */
44 /* divide next two by utime+stime to get averages */
45 unsigned vm_idsrss; /* integral of d+s rss */
46 unsigned vm_ixrss; /* integral of text rss */
47 int vm_maxrss; /* maximum rss */
48 int vm_majflt; /* major page faults */
49 int vm_minflt; /* minor page faults */
50 int vm_nswap; /* number of swaps */
51 int vm_inblk; /* block reads */
52 int vm_oublk; /* block writes */
53};
54.fi
55.PP
56The
57.I vm_utime
58and
59.I vm_stime
60fields give the user and system
61time respectively in 60ths of a second (or 50ths if that
62is the frequency of wall current in your locality.) The
63.I vm_idrss
64and
65.I vm_ixrss
66measure memory usage. They are computed by integrating the number of
67memory pages in use each
68over cpu time. They are reported as though computed
69discretely, adding the current memory usage (in 512 byte
70pages) each time the clock ticks. If a process used 5 core
71pages over 1 cpu-second for its data and stack, then
72.I vm_idsrss
73would have the value 5*60, where
74.I vm_utime+vm_stime
75would be the 60.
76.I Vm_idsrss
77integrates data and stack segment
78usage, while
79.I vm_ixrss
80integrates text segment usage.
81.I Vm_maxrss
82reports the maximum instantaneous sum of the
83text+data+stack core-resident page count.
84.PP
85The
86.I vm_majflt
87field gives the number of page faults which
88resulted in disk activity; the
89.I vm_minflt
90field gives the
91number of page faults incurred in simulation of reference
92bits;
93.I vm_nswap
94is the number of swaps which occurred. The
95number of file system input/output events are reported in
96.I vm_inblk
97and
98.I vm_oublk
99These numbers account only for real
100i/o; data supplied by the caching mechanism is charged only
101to the first process to read or write the data.
102.SH SEE ALSO
3311b706 103time(2), wait3(2), getrusage(2)