Skip to content

Commit fb984ca

Browse files
committed
feat(amzn): Enable interval polling for EBS devices
Remove the local-storage-only restriction on the -i/--interval option so it works for both EBS and local storage devices.
1 parent 03fd5e6 commit fb984ca

1 file changed

Lines changed: 1 addition & 10 deletions

File tree

plugins/amzn/amzn-nvme.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,6 @@ static int get_stats(int argc, char **argv, struct command *acmd,
544544
nvme_print_flags_t flags = 0;
545545
struct nvme_passthru_cmd cmd;
546546
struct nvme_id_ctrl ctrl;
547-
bool local_storage = false;
548547
bool detail = false;
549548
unsigned int interval = 0;
550549
size_t len;
@@ -561,7 +560,7 @@ static int get_stats(int argc, char **argv, struct command *acmd,
561560

562561
NVME_ARGS(opts,
563562
OPT_FLAG("details", 'd', &detail, "Detail IO histogram of each block size ranges"),
564-
OPT_UINT("interval", 'i', &interval, "Polling interval in seconds (local storage only)"));
563+
OPT_UINT("interval", 'i', &interval, "Polling interval in seconds"));
565564

566565
rc = parse_and_open(&ctx, &hdl, argc, argv, desc, opts);
567566
if (rc)
@@ -575,7 +574,6 @@ static int get_stats(int argc, char **argv, struct command *acmd,
575574

576575
if (!strncmp((char *)ctrl.mn, AMZN_NVME_LOCAL_STORAGE_PREFIX,
577576
strlen(AMZN_NVME_LOCAL_STORAGE_PREFIX))) {
578-
local_storage = true;
579577
if (nvme_get_nsid(hdl, &nsid) < 0) {
580578
struct nvme_id_ctrl test_ctrl;
581579

@@ -591,13 +589,6 @@ static int get_stats(int argc, char **argv, struct command *acmd,
591589
len = sizeof(log.base);
592590
}
593591

594-
if (interval > 0 && !local_storage) {
595-
fprintf(stderr, "[ERROR] %s: Interval polling is only supported for local storage devices\n",
596-
__func__);
597-
rc = -EINVAL;
598-
goto done;
599-
}
600-
601592
nvme_init_get_log(&cmd, nsid, AMZN_NVME_STATS_LOGPAGE_ID, NVME_CSI_NVM,
602593
&log, len);
603594
rc = nvme_get_log(hdl, &cmd, false, NVME_LOG_PAGE_PDU_SIZE);

0 commit comments

Comments
 (0)