]>
Commit | Line | Data |
---|---|---|
57cab491 A |
1 | .Dd April 24, 2012\r |
2 | .Dt systime 1\r | |
3 | .Os Darwin\r | |
4 | .Sh NAME\r | |
5 | .Nm systime\r | |
6 | .Nd gather system-wide time during program execution\r | |
7 | .Sh SYNOPSIS\r | |
8 | .Nm\r | |
9 | .Op Fl P\r | |
b5fe885e A |
10 | .Op Fl r\r |
11 | .Op Fl t Ar sleep_time\r | |
57cab491 A |
12 | .Ar utility Op Ar argument ...\r |
13 | .Nm\r | |
14 | .Fl p\r | |
b5fe885e A |
15 | .Op Fl r\r |
16 | .Op Fl t Ar sleep_time\r | |
57cab491 A |
17 | .Nm\r |
18 | .Op Fl P\r | |
19 | .Fl u Ar user\r | |
20 | .Fl s Ar sys\r | |
21 | .Fl i Ar idle\r | |
b5fe885e A |
22 | .Nm\r |
23 | .Op Fl P\r | |
24 | .Op Fl r\r | |
25 | .Op Fl t Ar sleep_time\r | |
26 | .Fl T Ar target_pid\r | |
57cab491 A |
27 | .Sh DESCRIPTION\r |
28 | .Nm\r | |
29 | is similar to\r | |
30 | .Xr time 1\r | |
31 | in that it allows you to execute a utility program. However after execution\r | |
32 | completes, it reports the system-wide time that was spent\r | |
33 | during that time period, instead of just the portion directly caused\r | |
34 | by the utility. This can be used to gather information about CPU\r | |
35 | utilization by kernel threads (AIO, networking) and interrupt routines\r | |
36 | on behalf of a program, but not directly attributed to it.\r | |
37 | .Pp\r | |
38 | The\r | |
39 | .Nm\r | |
40 | program can also be used to snapshot counters with\r | |
41 | .Fl p\r | |
42 | and then later used with\r | |
43 | .Fl u Fl s Fl i\r | |
44 | to calculate time spent during a time interval that doesn't correlate\r | |
45 | to a specific command execution. For example:\r | |
46 | .Pp\r | |
47 | .Bd -ragged -offset indent\r | |
48 | $ eval `systime -p`\r | |
49 | .Pp\r | |
50 | $ ... time passes ...\r | |
51 | .Pp\r | |
52 | $ systime -u $systime_user -s $systime_sys -i $systime_idle\r | |
53 | .Pp\r | |
54 | 18.79 real 2.03 user 1.04 sys\r | |
55 | .Ed\r | |
56 | .Pp\r | |
b5fe885e A |
57 | The\r |
58 | .Nm\r | |
59 | program can also be used to print the usage of a process with\r | |
60 | .Fl T Ar target_pid\r | |
61 | , also printing the system wide usage\r | |
62 | .Pp\r | |
57cab491 A |
63 | .Fl P\r |
64 | can be used to print time spent as a percentage of overall CPU capacity\r | |
65 | of the system (capped at 100%)\r | |
b5fe885e A |
66 | .Pp\r |
67 | .Fl r\r | |
68 | can be used to print the usage iteratively with\r | |
69 | .Ar sleep_time\r | |
70 | seconds sleep between iterations\r | |
71 | .Pp\r | |
72 | .Fl t Ar sleep_time\r | |
73 | can be used to specify sleep_time between iterations, defaults to 1 second if not specified.\r | |
57cab491 A |
74 | .Sh SEE ALSO\r |
75 | .Xr time 1 ,\r | |
76 | .Xr top 1\r |