blob: 1f49b0f42a78c21a0bed088c4046fb524464f18f [file] [log] [blame]
Brendan Greggd9e578b2015-09-21 11:59:42 -07001Demonstrations of killsnoop, the Linux eBPF/bcc version.
2
3
4This traces signals sent via the kill() syscall. For example:
5
Alexei Starovoitovbdf07732016-01-14 10:09:20 -08006# ./killsnoop
Brendan Greggd9e578b2015-09-21 11:59:42 -07007PID COMM SIG TPID RESULT
817064 bash 9 27682 0
917064 bash 9 27682 -3
1017064 bash 0 17064 0
11
12The first line showed a SIGKILL (9) sent from PID 17064 (a bash shell) to
13PID 27682. The result, 0, means success.
14
15The second line showed the same signal sent, this time resulting in a -3
16(ESRCH: no such process).
17
18
19USAGE message:
20
21# ./killsnoop -h
22usage: killsnoop [-h] [-t] [-x] [-p PID]
23
24Trace signals issued by the kill() syscall
25
26optional arguments:
27 -h, --help show this help message and exit
28 -t, --timestamp include timestamp on output
Chris Down8ddcbdf2016-07-13 15:18:35 +010029 -x, --failed only show failed kill syscalls
Brendan Greggd9e578b2015-09-21 11:59:42 -070030 -p PID, --pid PID trace this PID only
31
32examples:
33 ./killsnoop # trace all kill() signals
34 ./killsnoop -t # include timestamps
35 ./killsnoop -x # only show failed kills
36 ./killsnoop -p 181 # only trace PID 181