logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

syncsnoop.bt - Trace the sync() variety of syscalls. Uses bpftrace/eBPF.

Author

       Brendan Gregg

Description

       syncsnoop  traces  calls  to  sync()  syscalls (sync(), fsync(), msync(), etc), which flushes file system
       cache and buffers to storage devices. These calls can cause performance  perturbations,  and  it  can  be
       useful to know if they are happening, when they happen, and how frequently.

       This works by tracing the sync() variety of syscalls via tracepoints.

       This program is also a basic example of eBPF/bcc.

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

Examples

       Trace calls to sync() syscalls:
              # syncsnoop.bt

Fields

       TIME   A timestamp on the output, in "HH:MM:SS" format.

       PID    The process ID that was on-CPU during the event.

       COMM   The process name that was on-CPU during the event.

       EVENT  The tracepoint name for the sync event.

Name

       syncsnoop.bt - Trace the sync() variety of syscalls. Uses bpftrace/eBPF.

Os

       Linux

Overhead

       This  traces sync syscalls and prints output for each event. As the rate of this is generally expected to
       be low (<< 100/s), the overhead is also expected to be negligible.

Requirements

       CONFIG_BPF and bpftrace.

See Also

iostat(1)

USER COMMANDS                                      2018-09-06                                    syncsnoop.bt(8)

Source

       This is from bpftrace.

              https://github.com/bpftrace/bpftrace

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

       This is a bpftrace version of the bcc tool of the same name.

              https://github.com/iovisor/bcc

Stability

       Unstable - in development.

Synopsis

syncsnoop.bt

See Also