Commit | Line | Data |
---|---|---|
be8ee4f0 C |
1 | VTIMES(3) BSD Programmer's Manual VTIMES(3) |
2 | ||
3 | N\bNA\bAM\bME\bE | |
4 | v\bvt\bti\bim\bme\bes\bs - get information about resource utilization | |
5 | ||
6 | S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS | |
7 | #\b#i\bin\bnc\bcl\blu\bud\bde\be <\b<s\bsy\bys\bs/\b/v\bvt\bti\bim\bme\bes\bs.\b.h\bh>\b> | |
8 | ||
9 | v\bvt\bti\bim\bme\bes\bs(_\bs_\bt_\br_\bu_\bc_\bt _\bv_\bt_\bi_\bm_\be_\bs _\b*_\bp_\ba_\br_\b__\bv_\bm, _\bs_\bt_\br_\bu_\bc_\bt _\bv_\bt_\bi_\bm_\be_\bs _\b*_\bc_\bh_\b__\bv_\bm); | |
10 | ||
11 | D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN | |
12 | T\bTh\bhi\bis\bs i\bin\bnt\bte\ber\brf\bfa\bac\bce\be i\bis\bs o\bob\bbs\bso\bol\ble\bet\bte\bed\bd b\bby\by g\bge\bet\btr\bru\bus\bsa\bag\bge\be(\b(2\b2)\b).\b. I\bIt\bt i\bis\bs a\bav\bva\bai\bil\bla\bab\bbl\ble\be f\bfr\bro\bom\bm t\bth\bhe\be | |
13 | c\bco\bom\bmp\bpa\bat\bti\bib\bbi\bil\bli\bit\bty\by l\bli\bib\bbr\bra\bar\bry\by,\b, l\bli\bib\bbc\bco\bom\bmp\bpa\bat\bt.\b. | |
14 | ||
15 | The v\bvt\bti\bim\bme\bes\bs() function returns accounting information for the current pro- | |
16 | cess and for the terminated child processes of the current process. Ei- | |
17 | ther _\bp_\ba_\br_\b__\bv_\bm or _\bc_\bh_\b__\bv_\bm or both may be 0, in which case only the information | |
18 | for the pointers which are non-zero is returned. | |
19 | ||
20 | After the call, each buffer contains information as defined by the con- | |
21 | tents of the include file _\b/_\bu_\bs_\br_\b/_\bi_\bn_\bc_\bl_\bu_\bd_\be_\b/_\bs_\by_\bs_\b/_\bv_\bt_\bi_\bm_\be_\bs_\b._\bh: | |
22 | ||
23 | struct vtimes { | |
24 | int vm_utime; /* user time (*HZ) */ | |
25 | int vm_stime; /* system time (*HZ) */ | |
26 | /* divide next two by utime+stime to get averages */ | |
27 | unsigned vm_idsrss; /* integral of d+s rss */ | |
28 | unsigned vm_ixrss; /* integral of text rss */ | |
29 | int vm_maxrss; /* maximum rss */ | |
30 | int vm_majflt; /* major page faults */ | |
31 | int vm_minflt; /* minor page faults */ | |
32 | int vm_nswap; /* number of swaps */ | |
33 | int vm_inblk; /* block reads */ | |
34 | int vm_oublk; /* block writes */ | |
35 | }; | |
36 | ||
37 | The _\bv_\bm_\b__\bu_\bt_\bi_\bm_\be and _\bv_\bm_\b__\bs_\bt_\bi_\bm_\be fields give the user and system time respec- | |
38 | tively in 60ths of a second (or 50ths if that is the frequency of wall | |
39 | current in your locality.) The _\bv_\bm_\b__\bi_\bd_\br_\bs_\bs and _\bv_\bm_\b__\bi_\bx_\br_\bs_\bs measure memory us- | |
40 | age. They are computed by integrating the number of memory pages in use | |
41 | each over CPU time. They are reported as though computed discretely, | |
42 | adding the current memory usage (in 512 byte pages) each time the clock | |
43 | ticks. If a process used 5 core pages over 1 cpu-second for its data and | |
44 | stack, then _\bv_\bm_\b__\bi_\bd_\bs_\br_\bs_\bs would have the value 5*60, where _\bv_\bm_\b__\bu_\bt_\bi_\bm_\be_\b+_\bv_\bm_\b__\bs_\bt_\bi_\bm_\be | |
45 | would be the 60. The _\bV_\bm_\b__\bi_\bd_\bs_\br_\bs_\bs argument integrates data and stack seg- | |
46 | ment usage, while _\bv_\bm_\b__\bi_\bx_\br_\bs_\bs integrates text segment usage. The _\bV_\bm_\b__\bm_\ba_\bx_\br_\bs_\bs | |
47 | function reports the maximum instantaneous sum of the text+data+stack | |
48 | core-resident page count. | |
49 | ||
50 | The _\bv_\bm_\b__\bm_\ba_\bj_\bf_\bl_\bt field gives the number of page faults which resulted in | |
51 | disk activity; the _\bv_\bm_\b__\bm_\bi_\bn_\bf_\bl_\bt field gives the number of page faults in- | |
52 | curred in simulation of reference bits; _\bv_\bm_\b__\bn_\bs_\bw_\ba_\bp is the number of swaps | |
53 | which occurred. The number of file system input/output events are re- | |
54 | ported in _\bv_\bm_\b__\bi_\bn_\bb_\bl_\bk and _\bv_\bm_\b__\bo_\bu_\bb_\bl_\bk These numbers account only for real I/O; | |
55 | data supplied by the caching mechanism is charged only to the first pro- | |
56 | cess to read or write the data. | |
57 | ||
58 | S\bSE\bEE\bE A\bAL\bLS\bSO\bO | |
59 | time(2), wait3(2), getrusage(2) | |
60 | ||
61 | H\bHI\bIS\bST\bTO\bOR\bRY\bY | |
62 | The v\bvl\bli\bim\bmi\bit\bt() function appeared in 4.2BSD. | |
63 | ||
64 | 4th Berkeley Distribution June 4, 1993 1 |