2

For instance, we have /sys/kernel/debug/tracing/events/block/block_bio_complete and block_rq_complete which is basically IO completion trace points for ftrace, I believe. Using sudo blktrace -d /dev/sdb1 -o - | blkparse -i - we might see a line like this:

  8,33   1        3     0.001086286     0  C  RA 1158137880 + 8 [0]
                                           ^ IO completion action

The C here is the IO completion event according to the documentation but is this the same as block_bio_complete or is it somehow different. Checking the source code, I can see at https://elixir.bootlin.com/linux/v5.6/source/block/blk-core.c#L1441:

trace_block_rq_complete(req, blk_status_to_errno(error), nr_bytes);

And at https://elixir.bootlin.com/linux/v5.6/source/block/bio.c#L1863:

trace_block_bio_complete(bio->bi_disk->queue, bio, blk_status_to_errno(bio->bi_status));

Which of the two is the C action? Or does blktrace use a separate set of actions - searches tell me ftrace and blktrace use different reporting mechanisms, but I cannot work out how each tracepoint for both mechanisms relate to kernel source code. Is there an easy way to map tracepoints to source code?

Ken Y-N
  • 253
  • 2
  • 10

0 Answers0