nvme: add SPDK_DEBUGLOG support for nvme_cuse

It is useful to have debug log information in the nvme_cuse
path when debugging IOCTls and flows.

Signed-off-by: Curt Bruns <curt.e.bruns@gmail.com>
Change-Id: Ifef1bb82c96438e2fcbb9ad2fafe3f3eb66bed51
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7707
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Curt Bruns 2021-04-30 13:53:22 -04:00 committed by Tomasz Zawadzki
parent bcbccf8bb5
commit 0ba168fe39

View File

@ -557,10 +557,12 @@ cuse_ctrlr_ioctl(fuse_req_t req, int cmd, void *arg,
switch ((unsigned int)cmd) {
case NVME_IOCTL_ADMIN_CMD:
SPDK_DEBUGLOG(nvme_cuse, "NVME_IOCTL_ADMIN_CMD\n");
cuse_nvme_admin_cmd(req, cmd, arg, fi, flags, in_buf, in_bufsz, out_bufsz);
break;
case NVME_IOCTL_RESET:
SPDK_DEBUGLOG(nvme_cuse, "NVME_IOCTL_RESET\n");
cuse_nvme_reset(req, cmd, arg, fi, flags, in_buf, in_bufsz, out_bufsz);
break;
@ -582,27 +584,33 @@ cuse_ns_ioctl(fuse_req_t req, int cmd, void *arg,
switch ((unsigned int)cmd) {
case NVME_IOCTL_ADMIN_CMD:
SPDK_DEBUGLOG(nvme_cuse, "NVME_IOCTL_ADMIN_CMD\n");
cuse_nvme_admin_cmd(req, cmd, arg, fi, flags, in_buf, in_bufsz, out_bufsz);
break;
case NVME_IOCTL_SUBMIT_IO:
SPDK_DEBUGLOG(nvme_cuse, "NVME_IOCTL_SUBMIT_IO\n");
cuse_nvme_submit_io(req, cmd, arg, fi, flags, in_buf, in_bufsz, out_bufsz);
break;
case NVME_IOCTL_ID:
SPDK_DEBUGLOG(nvme_cuse, "NVME_IOCTL_ID\n");
cuse_getid(req, cmd, arg, fi, flags, in_buf, in_bufsz, out_bufsz);
break;
case BLKPBSZGET:
SPDK_DEBUGLOG(nvme_cuse, "BLKPBSZGET\n");
cuse_blkpbszget(req, cmd, arg, fi, flags, in_buf, in_bufsz, out_bufsz);
break;
case BLKGETSIZE:
SPDK_DEBUGLOG(nvme_cuse, "BLKGETSIZE\n");
/* Returns the device size as a number of 512-byte blocks (returns pointer to long) */
cuse_blkgetsize(req, cmd, arg, fi, flags, in_buf, in_bufsz, out_bufsz);
break;
case BLKGETSIZE64:
SPDK_DEBUGLOG(nvme_cuse, "BLKGETSIZE64\n");
/* Returns the device size in sectors (returns pointer to uint64_t) */
cuse_blkgetsize64(req, cmd, arg, fi, flags, in_buf, in_bufsz, out_bufsz);
break;
@ -1103,3 +1111,5 @@ spdk_nvme_cuse_get_ns_name(struct spdk_nvme_ctrlr *ctrlr, uint32_t nsid, char *n
return 0;
}
SPDK_LOG_REGISTER_COMPONENT(nvme_cuse)