nvmet: introduce target-side trace
authorMinwoo Im <minwoo.im.dev@gmail.com>
Wed, 12 Jun 2019 12:45:33 +0000 (21:45 +0900)
committerChristoph Hellwig <hch@lst.de>
Fri, 21 Jun 2019 09:15:46 +0000 (11:15 +0200)
commita5448fdc469d67da99728a132229aba5fce8f67a
treecabfa2d20cfa94c9eac8a675fb6380e71a56e468
parent5f965f4fd92303066b319db4b4bbdb53cb924582
nvmet: introduce target-side trace

This patch introduces target-side request tracing.  As Christoph
suggested, the trace would not be in a core or module to avoid
disadvantages like cache miss:
  http://lists.infradead.org/pipermail/linux-nvme/2019-June/024721.html

The target-side trace code is entirely based on the Johannes's trace code
from the host side.  It has lots of codes duplicated, but it would be
better than having advantages mentioned above.

It also traces not only fabrics commands, but also nvme normal commands.
Once the codes to be shared gets bigger, then we can make it common as
suggsted.

This also removed the create_sq and create_cq trace parsing functions
because it will be done by the connect fabrics command.

Example:
  echo 1 > /sys/kernel/debug/tracing/event/nvmet/nvmet_req_init/enable
  echo 1 > /sys/kernel/debug/tracing/event/nvmet/nvmet_req_complete/enable
  cat /sys/kernel/debug/tracing/trace

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
[hch: fixed the symbol namespace and a an endianess conversion]
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/Makefile
drivers/nvme/target/core.c
drivers/nvme/target/trace.c [new file with mode: 0644]
drivers/nvme/target/trace.h [new file with mode: 0644]