Tracing filesystem reads and writes with bpftrace
This article describes how to get a breakdown of reads and writes by filesystem.
Overview
To analyze I/O behavior it can be useful to get a breakdown of the I/O activity by filesystem. This allows to focus performance engagements on the filesystems which have the most I/O or are the slowest.
Breakdown by reads
To have a look at the number of reads per filesystem, the reads.bt script can be used. Typical output of the script is shown below:
|
|
This shows there a considerable number of reads for the pseudo filesystems and for the btrfs filesystem.
Breakdown by writes
To have a look at the number of writes per filesystem, the writes.bt script can be used. Typical output of the script is shown below:
|
|
This shows there a considerable number of writes for the pseudo filesystems and in addition some writes for the btrfs filesystem.