0

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?

1 Answers1

0

there are two options

  1. use blktrace
  2. Part of bcc specifically biosnoop Trace block device I/O and print details including issuing PID.

Maybe helpful here is Brendan Greg's blog post. I refer for using eBPF.

Linux Performance

Devidas
  • 2,479
  • 9
  • 24