Skip to content

Commit 26302ea

Browse files
awz1234igaw
authored andcommitted
plugins/amzn: Enable namespace metrics for EC2 local storage
This patch enables namespace metrics for EC2 local storage. Signed-off-by: Zhen Wang <[email protected]>
1 parent de1517d commit 26302ea

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

plugins/amzn/amzn-nvme.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,10 +515,15 @@ static int get_stats(int argc, char **argv, struct command *cmd,
515515
};
516516

517517
if (!strncmp((char *)ctrl.mn, AMZN_NVME_LOCAL_STORAGE_PREFIX,
518-
strlen(AMZN_NVME_LOCAL_STORAGE_PREFIX)))
518+
strlen(AMZN_NVME_LOCAL_STORAGE_PREFIX))) {
519+
if (nvme_get_nsid(dev_fd(dev), &args.nsid) < 0) {
520+
rc = -errno;
521+
goto done;
522+
}
519523
args.len = sizeof(log);
520-
else
524+
} else {
521525
args.len = sizeof(log.base);
526+
}
522527

523528
rc = nvme_get_log(&args);
524529
if (rc != 0) {

0 commit comments

Comments
 (0)