execsnoop.bt(8)
β¨ execsnoop.bt(8) β NAME β¨
okay so bestie, execsnoop.bt is a tool that traces new processes via exec() syscalls π and it runs on bpftrace/eBPF π
π SYNOPSIS π
execsnoop.bt
πΈ DESCRIPTION πΈ
okay so this traces when processes call exec() (execve()) π¦ it's giving detective energy for spotting new processes born from the usual fork()->exec() sequence β¨ ngl the return value is not currently traced, so the exec() may have failed π
this tool is lowkey iconic for debugging shell scripts, including application startup π it's also super useful for spotting a performance issue: a flood of short-lived processes that end quickly and aren't readily visible in top(1) π
since this uses BPF, only the root user can use this tool π
π§ REQUIREMENTS π§
you need CONFIG_BPF and bpftrace π
π EXAMPLES π
Trace all new processes calling execve():
# execsnoop.bt
π₯ FIELDS π₯
TIMEβ time of theexec()call, in milliseconds since program start β°PIDβ process ID π«ΆPPIDβ parent process ID πͺARGSβ process name and arguments (16 word maximum) π
π OVERHEAD π
this traces the execve() tracepoint and prints output for each event π
the rate is generally expected to be low (< 100/s), so the overhead is also expected to be negligible β¨ but if you have an application spawning a high rate of new processes for a reason (large build process), this could cause a small amount of overhead, so test and understand overhead before use π
π¦ SOURCE π¦
this is from bpftrace π©·
https://github.com/bpftrace/bpftrace
also look in the bpftrace distribution for a companion _examples.txt file with example usage, output, and commentary for this tool π
this is a bpftrace version of the bcc tool of the same name π the bcc tool provides more fields and options to customize the output π
https://github.com/iovisor/bcc
π» OS π»
Linux π§
π₯Ί STABILITY π₯Ί
Unstable - in development. π§
π AUTHOR π
Brendan Gregg π«Ά
π SEE ALSO π
opensnoop.bt(8)β¨
USER COMMANDS Β· 2018-09-11 Β· execsnoop.bt(8) π bestie, that's the whole tea, now go trace those processes, periodt! π πΈ
π¦ where this page comes from
- alpine 3.24: bpftrace-tools-doc 0.26.1-r0 Β· Apache-2.0
- arch rolling: bpftrace 0.27.0-2 Β· Apache-2.0
- centos-stream 10: bpftrace 0.26.1-1.el10 Β· Apache-2.0
- centos-stream 9: bpftrace 0.26.1-1.el9 Β· ASL 2.0
- debian trixie: bpftrace 0.23.2-1 Β· Apache-2.0
- fedora 43: bpftrace 0.24.0-1.fc43 Β· Apache-2.0
- fedora 43: bpftrace 0.24.2-1.fc43 Β· Apache-2.0
- fedora 44: bpftrace 0.24.2-3.fc44 Β· Apache-2.0
- nixos 26.05: bpftrace 0.25.1
- nixpkgs unstable: bpftrace 0.27.1
- opensuse-leap 16.0: bpftrace-tools 0.23.5-160000.1.2 Β· Apache-2.0
- ubuntu questing: bpftrace 0.23.5-1ubuntu1 Β· Apache-2.0
- ubuntu resolute: bpftrace 0.25.0-1ubuntu1 Β· Apache-2.0
- ubuntu stonking: bpftrace 0.25.0-1ubuntu2 Β· Apache-2.0
- π girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms