blob: 29d56b0a89372876f8690d59017bce15f13781a4 [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
Junli Ou5eee5ff2016-08-13 17:12:45 +08007TIME PID COMM SIG TPID RESULT
812:10:51 13967 bash 9 13885 0
912:11:34 13967 bash 9 1024 -3
1012:11:41 815 systemd-udevd 15 14076 0
Brendan Greggd9e578b2015-09-21 11:59:42 -070011
Junli Ou5eee5ff2016-08-13 17:12:45 +080012The first line showed a SIGKILL (9) sent from PID 13967 (a bash shell) to
13PID 13885. The result, 0, means success.
Brendan Greggd9e578b2015-09-21 11:59:42 -070014
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
Junli Ou5eee5ff2016-08-13 17:12:45 +080022usage: killsnoop [-h] [-x] [-p PID]
Brendan Greggd9e578b2015-09-21 11:59:42 -070023
24Trace signals issued by the kill() syscall
25
26optional arguments:
27 -h, --help show this help message and exit
Chris Down8ddcbdf2016-07-13 15:18:35 +010028 -x, --failed only show failed kill syscalls
Brendan Greggd9e578b2015-09-21 11:59:42 -070029 -p PID, --pid PID trace this PID only
30
31examples:
32 ./killsnoop # trace all kill() signals
Brendan Greggd9e578b2015-09-21 11:59:42 -070033 ./killsnoop -x # only show failed kills
34 ./killsnoop -p 181 # only trace PID 181