-h Print usage message.
-T Include a timestamp column.
-U Show UID.
-x Only print failed opens.
-p PID Trace this process ID only (filtered in-kernel).
-t TID Trace this thread ID only (filtered in-kernel).
-u UID Trace this UID only (filtered in-kernel).
-d DURATION Total duration of trace in seconds.
-n name Only print processes where its name partially matches 'name'
-e Show extended fields.
-f FLAG Filter on open() flags, e.g., O_WRONLY.
-F Show full path for an open file with relative path.
--cgroupmap MAPPATH Trace cgroups in this BPF map only (filtered in-kernel).
--mntnsmap MAPPATH Trace mount namespaces in this BPF map only (filtered in-kernel).
Trace all open() syscalls: # opensnoop
Trace all open() syscalls, for 10 seconds only: # opensnoop -d 10
Trace all open() syscalls, and include timestamps: # opensnoop -T
Show UID: # opensnoop -U
Trace only open() syscalls that failed: # opensnoop -x
Trace PID 181 only: # opensnoop -p 181
Trace UID 1000 only: # opensnoop -u 1000
Trace all open() syscalls from processes where its name partially matches 'ed': # opensnoop -n ed
Show extended fields: # opensnoop -e
Only print calls for writing: # opensnoop -f O_WRONLY -f O_RDWR
Trace a set of cgroups only (see special_filtering.md from bcc sources for more details): # opensnoop --cgroupmap /sys/fs/bpf/test01
TIME(s) Time of the call, in seconds.
UID User ID
PID Process ID
TID Thread ID
COMM Process name
FD File descriptor (if success), or -1 (if failed)
ERR Error number (see the system's errno.h)
FLAGS Flags passed to open(2), in octal
PATH Open path
Also look in the bcc distribution for a companion _examples.txt file containing example usage, output, and commentary for this tool.