From 7027a37f3b5ed710b66e47f0918dc160e0bbdf50 Mon Sep 17 00:00:00 2001 From: Alla Kiseleva Date: Thu, 6 Feb 2020 14:19:52 +0000 Subject: [PATCH] perf: Add NSID in perf output information Currently an option is implemented to monitor a correlation between the core and namespace. Previously: ================================================================== Device Information RDMA (addr:1.1.75.2 subnqn:nqn.2016-06.io.spdk:cnode1 from core 0: RDMA (addr:1.1.75.2 subnqn:nqn.2016-06.io.spdk:cnode1 from core 0: ================================================================== Now: ======================================================================== Device Information RDMA (addr:1.1.75.2 subnqn:nqn.2016-06.io.spdk:cnode1 NSID 1 from core 0: RDMA (addr:1.1.75.2 subnqn:nqn.2016-06.io.spdk:cnode1 NSID 2 from core 0: ======================================================================== Signed-off-by: Alla Kiseleva --- examples/nvme/perf/perf.c | 25 ++++++++++++++++++++----- isa-l | 1 - 2 files changed, 20 insertions(+), 6 deletions(-) delete mode 160000 isa-l diff --git a/examples/nvme/perf/perf.c b/examples/nvme/perf/perf.c index 1268dc1ca4d..01804705077 100644 --- a/examples/nvme/perf/perf.c +++ b/examples/nvme/perf/perf.c @@ -632,27 +632,42 @@ static const struct ns_fn_table nvme_fn_table = { .cleanup_ns_worker_ctx = nvme_cleanup_ns_worker_ctx, }; -static void +static int build_nvme_name(char *name, size_t length, struct spdk_nvme_ctrlr *ctrlr) { const struct spdk_nvme_transport_id *trid; + int res = 0; trid = spdk_nvme_ctrlr_get_transport_id(ctrlr); switch (trid->trtype) { case SPDK_NVME_TRANSPORT_PCIE: - snprintf(name, length, "PCIE (%s)", trid->traddr); + res = snprintf(name, length, "PCIE (%s)", trid->traddr); break; case SPDK_NVME_TRANSPORT_RDMA: - snprintf(name, length, "RDMA (addr:%s subnqn:%s)", trid->traddr, trid->subnqn); + res = snprintf(name, length, "RDMA (addr:%s subnqn:%s)", trid->traddr, trid->subnqn); break; case SPDK_NVME_TRANSPORT_TCP: - snprintf(name, length, "TCP (addr:%s subnqn:%s)", trid->traddr, trid->subnqn); + res = snprintf(name, length, "TCP (addr:%s subnqn:%s)", trid->traddr, trid->subnqn); break; + default: fprintf(stderr, "Unknown transport type %d\n", trid->trtype); break; } + return res; +} + +static void +build_nvme_ns_name(char *name, size_t length, struct spdk_nvme_ctrlr *ctrlr, uint32_t nsid) +{ + int res = 0; + + res = build_nvme_name(name, length, ctrlr); + if (res > 0) { + snprintf(name + res, length - res, " NSID %u", nsid); + } + } static void @@ -746,7 +761,7 @@ register_ns(struct spdk_nvme_ctrlr *ctrlr, struct spdk_nvme_ns *ns) g_max_io_size_blocks = entry->io_size_blocks; } - build_nvme_name(entry->name, sizeof(entry->name), ctrlr); + build_nvme_ns_name(entry->name, sizeof(entry->name), ctrlr, spdk_nvme_ns_get_id(ns)); g_num_namespaces++; entry->next = g_namespaces; diff --git a/isa-l b/isa-l deleted file mode 160000 index f3993f5c0b6..00000000000 --- a/isa-l +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f3993f5c0b69118a229c2dfbb360515cd34a24e6