]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - cddl/contrib/dtracetoolkit/Examples/lastwords_example.txt
Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.
[FreeBSD/stable/10.git] / cddl / contrib / dtracetoolkit / Examples / lastwords_example.txt
1 The following is a demonstration of the lastwords command,
2
3
4 Here we run lastwords to catch syscalls from processes named "bash" as they
5 exit,
6
7    # ./lastwords bash
8    Tracing... Waiting for bash to exit...
9    1091567219163679    1861         bash    sigaction          0   0
10    1091567219177487    1861         bash    sigaction          0   0
11    1091567219189692    1861         bash    sigaction          0   0
12    1091567219202085    1861         bash    sigaction          0   0
13    1091567219214553    1861         bash    sigaction          0   0
14    1091567219226690    1861         bash    sigaction          0   0
15    1091567219238786    1861         bash    sigaction          0   0
16    1091567219251697    1861         bash    sigaction          0   0
17    1091567219265770    1861         bash    sigaction          0   0
18    1091567219294110    1861         bash        gtime   42a7c194   0
19    1091567219428305    1861         bash        write          5   0
20    1091567219451138    1861         bash   setcontext          0   0
21    1091567219473911    1861         bash    sigaction          0   0
22    1091567219516487    1861         bash       stat64          0   0
23    1091567219547973    1861         bash       open64          4   0
24    1091567219638345    1861         bash        write          5   0
25    1091567219658886    1861         bash        close          0   0
26    1091567219689094    1861         bash       open64          4   0
27    1091567219704301    1861         bash      fstat64          0   0
28    1091567219731796    1861         bash         read        2fe   0
29    1091567219745541    1861         bash        close          0   0
30    1091567219768536    1861         bash  lwp_sigmask   ffbffeff   0
31    1091567219787494    1861         bash        ioctl          0   0
32    1091567219801338    1861         bash      setpgrp        6a3   0
33    1091567219814067    1861         bash        ioctl          0   0
34    1091567219825791    1861         bash  lwp_sigmask   ffbffeff   0
35    1091567219847778    1861         bash      setpgrp          0   0
36    TIME                 PID         EXEC      SYSCALL     RETURN ERR
37
38 In another window, a bash shell was executed and then exited normally. The
39 last few system calls that the bash shell made can be seen above.
40
41
42
43
44 In the following example we moniter the exit of bash shells again, but this
45 time the bash shell sends itself a "kill -8",
46
47    # ./lastwords bash
48    Tracing... Waiting for bash to exit...
49    1091650185555391    1865         bash    sigaction          0   0
50    1091650185567963    1865         bash    sigaction          0   0
51    1091650185580316    1865         bash    sigaction          0   0
52    1091650185592381    1865         bash    sigaction          0   0
53    1091650185605046    1865         bash    sigaction          0   0
54    1091650185618451    1865         bash    sigaction          0   0
55    1091650185647663    1865         bash        gtime   42a7c1e7   0
56    1091650185794626    1865         bash         kill          0   0
57    1091650185836941    1865         bash  lwp_sigmask   ffbffeff   0
58    1091650185884145    1865         bash       stat64          0   0
59    1091650185916135    1865         bash       open64          4   0
60    1091650186005673    1865         bash        write          b   0
61    1091650186025782    1865         bash        close          0   0
62    1091650186052002    1865         bash       open64          4   0
63    1091650186067538    1865         bash      fstat64          0   0
64    1091650186094289    1865         bash         read        309   0
65    1091650186108086    1865         bash        close          0   0
66    1091650186129965    1865         bash  lwp_sigmask   ffbffeff   0
67    1091650186149092    1865         bash        ioctl          0   0
68    1091650186162614    1865         bash      setpgrp        6a3   0
69    1091650186175457    1865         bash        ioctl          0   0
70    1091650186187206    1865         bash  lwp_sigmask   ffbffeff   0
71    1091650186209514    1865         bash      setpgrp          0   0
72    1091650186225307    1865         bash    sigaction          0   0
73    1091650186238832    1865         bash       getpid        749   0
74    1091650186260149    1865         bash         kill          0   0
75    1091650186277925    1865         bash   setcontext          0   0
76    TIME                 PID         EXEC      SYSCALL     RETURN ERR
77
78 The last few system calls are different, we can see the kill system call
79 before bash exits.
80
81