Skip to content

Commit

Permalink
plugins/micron: Move OCP internal log parsing from Micron to OCP Plugin.
Browse files Browse the repository at this point in the history
Move OCP internal log parsing from Micron to OCP Plugin. Previous
PR #2354. Datacenter
NVMe SSD Specification v2.5r9, section 4.9.

Signed-off-by: Chaithanya shoba <[email protected]>
  • Loading branch information
Chaithanya shoba authored and saskchaithanya committed Jul 17, 2024
1 parent 5746db3 commit 5fd7f96
Show file tree
Hide file tree
Showing 17 changed files with 2,640 additions and 2,478 deletions.
4 changes: 2 additions & 2 deletions Documentation/cmd-plugins.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ linknvme:nvme-micron-smart-add-log[1]::
linknvme:nvme-micron-temperature-stats[1]::
Retrieves temperature information of given micron device

linknvme:nvme-micron-ocp-telemetry-log-parse[1]::
Parse OCP Telemetry DA1 and DA2 logs.
linknvme:nvme-ocp-internal-log[1]::
Retrieves and parses OCP Telemetry DA1 and DA2 logs.

linknvme:nvme-netapp-ontapdevices[1]::
Display information about ONTAP devices
Expand Down
2 changes: 1 addition & 1 deletion Documentation/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ adoc_sources = [
'nvme-micron-selective-download',
'nvme-micron-smart-add-log',
'nvme-micron-temperature-stats',
'nvme-micron-ocp-telemetry-log-parse',
'nvme-netapp-ontapdevices',
'nvme-netapp-smdevices',
'nvme-ns-descs',
Expand All @@ -105,6 +104,7 @@ adoc_sources = [
'nvme-ocp-smart-add-log',
'nvme-ocp-telemetry-string-log-page',
'nvme-ocp-unsupported-reqs-log-pages',
'nvme-ocp-internal-log',
'nvme-persistent-event-log',
'nvme-pred-lat-event-agg-log',
'nvme-predictable-lat-log',
Expand Down
88 changes: 0 additions & 88 deletions Documentation/nvme-micron-ocp-telemetry-log-parse.txt

This file was deleted.

109 changes: 109 additions & 0 deletions Documentation/nvme-ocp-internal-log.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
nvme-ocp-internal-log(1)
========================

NAME
----
nvme-ocp-internal-log - Conditionally retrieves 07h Telemetry Host-Initiated
log, C9h OCP Strings Log from an NVMe device or from user-specified file path.
Takes retrieved logs and decodes into human-readable output format specified by
user.

SYNOPSIS
--------
[verse]
'nvme ocp internal-log' <device>
[--telemetry-log=<file> | -l <file>]
[--string-log=<file> | -s <file>]
[--output-file=<file> | -o <file>]
[--output-format=<fmt> | -f <fmt>]
[--data-area=<da> | -a <da>]
[--telemetry-type=<type> | -t <type>]

DESCRIPTION
-----------
Conditionally retrieves 07h Telemetry Host-Initiated log, C9h OCP Strings Log
from an NVMe device or from user-specified file path. Takes retrieved logs and
decodes (or) parses into human-readable output format specified by user.

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

This will only work on OCP compliant devices supporting this feature.
Results for any other device are undefined.

On success it returns 0, error code otherwise.

OPTIONS
-------
-l <file>::
--telemetry-log=<file>::
File name to existing Telemetry Host-Initiated raw binary data to be used.
If no path is specified, a live retrieval of payload on <device> will be
performed.

-s <file>::
--string-log=<file>::
File name to existing OCP String Log raw binary data to be used. If no path
is specified, a live retrieval of payload on <device> will be
performed.

-o <file>::
--output-file=<file>::
Filepath name to where human-readable output data will be saved to.

-f <fmt>::
--output-format=<fmt>::
Set the reporting format to 'normal', 'json'. Only one output format can be
used at a time, the default value is 'json'.

-a <da>::
--data-area=<da>::
Retrieves the specific data area requested. Valid inputs are 1,2. If this
option is not specified, the default value is 1.

-t <type>::
--telemetry-type=<type>::
If set to 1, controller shall capture the Telemetry Host-Initiated data
representing the internal state of the controller at the time the associated
Get Log Page command is processed. If cleared to 0, controller shall not
update this data.

EXAMPLES
--------

* Retrieve in both OCP String Log and Telemetry Host-Initiated Log from
device. Decode default data-area(s) in default format and output to console.
+
----------------------------------
# nvme ocp internal-log /dev/nvme0
----------------------------------

* Retrieve Telemetry Host-Initiated data, reads in the OCP String Log locally.
Decode default data-area(s) in default format.
+
--------------------------------------------------------------------
# nvme ocp internal-log /dev/nvme0 --string-log=ocp_string_log.bin
--output-file=output_file.json
--------------------------------------------------------------------

* Retrieve OCP String Log, reads in the Telemetry Host-Initiated Log locally.
Decode data-areas 1 and 2, and output in json format.
+
---------------------------------------------------------------------
# nvme ocp internal-log /dev/nvme0 --telemetry-log=host_telemetry.bin
--output-format=json --output-file=output_file.json --data-area=2
---------------------------------------------------------------------

* Reads in both OCP String Log and Telemetry Host-Initiated Log locally.
Decode data-areas 1 and 2, and output in normal text format.
+
------------------------------------------------------------------
# nvme ocp internal-log /dev/nvme0 --string-log=ocp_string_log.bin
--telemetry-log=host_telemetry.bin --output-format=normal
--output-file=output_file.txt --data-area=2
------------------------------------------------------------------

NVME
----
Part of the nvme-user suite
37 changes: 10 additions & 27 deletions completions/_nvme
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,18 @@ _nvme () {
local _internal_log
_internal_log=(
/dev/nvme':supply a device to use (required)'
--telemetry_type=':Telemetry Type; host (Create bit) or controller'
-t':alias for --telemetry_type'
--telemetry_data_area=':Telemetry Data Area; 1 or 3'
-a':alias for --telemetry_data_area'
--telemetry-type=':Telemetry Type; host or controller generated'
-t':alias for --telemetry-type'
--data-area=':Telemetry Data Area; 1 or 2'
-a':alias for --data-area'
--output-file=':Output file name with path'
-o':alias for --output-file'
--telemetry-log=':Telemetry log binary'
-l':alias for --telemetry-log'
--string-log=':String log binary'
-s':alias for --string-log'
--output-format':Output format: normal|json'
-f':alias for --output-format'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme ocp internal-log options" _internal_log
Expand Down Expand Up @@ -532,29 +538,6 @@ _nvme () {
(*)
_files
;;
esac
;;
(micron)
case ${words[2]} in
(ocp-telemetry-log-parse)
local _ocp-telemetry-log-parse
_ocp-telemetry-log-parse=(
/dev/nvme':supply a device to use (required)'
--output-file=':Output file name with path'
-o':alias for --output-file'
--telemetry-log=':Telemetry log binary'
-l':alias for --telemetry-log'
--string-log=':String log binary'
-s':alias for --string-log'
--format':Output format: normal|json'
-f':alias for --format'
)
_arguments '*:: :->subcmds'
_describe -t commands "nvme micron ocp-telemetry-log-parse" _ocp-telemetry-log-parse
;;
(*)
_files
;;
esac
return
else
Expand Down
9 changes: 3 additions & 6 deletions completions/bash-nvme-completion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -889,10 +889,6 @@ plugin_micron_opts () {
"vs-smbus-option")
opts+=" --option= -o --value= -v --save= -s"
;;
"ocp-telemetry-log-parse")
opts+=" --format= -f --telemetry-log= -l --string-log= -s \
--output-file= -o"
;;
"help")
opts+=$NO_OPTS
;;
Expand Down Expand Up @@ -1448,8 +1444,9 @@ plugin_ocp_opts () {
--latency_monitor_feature_enable= -e"
;;
"internal-log")
opts+=" --telemetry_type= -t --telemetry_data_area= -a \
--output-file= -o"
opts+=" --telemetry-log= -l --string-log= -s \
--output-file= -o --output-format= -f \
--data-area= -a --telemetry-type= -t"
;;
"clear-fw-activate-history")
opts+=" --no-uuid -n"
Expand Down
2 changes: 0 additions & 2 deletions plugins/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ if json_c_dep.found()
'plugins/inspur/inspur-nvme.c',
'plugins/intel/intel-nvme.c',
'plugins/memblaze/memblaze-nvme.c',
'plugins/micron/micron-utils.c',
'plugins/micron/micron-ocp-telemetry.c',
'plugins/micron/micron-nvme.c',
'plugins/nbft/nbft-plugin.c',
'plugins/netapp/netapp-nvme.c',
Expand Down
Loading

0 comments on commit 5fd7f96

Please sign in to comment.