manual page distributed with 4.1BSD
[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.\"
c86e0a67 5.\" @(#)vtimes.3 6.1 (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
13.B "vtimes(par_vm, ch_vm)"
14.B "struct vtimes *par_vm, *ch_vm;"
15.fi
16.SH DESCRIPTION
efad4734
KM
17.ft B
18This facility is superseded by getrusage(2).
19.ft R
20.PP
af0bc818
KM
21.I Vtimes
22returns accounting information for the current process and for
23the terminated child processes of the current
24process. Either
25.I par_vm
26or
27.I ch_vm
28or both may be 0, in which case only the information for the pointers
29which are non-zero is returned.
30.PP
31After the call, each buffer contains information as defined by the
32contents of the include file
33.I /usr/include/sys/vtimes.h:
34.LP
35.nf
36struct vtimes {
37 int vm_utime; /* user time (*HZ) */
38 int vm_stime; /* system time (*HZ) */
39 /* divide next two by utime+stime to get averages */
40 unsigned vm_idsrss; /* integral of d+s rss */
41 unsigned vm_ixrss; /* integral of text rss */
42 int vm_maxrss; /* maximum rss */
43 int vm_majflt; /* major page faults */
44 int vm_minflt; /* minor page faults */
45 int vm_nswap; /* number of swaps */
46 int vm_inblk; /* block reads */
47 int vm_oublk; /* block writes */
48};
49.fi
50.PP
51The
52.I vm_utime
53and
54.I vm_stime
55fields give the user and system
56time respectively in 60ths of a second (or 50ths if that
57is the frequency of wall current in your locality.) The
58.I vm_idrss
59and
60.I vm_ixrss
61measure memory usage. They are computed by integrating the number of
62memory pages in use each
63over cpu time. They are reported as though computed
64discretely, adding the current memory usage (in 512 byte
65pages) each time the clock ticks. If a process used 5 core
66pages over 1 cpu-second for its data and stack, then
67.I vm_idsrss
68would have the value 5*60, where
69.I vm_utime+vm_stime
70would be the 60.
71.I Vm_idsrss
72integrates data and stack segment
73usage, while
74.I vm_ixrss
75integrates text segment usage.
76.I Vm_maxrss
77reports the maximum instantaneous sum of the
78text+data+stack core-resident page count.
79.PP
80The
81.I vm_majflt
82field gives the number of page faults which
83resulted in disk activity; the
84.I vm_minflt
85field gives the
86number of page faults incurred in simulation of reference
87bits;
88.I vm_nswap
89is the number of swaps which occurred. The
90number of file system input/output events are reported in
91.I vm_inblk
92and
93.I vm_oublk
94These numbers account only for real
95i/o; data supplied by the caching mechanism is charged only
96to the first process to read or write the data.
97.SH SEE ALSO
98time(2), wait3(2)
99.SH BUGS
100This call is peculiar to this version of UNIX.
101The options and specifications of this system call are subject to change.
102It may be extended to include additional information
103in future versions of the system.