I want to measure how much could be gained by placing some of a filesystem data on a fast device, vs regular spinning disks. As an example, measure extended attribute (xattr) operations, vs regular reads and writes.
I started with the "bpftrace" tool, following individual VFS calls with a thread local variable. Attempting to catch the associated block device requests fails, probably because the actual IO is done by a "kworker" process.
Here is the naive code:
kprobe:vfs_getxattr,
kprobe:vfs_setxattr,
kprobe:vfs_read*,
kprobe:vfs_write*
/comm == "some-process"/
{
@start[tid] = nsecs;
@name[tid] = func;
}
tracepoint:block:block_rq_issue
/@start[tid]/
{
@bio[@name[tid]] = count();
}
kretprobe:vfs_getxattr,
kretprobe:vfs_setxattr,
kretprobe:vfs_read*,
kretprobe:vfs_write*
/@start[tid]/
{
@count[@name[tid]] = count();
delete(@start[tid]);
delete(@name[tid]);
}
Is there any way I could follow the VFS calls down to block device IO?