| @@ -1,102 +1,105 @@ | | | @@ -1,102 +1,105 @@ |
1 | .\" $NetBSD: dtruss.1m,v 1.4 2020/06/25 09:39:19 sevan Exp $ | | 1 | .\" $NetBSD: dtruss.1m,v 1.5 2020/06/25 14:08:48 uwe Exp $ |
2 | .Dd June 25, 2020 | | 2 | .Dd June 25, 2020 |
3 | .Dt DTRUSS 1 | | 3 | .Dt DTRUSS 1 |
4 | .Os | | 4 | .Os |
5 | .Sh NAME | | 5 | .Sh NAME |
6 | .Nm dtruss | | 6 | .Nm dtruss |
7 | .Nd process syscall details. Uses DTrace | | 7 | .Nd process syscall details. Uses DTrace |
8 | .Sh SYNOPSIS | | 8 | .Sh SYNOPSIS |
9 | .Nm | | 9 | .Nm |
10 | .Op Fl acdeflhoLs | | 10 | .Op Fl acdeflhoLs |
11 | .Op Fl t Ar syscall | | 11 | .Op Fl t Ar syscall |
12 | .Op Fl p Ar PID | Fl n Ar name | command | | 12 | .Op Fl p Ar PID | Fl n Ar name | command |
13 | .Sh DESCRIPTION | | 13 | .Sh DESCRIPTION |
14 | .Nm | | 14 | .Nm |
15 | prints details on process system calls. | | 15 | prints details on process system calls. |
16 | It is like a DTrace version of truss, and has been designed to be less | | 16 | It is like a DTrace version of truss, and has been designed to be less |
17 | intrusive than truss. | | 17 | intrusive than truss. |
18 | .Pp | | 18 | .Pp |
19 | Of particular interest is the elapsed times and on cpu times, which can | | 19 | Of particular interest is the elapsed times and on cpu times, which can |
20 | identify both system calls that are slow to complete, and those which are | | 20 | identify both system calls that are slow to complete, and those which are |
21 | consuming CPU cycles. | | 21 | consuming CPU cycles. |
22 | .Pp | | 22 | .Pp |
23 | Since this uses DTrace, only the root user or users with the dtrace_kernel | | 23 | Since this uses DTrace, only the root user or users with the dtrace_kernel |
24 | privilege can run this command. | | 24 | privilege can run this command. |
25 | .Bl -tag -width Ds | | 25 | .Bl -tag -width Fl |
26 | .It Fl a | | 26 | .It Fl a |
27 | print all details | | 27 | print all details |
28 | .It Fl b Ar bufsize | | 28 | .It Fl b Ar bufsize |
29 | dynamic variable buffer size. | | 29 | dynamic variable buffer size. |
30 | Increase this if you notice dynamic variable drop errors. | | 30 | Increase this if you notice dynamic variable drop errors. |
31 | The default is "4m" for 4 megabytes per CPU. | | 31 | The default is |
| | | 32 | .Ql "4m" |
| | | 33 | for 4\~megabytes per CPU. |
32 | .It Fl c | | 34 | .It Fl c |
33 | print system call counts | | 35 | print system call counts |
34 | .It Fl d | | 36 | .It Fl d |
35 | print relative timestamps, us | | 37 | print relative timestamps, us (microseconds) |
36 | .It Fl e | | 38 | .It Fl e |
37 | print elapsed times, us | | 39 | print elapsed times, us |
38 | .It Fl f | | 40 | .It Fl f |
39 | follow children as they are forked | | 41 | follow children as they are forked |
40 | .It Fl l | | 42 | .It Fl l |
41 | force printing of pid/lwpid per line | | 43 | force printing of pid/lwpid per line |
42 | .It Fl L | | 44 | .It Fl L |
43 | don't print pid/lwpid per line | | 45 | don't print pid/lwpid per line |
44 | .It Fl n Ar name | | 46 | .It Fl n Ar name |
45 | examine processes with this name | | 47 | examine processes with this name |
46 | .It Fl o | | 48 | .It Fl o |
47 | print on-cpu times, us | | 49 | print on-cpu times, us |
48 | .It Fl s | | 50 | .It Fl s |
49 | print stack backtraces | | 51 | print stack backtraces |
50 | .It Fl p Ar PID | | 52 | .It Fl p Ar PID |
51 | examine this PID | | 53 | examine this PID |
52 | .It Fl t Ar syscall | | 54 | .It Fl t Ar syscall |
53 | examine this syscall only | | 55 | examine this syscall only |
54 | .El | | 56 | .El |
55 | .Bl -column fieldtitle description | | 57 | .Bl -column "SYSCALL(args)" |
56 | .It Sy Fields Ta Sy Description | | 58 | .It Sy Field Ta Sy Description |
57 | .It PID/LWPID Process ID / Lightweight Process ID | | 59 | .It PID/LWPID Ta Process ID\|/\|Lightweight Process ID |
58 | .It RELATIVE relative timestamps to the start of the thread, us (microseconds) | | 60 | .It RELATIVE Ta relative timestamps to the start of the thread, us |
59 | .It ELAPSD elapsed time for this system call, us | | 61 | .It ELAPSD Ta elapsed time for this system call, us |
60 | .It CPU on-cpu time for this system call, us | | 62 | .It CPU Ta on-cpu time for this system call, us |
61 | .It SYSCALL(args) system call name, with arguments (some may be evaluated) | | 63 | .It SYSCALL(args) Ta system call name, with arguments (some may be evaluated) |
62 | .El | | 64 | .El |
63 | .Sh EXAMPLES | | 65 | .Sh EXAMPLES |
64 | run and examine the "df -h" command | | 66 | run and examine the |
65 | .Bd -literal -offset indent | | 67 | .Ql df -h |
66 | .Ic dtruss df -h | | 68 | command |
67 | .Ed | | 69 | .Pp |
| | | 70 | .Dl Ic dtruss df -h |
68 | .Pp | | 71 | .Pp |
69 | examine PID 1871 | | 72 | examine PID 1871 |
70 | .Bd -literal -offset indent | | 73 | .Pp |
71 | .Ic dtruss -p 1871 | | 74 | .Dl Ic dtruss -p 1871 |
72 | .Ed | | | |
73 | .Pp | | 75 | .Pp |
74 | examine all processes called "tar" | | 76 | examine all processes called "tar" |
75 | .Bd -literal -offset indent | | 77 | .Pp |
76 | .Ic dtruss -n tar | | 78 | .Dl Ic dtruss -n tar |
77 | .Ed | | 79 | .Pp |
78 | .Pp | | 80 | run |
79 | run test.sh and follow children | | 81 | .Ql test.sh |
80 | .Bd -literal -offset indent | | 82 | and follow children |
81 | .Ic dtruss -f test.sh | | 83 | .Pp |
82 | .Ed | | 84 | .Dl Ic dtruss -f test.sh |
83 | .Pp | | 85 | .Pp |
84 | run the "date" command and print elapsed and on cpu times, | | 86 | run the |
85 | .Bd -literal -offset indent | | 87 | .Ql date |
86 | .Ic dtruss -eo date | | 88 | command and print elapsed and on cpu times, |
87 | .Ed | | 89 | .Pp |
| | | 90 | .Dl Ic dtruss -eo date |
88 | .Sh STABILITY | | 91 | .Sh STABILITY |
89 | stable - needs the syscall provider. | | 92 | stable \(em needs the syscall provider. |
90 | .Sh DOCUMENTATION | | 93 | .Sh DOCUMENTATION |
91 | See the DTraceToolkit for further documentation under the Docs directory. | | 94 | See the DTraceToolkit for further documentation under the Docs directory. |
92 | The DTraceToolkit docs may include full worked examples with verbose | | 95 | The DTraceToolkit docs may include full worked examples with verbose |
93 | descriptions explaining the output. | | 96 | descriptions explaining the output. |
94 | .Sh EXIT | | 97 | .Sh EXIT |
95 | dtruss will run forever until Ctrl\-C is hit, or if a command was | | 98 | dtruss will run forever until Ctrl\-C is hit, or if a command was |
96 | executed dtruss will finish when the command ends. | | 99 | executed dtruss will finish when the command ends. |
97 | .Sh SEE ALSO | | 100 | .Sh SEE ALSO |
98 | .Xr dtrace 1 , | | 101 | .Xr dtrace 1 , |
99 | .Xr procsystime 1 | | 102 | .Xr procsystime 1 |
100 | .Sh AUTHORS | | 103 | .Sh AUTHORS |
101 | .An Brendan Gregg | | 104 | .An Brendan Gregg |
102 | [Sydney, Australia] | | 105 | [Sydney, Australia] |