]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme-cli: Add lsi option for get-log command
authorTokunori Ikegami <ikegami.t@gmail.com>
Tue, 27 Oct 2020 14:56:43 +0000 (23:56 +0900)
committerKeith Busch <kbusch@kernel.org>
Tue, 25 May 2021 14:00:52 +0000 (08:00 -0600)
Previously lsi is set as 0 as hard coded value by the get-log command.
To set this parameter by the command add lsi option for the command.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
Documentation/nvme-get-log.1
Documentation/nvme-get-log.html
Documentation/nvme-get-log.txt
nvme.c

index 98f81a8fcc4dda24d8dcb83d60258017ceb276b4..3bb802a413a111012fdf0d7e5580d8f99be37409 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: nvme-get-log
 .\"    Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
-.\"      Date: 10/20/2020
+.\"      Date: 01/13/2021
 .\"    Manual: NVMe Manual
 .\"    Source: NVMe
 .\"  Language: English
 .\"
-.TH "NVME\-GET\-LOG" "1" "10/20/2020" "NVMe" "NVMe Manual"
+.TH "NVME\-GET\-LOG" "1" "01/13/2021" "NVMe" "NVMe Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -39,6 +39,7 @@ nvme-get-log \- Retrieves a log page from an NVMe device
                       [\-\-raw\-binary | \-b]
                       [\-\-lpo=<offset> | \-o <offset>]
                       [\-\-lsp=<field> | \-s <field>]
+                      [\-\-lsi=<field> | \-S <field>]
                       [\-\-rae | \-r]
 .fi
 .SH "DESCRIPTION"
@@ -85,6 +86,11 @@ The log page offset specifies the location within a log page to start returning
 The log specified field of LID\&.
 .RE
 .PP
+\-S <field>, \-\-lsi=<field>
+.RS 4
+The log specified field of Log Specific Identifier\&.
+.RE
+.PP
 \-r, \-\-rae
 .RS 4
 Retain an Asynchronous Event\&.
index 9aa20e0467b49f44eadaa501ec728e12fccef328..6244427a64077bad5e95a9744d4cd809fcc3293d 100644 (file)
@@ -4,7 +4,7 @@
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">\r
 <head>\r
 <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />\r
-<meta name="generator" content="AsciiDoc 8.6.10" />\r
+<meta name="generator" content="AsciiDoc 9.0.0rc2" />\r
 <title>nvme-get-log(1)</title>\r
 <style type="text/css">\r
 /* Shared CSS for AsciiDoc xhtml11 and html5 backends */\r
@@ -436,7 +436,7 @@ thead, p.table.header {
 p.table {\r
   margin-top: 0;\r
 }\r
-/* Because the table frame attribute is overriden by CSS in most browsers. */\r
+/* Because the table frame attribute is overridden by CSS in most browsers. */\r
 div.tableblock > table[frame="void"] {\r
   border-style: none;\r
 }\r
@@ -756,6 +756,7 @@ nvme-get-log(1) Manual Page
                       [--raw-binary | -b]\r
                       [--lpo=&lt;offset&gt; | -o &lt;offset&gt;]\r
                       [--lsp=&lt;field&gt; | -s &lt;field&gt;]\r
+                      [--lsi=&lt;field&gt; | -S &lt;field&gt;]\r
                       [--rae | -r]</pre>\r
 <div class="attribution">\r
 </div></div>\r
@@ -864,6 +865,17 @@ program to parse.</p></div>
 </p>\r
 </dd>\r
 <dt class="hdlist1">\r
+-S &lt;field&gt;\r
+</dt>\r
+<dt class="hdlist1">\r
+--lsi=&lt;field&gt;\r
+</dt>\r
+<dd>\r
+<p>\r
+        The log specified field of Log Specific Identifier.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
 -r\r
 </dt>\r
 <dt class="hdlist1">\r
@@ -918,7 +930,7 @@ Have the program return the raw log page in binary:
 <div id="footer">\r
 <div id="footer-text">\r
 Last updated\r
- 2019-09-18 00:00:58 JST\r
+ 2021-01-13 23:17:32 JST\r
 </div>\r
 </div>\r
 </body>\r
index 1d49e283218662828d0d4785c89a2976c410f5b3..d2b2495c456061f412d88f41c579ec4d7a63787d 100644 (file)
@@ -15,6 +15,7 @@ SYNOPSIS
                      [--raw-binary | -b]
                      [--lpo=<offset> | -o <offset>]
                      [--lsp=<field> | -s <field>]
+                     [--lsi=<field> | -S <field>]
                      [--rae | -r]
 
 DESCRIPTION
@@ -68,6 +69,10 @@ OPTIONS
 --lsp=<field>::
        The log specified field of LID.
 
+-S <field>::
+--lsi=<field>::
+       The log specified field of Log Specific Identifier.
+
 -r::
 --rae::
        Retain an Asynchronous Event.
diff --git a/nvme.c b/nvme.c
index cc854fda82e37642aeb5a8466475669a2e1cb381..3a672e869c30f0842a997941d29ec6097579ff86 100644 (file)
--- a/nvme.c
+++ b/nvme.c
@@ -1231,12 +1231,14 @@ static int get_log(int argc, char **argv, struct command *cmd, struct plugin *pl
        const char *aen = "result of the aen, use to override log id";
        const char *lsp = "log specific field";
        const char *lpo = "log page offset specifies the location within a log page from where to start returning data";
+       const char *lsi = "log specific identifier specifies an identifier that is required for a particular log page";
        const char *rae = "retain an asynchronous event";
        const char *raw = "output in raw format";
        const char *uuid_index = "UUID index";
        int err, fd;
 
        struct config {
+               __u16 lsi;
                __u32 namespace_id;
                __u8  log_id;
                __u32 log_len;
@@ -1254,6 +1256,7 @@ static int get_log(int argc, char **argv, struct command *cmd, struct plugin *pl
                .log_len      = 0,
                .lpo          = NVME_NO_LOG_LPO,
                .lsp          = NVME_NO_LOG_LSP,
+               .lsi          = 0,
                .rae          = 0,
                .uuid_index   = 0,
        };
@@ -1265,6 +1268,7 @@ static int get_log(int argc, char **argv, struct command *cmd, struct plugin *pl
                OPT_UINT("aen",          'a', &cfg.aen,          aen),
                OPT_LONG("lpo",          'o', &cfg.lpo,          lpo),
                OPT_BYTE("lsp",          's', &cfg.lsp,          lsp),
+               OPT_SHRT("lsi",          'S', &cfg.lsi,          lsi),
                OPT_FLAG("rae",          'r', &cfg.rae,          rae),
                OPT_BYTE("uuid-index",   'U', &cfg.uuid_index,   uuid_index),
                OPT_FLAG("raw-binary",   'b', &cfg.raw_binary,   raw),
@@ -1294,7 +1298,7 @@ static int get_log(int argc, char **argv, struct command *cmd, struct plugin *pl
                }
 
                err = nvme_get_log14(fd, cfg.namespace_id, cfg.log_id,
-                                    cfg.lsp, cfg.lpo, 0, cfg.rae,
+                                    cfg.lsp, cfg.lpo, cfg.lsi, cfg.rae,
                                     cfg.uuid_index, cfg.log_len, log);
                if (!err) {
                        if (!cfg.raw_binary) {