exitsnoop(8) System Manager's Manual exitsnoop(8)

# [NAME](#NAME)

exitsnoop - Trace all process termination (exit, fatal signal). Uses Linux eBPF/bcc.

# [SYNOPSIS](#SYNOPSIS)

**exitsnoop \[-h] \[-t] \[--utc] \[-x] \[-p PID] \[--label LABEL] \[--per-thread]**

# [DESCRIPTION](#DESCRIPTION)

exitsnoop traces process termination, showing the command name and reason for termination, either an exit or a fatal signal.

It catches processes of all users, processes in containers, as well as processes that become zombie.

This works by tracing the kernel sched\_process\_exit() function using dynamic tracing, and will need updating to match any changes to this function.

Since this uses BPF, only the root user can use this tool.

# [REQUIREMENTS](#REQUIREMENTS)

CONFIG\_BPF and bcc.

# [OPTIONS](#OPTIONS)

[-h](#h)

Print usage message.

[-t](#t)

Include a timestamp column.

[--utc](#utc)

Include a timestamp column, use UTC timezone.

[-x](#x)

Exclude successful exits, exit( 0 )

[-p PID](#p)

Trace this process ID only (filtered in-kernel).

[--label LABEL](#label)

Label each line with LABEL (default 'exit') in first column (2nd if timestamp is present).

[--per-thread](#per)

Trace per thread termination

# [EXAMPLES](#EXAMPLES)

[Trace all process termination](#Trace)

\# **exitsnoop**

[Trace all process termination, and include timestamps:](#Trace~2)

\# **exitsnoop -t**

[Exclude successful exits, only include non-zero exit codes and fatal signals:](#Exclude)

\# **exitsnoop -x**

[Trace PID 181 only:](#Trace~3)

\# **exitsnoop -p 181**

[Label each output line with 'EXIT':](#Label)

\# **exitsnoop --label EXIT**

[Trace per thread termination](#Trace~4)

\# **exitsnoop --per-thread**

# [FIELDS](#FIELDS)

[TIME-TZ](#TIME_TZ)

Time of process termination HH:MM:SS.sss with milliseconds, where TZ is the local time zone, 'UTC' with --utc option.

[LABEL](#LABEL)

The optional label if --label option is used. This is useful with the -t option for timestamps when the output of several tracing tools is sorted into one combined output.

[PCOMM](#PCOMM)

Process/command name.

[PID](#PID)

Process ID

[PPID](#PPID)

The process ID of the process that will be notified of PID termination.

[TID](#TID)

Thread ID.

[EXIT\_CODE](#EXIT_CODE)

The exit code for exit() or the signal number for a fatal signal.

# [OVERHEAD](#OVERHEAD)

This traces the kernel sched\_process\_exit() function and prints output for each event. As the rate of this is generally expected to be low (&lt; 1000/s), the overhead is also expected to be negligible. If you have an application that has a high rate of process termination, then test and understand overhead before use.

# [SOURCE](#SOURCE)

This is from bcc.

https://github.com/iovisor/bcc

Also look in the bcc distribution for a companion \_examples.txt file containing example usage, output, and commentary for this tool.

# [OS](#OS)

Linux

# [STABILITY](#STABILITY)

Unstable - in development.

# [AUTHOR](#AUTHOR)

Arturo Martin-de-Nicolas

# [SEE ALSO](#SEE_ALSO)

[execsnoop(8)](/man/enterprise-packages/bcc/execsnoop.8)

2019-05-28 USER COMMANDS

---

Document: exitsnoop(8) from bcc 0.37.0-r3 (Chainguard OS)
Source: https://github.com/iovisor/bcc
