nvme-ocp-persistent-event-log(1)
================================

NAME
----
nvme-ocp-persistent-event-log - Send NVMe persistent event log page request,
returns result and log additional OCP-specific data

SYNOPSIS
--------
[verse]
'nvme' [<global-options>] 'ocp persistent-event-log' <device>
			[--action=<action> | -a <action>]
			[--log-len=<log-len> | -l <log-len>]
			[--raw-binary | -b]

DESCRIPTION
-----------
Retrieves the NVMe persistent event log page from an NVMe device
and provides the returned structure.

The <device> parameter is mandatory and may be either the NVMe character
device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1).

On success, the returned persistent event log structure may be returned
in one of several ways depending on the option flags; the structure may
parsed by the program and printed in a readable format or the raw buffer
may be printed to stdout for another program to parse.

OPTIONS
-------
-a <action>::
--action=<action>::
	The action the controller takes with the reporting context of the
	log. 0 (Read Log Data) reads the log of an established context.
	1 (Establish Context and Read Log Data) establishes a context, and
	fails if one is established. 2 (Release Context) releases the
	context. 3 (Establish Context and Read 512 Bytes of Header)
	establishes a context unless one is established, and reads only the
	log header. Defaults to 3. A context stays established until it is
	released with action 2. Action 3 requires ECRH support. For more
	details see the NVM Express Base Specification, Revision 2.1,
	section 5.1.12.1.14 Persistent Event (Log Page Identifier 0Dh).

-l <log-len>::
--log-len=<log-len>::
	The number of bytes of the log to read. Without it, or with 0,
	action 0 reads the Total Log Length (TLL) of the log, and action 1
	only establishes the context. Actions 2 and 3 ignore it.

-b::
--raw-binary::
	Print the raw persistent event log buffer to stdout.

include::global-options.txt[]

EXAMPLES
--------
* Establish a reporting context if needed and print the log header:
+
------------
# nvme ocp persistent-event-log /dev/nvme0
------------
+
NOTE: A context must be released using --action=2 before --action=1
can be used.

* Establish a reporting context (assumes no existing context), print the
  persistent event log page of the context in a human readable format,
  and release the context:
+
------------
# nvme ocp persistent-event-log /dev/nvme0 --action=1
# nvme ocp persistent-event-log /dev/nvme0 --action=0
# nvme ocp persistent-event-log /dev/nvme0 --action=2
------------

* Print the raw persistent event log of an established context to a
  file:
+
------------
# nvme ocp persistent-event-log /dev/nvme0 --action=0 --raw-binary > persistent_log.raw
------------
+
It is probably a bad idea to not redirect stdout when using this mode.

NVME
----
Part of the nvme-user suite
