From 06ace1efbf41a62737883de592ab9611e63d2995 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Thu, 11 Feb 2021 13:14:10 -0700 Subject: [PATCH] nvme/fio_plugin: add print_qid_mappings option print_qid_mappings=1 will now add logging messages showing the {filename,qid} tuples associated with each job. Note that for the nvme plugin, the filename is essentially the transport ID. We just print that filename for simplicity rather than reconstructing a transport ID string from the ctrlr object. Signed-off-by: Jim Harris Change-Id: I9b714ac009fd16b96ed87c2c056be251009815b8 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6396 Reviewed-by: Niklas Cassel Reviewed-by: Changpeng Liu Reviewed-by: Ben Walker Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins --- examples/nvme/fio_plugin/fio_plugin.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/examples/nvme/fio_plugin/fio_plugin.c b/examples/nvme/fio_plugin/fio_plugin.c index 0807288a5..758f69a87 100644 --- a/examples/nvme/fio_plugin/fio_plugin.c +++ b/examples/nvme/fio_plugin/fio_plugin.c @@ -94,6 +94,7 @@ struct spdk_fio_options { int enable_vmd; int initial_zone_reset; int zone_append; + int print_qid_mappings; }; struct spdk_fio_request { @@ -387,6 +388,11 @@ attach_cb(void *cb_ctx, const struct spdk_nvme_transport_id *trid, return; } + if (fio_options->print_qid_mappings == 1) { + log_info("job %s: %s qid %d\n", td->o.name, f->file_name, + spdk_nvme_qpair_get_id(fio_qpair->qpair)); + } + fio_qpair->ns = ns; fio_qpair->f = f; fio_qpair->fio_ctrlr = fio_ctrlr; @@ -1591,6 +1597,16 @@ static struct fio_option options[] = { .category = FIO_OPT_C_ENGINE, .group = FIO_OPT_G_INVALID, }, + { + .name = "print_qid_mappings", + .lname = "Print job-to-qid mappings", + .type = FIO_OPT_INT, + .off1 = offsetof(struct spdk_fio_options, print_qid_mappings), + .def = "0", + .help = "Print job-to-qid mappings (0=disable, 1=enable)", + .category = FIO_OPT_C_ENGINE, + .group = FIO_OPT_G_INVALID, + }, { .name = NULL, },