Changeset View
Changeset View
Standalone View
Standalone View
sbin/nvmecontrol/perftest.c
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | |||||
#include "nvmecontrol.h" | #include "nvmecontrol.h" | ||||
#define PERFTEST_USAGE \ | #define PERFTEST_USAGE \ | ||||
"perftest <-n num_threads> <-o read|write>\n" \ | "perftest <-n num_threads> <-o read|write>\n" \ | ||||
" <-s size_in_bytes> <-t time_in_seconds>\n" \ | " <-s size_in_bytes> <-t time_in_seconds>\n" \ | ||||
" <-i intr|wait> [-f refthread] [-p]\n" \ | " <-i intr|wait> [-f refthread] [-p]\n" \ | ||||
" <namespace id>\n" | " <namespace id>\n" | ||||
#define PERFTEST_ARGS \ | |||||
"<namespace id>" | |||||
#define PERFTEST_DESCR \ | |||||
"PErform low-level driver performance testing." | |||||
static void | static void | ||||
print_perftest(struct nvme_io_test *io_test, bool perthread) | print_perftest(struct nvme_io_test *io_test, bool perthread) | ||||
{ | { | ||||
uint64_t io_completed = 0, iops, mbps; | uint64_t io_completed = 0, iops, mbps; | ||||
uint32_t i; | uint32_t i; | ||||
for (i = 0; i < io_test->num_threads; i++) | for (i = 0; i < io_test->num_threads; i++) | ||||
▲ Show 20 Lines • Show All 110 Lines • ▼ Show 20 Lines | perftest(const struct nvme_function *nf, int argc, char *argv[]) | ||||
if (ioctl(fd, ioctl_cmd, &io_test) < 0) | if (ioctl(fd, ioctl_cmd, &io_test) < 0) | ||||
err(1, "ioctl NVME_IO_TEST failed"); | err(1, "ioctl NVME_IO_TEST failed"); | ||||
close(fd); | close(fd); | ||||
print_perftest(&io_test, perthread); | print_perftest(&io_test, perthread); | ||||
exit(0); | exit(0); | ||||
} | } | ||||
NVME_COMMAND(top, perftest, perftest, PERFTEST_USAGE); | NVME_COMMAND(top, perftest, perftest, PERFTEST_USAGE, PERFTEST_ARGS, PERFTEST_DESCR); |