Use debugfs tracing in linux kernel.

Just record how to use debugfs, tracing block IO.

 

Vivek Goyal  said on maillist:

"""

You can try using tracing functionality.

- mount -t debugfs none /sys/kernel/debug
- Enable tracing on the disk you are doing IO to.
 echo 1 > /sys/block/sda/trace/enable
- Enable block traces
 echo blk > /sys/kernel/debug/tracing/

current_tracer
- cat /sys/kernel/debug/tracing/trace_pipe > /tmp/trace_output

Let it run for few seconds. Interrupt and kill cat process.
/tmp/trace_output should have useful tracing info.