Changeset View
Changeset View
Standalone View
Standalone View
sbin/nvmecontrol/logpage.c
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | |||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <string.h> | #include <string.h> | ||||
#include <unistd.h> | #include <unistd.h> | ||||
#include <sys/endian.h> | #include <sys/endian.h> | ||||
#include "nvmecontrol.h" | #include "nvmecontrol.h" | ||||
#define LOGPAGE_USAGE \ | #define LOGPAGE_USAGE \ | ||||
"logpage <-p page_id> [-b] [-v vendor] [-x] <controller id|namespace id>\n" \ | "logpage <-p page_id> [-b] [-v vendor] [-x] <controller id|namespace id>\n" | ||||
#define LOGPAGE_ARGS \ | |||||
"<controller id|namespace id>" | |||||
#define LOGPAGE_DESCR \ | |||||
"Print logpages in human-readable form" | |||||
#define MAX_FW_SLOTS (7) | #define MAX_FW_SLOTS (7) | ||||
static SLIST_HEAD(,logpage_function) logpages; | static SLIST_HEAD(,logpage_function) logpages; | ||||
void | void | ||||
logpage_register(struct logpage_function *p) | logpage_register(struct logpage_function *p) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 405 Lines • ▼ Show 20 Lines | logpage(const struct nvme_function *nf, int argc, char *argv[]) | ||||
buf = get_log_buffer(size); | buf = get_log_buffer(size); | ||||
read_logpage(fd, log_page, nsid, buf, size); | read_logpage(fd, log_page, nsid, buf, size); | ||||
print_fn(&cdata, buf, size); | print_fn(&cdata, buf, size); | ||||
close(fd); | close(fd); | ||||
exit(0); | exit(0); | ||||
} | } | ||||
NVME_COMMAND(top, logpage, logpage, LOGPAGE_USAGE); | NVME_COMMAND(top, logpage, logpage, LOGPAGE_USAGE, LOGPAGE_ARGS, LOGPAGE_DESCR); |