Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: Add NSID column #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions examples/nvme/perf/perf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion isa-l
Submodule isa-l deleted from f3993f