killsnoop.bt(8)
π killsnoop.bt β the tea β
okay bestie, listen. killsnoop.bt lives in section 8 of the system manager's manual, and it's about to become your new fave. it traces the signals that get sent through the kill() syscall, using bpftrace/eBPF. no cap. β¨
πΈ NAME πΈ
killsnoop.bt β trace signals issued by the kill() syscall. uses bpftrace/eBPF. periodt. π
π SYNOPSIS π
killsnoop.bt
that's it. that's the whole vibe. she takes no arguments, she just goes. π
β¨ DESCRIPTION β¨
so killsnoop traces the kill() syscall, and it shows you the signals that get sent this way. why do you care? because sometimes an app is just out here failing for no apparent reason, and some unknown mechanism is out there sending signals like it's a secret admirer. this tool exposes them. π΅οΈβοΈπ
the way it works: it traces the kill() syscall tracepoints. that's the whole trick.
π¨ real talk: since this uses BPF, only the root user can use this tool. not a suggestion, that's just the rules. π
π¦ REQUIREMENTS π¦
CONFIG_BPFbpftrace
that's the list. go get 'em. π«Ά
π EXAMPLES π
trace all kill() syscalls:
# killsnoop.bt
iconic. one line. she ate. π₯
π FIELDS π
here's what every column means, bestie, so you're not out here squinting:
TIMEβ time of the kill call. β°PIDβ source process ID (who's doing the killing π)COMMβ source process nameSIGβ signal number. seesignal(7)for the lore.TPIDβ target process ID (who's getting got)RESβ the result.0== success π, a negative value (of the error code) for failure π
π OVERHEAD π
so this traces the kernel kill function and prints output for each and every event. normally the rate of this is expected to be low (< 100/s), so the overhead is also expected to be negligible. she's lightweight, she's chill. π§
BUT. if you've got an application that's calling a very high rate of kill()s for some reason (ma'am, why), then test and understand overhead before use. do not just rawdog it into production. π
β SOURCE β
this is from bpftrace.
https://github.com/iovisor/bpftrace
also, go look in the bpftrace distribution for a companion _examples.txt file β it's got example usage, output, and commentary for this tool. basically the director's cut. π¬
this is a bpftrace version of the bcc tool of the same name. heads up: the bcc tool may provide more options and customizations, so if you want extra toppings, check that one out too.
https://github.com/iovisor/bcc
π OS π
Linux β that's the one. π§
π STABILITY π
Unstable β in development. she's a work in progress and we love her for it. π§
πΈ AUTHOR πΈ
Brendan Gregg β the blueprint, the moment, the legend. π«Ά
π₯ SEE ALSO π₯
okay that's the whole page!! π this one was brought to you by the USER COMMANDS section, dated 2018-09-07, filed under killsnoop.bt(8) β go forth and trace those signals, bestie. slay. β¨ππ¦
π¦ where this page comes from
- debian bookworm: bpftrace 0.17.0-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms