---
name: "writeback.bt.bt"
section: "8"
platform: "linux"
package: "bpftrace"
version: "0.17.0-1"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/writeback.bt.bt"
---

# writeback.bt.bt(8)

Trace file system writeback events with details. Uses bpftrace/eBPF.

## NAME

writeback.bt - Trace file system writeback events with details. Uses bpftrace/eBPF.

## SYNOPSIS

**writeback.bt**

## DESCRIPTION

This traces when file system dirtied pages are flushed to disk by kernel writeback, and prints details including when the event occurred, and the duration of the event. This can be useful for correlating these times with other performance problems, and if there is a match, it would be a clue that the problem may be caused by writeback. How quickly the kernel does writeback can be tuned: see the kernel docs, eg, vm.dirty\_writeback\_centisecs.

This uses the tracepoint:writeback:writeback\_start and tracepoint:writeback:writeback\_written tracepoints.

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

## REQUIREMENTS

CONFIG\_BPF and bpftrace.

## EXAMPLES

- Trace all writeback events with timestamps and latency details:

  \# **writeback.bt**

## FIELDS

- TIME

  Time that the writeback event completed, in %H:%M:%S format.

- DEVICE

  Device name in major:minor number format.

- PAGES

  Pages written during writeback.

- REASON

  Reason for the writeback event. This may be "background", "vmscan", "sync", "periodic", etc.

- ms

  Duration of the writeback event in milliseconds.

## OVERHEAD

Since writeback events are expected to be infrequent (\<10/sec), the overhead of this tool is expected to be negligible (near 0%).

## SOURCE

This is from bpftrace.

-

  https://github.com/iovisor/bpftrace

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

## OS

Linux

## STABILITY

Unstable - in development.

## AUTHOR

Brendan Gregg

## SEE ALSO

[biosnoop.bt(8)](/biosnoop.bt/8.md)
