---
name: "bindsnoop-bpfcc"
section: "8"
platform: "linux"
package: "bpfcc-tools"
version: "0.31.0+ds-7"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/bindsnoop-bpfcc"
---

# bindsnoop-bpfcc(8)

Trace bind() system calls.

## NAME

bindsnoop - Trace bind() system calls.

## SYNOPSIS

**bindsnoop \[-h\] \[-w\] \[-t\] \[-p PID\] \[-P PORT\] \[-E\] \[-U\] \[-u UID\] \[--count\] \[--cgroupmap MAP\] \[--mntnsmap MNTNSMAP\]**

## DESCRIPTION

bindsnoop reports socket options set before the bind call that would impact this system call behavior.

## REQUIREMENTS

CONFIG\_BPF and bcc.

## OPTIONS:

- Show help message and exit:

  - **-h, --help**

  - Include timestamp on output:

  - **-t, --timestamp**

  - Wider columns (fit IPv6):

  - **-w, --wide**

  - Trace this PID only:

  - **-p PID, --pid PID**

  - Comma-separated list of ports to trace:

  - **-P PORT, --port PORT**

  - Trace cgroups in this BPF map:

  - **--cgroupmap MAP**

  - Trace mount namespaces in this BPF map:

  - **--mntnsmap MNTNSMAP**

  - Include errors in the output:

  - **-E, --errors**

  - Include UID on output:

  - **-U, --print-uid**

  - Trace this UID only:

  - **-u UID, --uid UID**

  - Count binds per src ip and port:

  - **--count**

  ## EXAMPLES:

- Trace all IPv4 and IPv6 **bind**()s

  - **bindsnoop**

  - Include timestamps

  - **bindsnoop -t**

  - Trace PID 181

  - **bindsnoop -p 181**

  - Trace port 80

  - **bindsnoop -P 80**

  - Trace port 80 and 81

  - **bindsnoop -P 80,81**

  - Include UID

  - **bindsnoop -U**

  - Trace UID 1000

  - **bindsnoop -u 1000**

  - Report bind errors

  - **bindsnoop -E**

  - Count bind per src ip

  - **bindsnoop --count**

  Trace IPv4 and IPv6 bind system calls and report socket options that would impact bind call behavior:

- SOL\_IP IP\_FREEBIND F....

  - SOL\_IP IP\_TRANSPARENT .T...

  - SOL\_IP IP\_BIND\_ADDRESS\_NO\_PORT ..N..

  - SOL\_SOCKET SO\_REUSEADDR ...R.

  - SOL\_SOCKET SO\_REUSEPORT ....r

  SO\_BINDTODEVICE interface is reported as "IF" index

## 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

Linux

## STABILITY

Unstable - in development.

## AUTHOR

Pavel Dubovitsky

## SEE ALSO

tcpaccept(8)
