Skip to content

Commit b048af7

Browse files
swapnansamigaw
authored andcommitted
micron: add smart-log and id-ctrl commands
Add smart-log command to retrieve SMART/Health log with vendor-specific OLEC and IPM fields. Add id-ctrl command to display Identify Controller with vendor-specific PMS, IPMSR, and MSMT fields. Signed-off-by: Swapna Samoju <[email protected]>
1 parent 82f2aad commit b048af7

8 files changed

Lines changed: 454 additions & 1 deletion

File tree

Documentation/cmd-plugins.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ linknvme:nvme-micron-smart-add-log[1]::
4646
linknvme:nvme-micron-temperature-stats[1]::
4747
Retrieves temperature information of given micron device
4848

49+
linknvme:nvme-micron-smart-log[1]::
50+
Retrieve SMART/Health log with Micron vendor-specific fields
51+
52+
linknvme:nvme-micron-id-ctrl[1]::
53+
Send NVMe Identify Controller with Micron vendor-specific fields
54+
4955
linknvme:nvme-ocp-internal-log[1]::
5056
Retrieves and parses OCP Telemetry DA1 and DA2 logs.
5157

Documentation/meson.build

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,13 @@ adoc_sources = [
7777
'nvme-lockdown',
7878
'nvme-mi-cmd-support-effects-log',
7979
'nvme-micron-clear-pcie-errors',
80+
'nvme-micron-id-ctrl',
8081
'nvme-micron-internal-log',
8182
'nvme-micron-nand-stats',
8283
'nvme-micron-pcie-stats',
8384
'nvme-micron-selective-download',
8485
'nvme-micron-smart-add-log',
86+
'nvme-micron-smart-log',
8587
'nvme-micron-temperature-stats',
8688
'nvme-netapp-ontapdevices',
8789
'nvme-netapp-smdevices',
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
nvme-micron-id-ctrl(1)
2+
======================
3+
4+
NAME
5+
----
6+
nvme-micron-id-ctrl - Send NVMe Identify Controller with Micron vendor-specific fields
7+
8+
SYNOPSIS
9+
--------
10+
[verse]
11+
'nvme micron id-ctrl' <device> [--output-format=<fmt> | -o <fmt>]
12+
13+
DESCRIPTION
14+
-----------
15+
For the NVMe device given, sends an identify controller command and
16+
provides the result with Micron vendor-specific fields decoded.
17+
18+
The <device> parameter is mandatory and may be either the NVMe character
19+
device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1).
20+
21+
This command extends the standard Identify Controller output with
22+
Micron-specific fields:
23+
24+
PMS (Power Measurement Support)::
25+
Bit 21 of CTRATT (Controller Attributes).
26+
Indicates whether the controller supports power measurement.
27+
28+
IPMSR (Interval Power Measurement Sample Rate)::
29+
Located at bytes 392-393 in the Identify Controller reserved area.
30+
Specifies the sample rate for interval power measurement.
31+
32+
MSMT (Maximum Stop Measurement Time)::
33+
Located at bytes 394-395 in the Identify Controller reserved area.
34+
Specifies the maximum time to stop power measurement.
35+
36+
OPTIONS
37+
-------
38+
-o <fmt>::
39+
--output-format=<fmt>::
40+
Set the reporting format to 'normal' or 'json'.
41+
Default is 'normal'.
42+
43+
EXAMPLES
44+
--------
45+
* Display Identify Controller in human-readable format:
46+
+
47+
------------
48+
# nvme micron id-ctrl /dev/nvme0
49+
------------
50+
51+
* Display Identify Controller in JSON format:
52+
+
53+
------------
54+
# nvme micron id-ctrl /dev/nvme0 -o json
55+
------------
56+
57+
NVME
58+
----
59+
Part of the nvme-user suite
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
nvme-micron-smart-log(1)
2+
========================
3+
4+
NAME
5+
----
6+
nvme-micron-smart-log - Retrieve SMART/Health log with Micron vendor-specific fields
7+
8+
SYNOPSIS
9+
--------
10+
[verse]
11+
'nvme micron smart-log' <device> [--output-format=<fmt> | -o <fmt>]
12+
13+
DESCRIPTION
14+
-----------
15+
For the NVMe device given, retrieves the SMART/Health Information log page
16+
and displays it with Micron vendor-specific fields decoded.
17+
18+
The <device> parameter is mandatory and may be either the NVMe character
19+
device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1).
20+
21+
This command extends the standard SMART log with Micron-specific fields:
22+
23+
OLEC (Operational Lifetime Energy Consumed)::
24+
Located at bytes 232-239 in the SMART log reserved area.
25+
Reports cumulative energy consumed by the device.
26+
27+
IPM (Interval Power Measurement)::
28+
Located at bytes 240-243 in the SMART log reserved area.
29+
Reports power measurement over sampling interval.
30+
31+
OPTIONS
32+
-------
33+
-o <fmt>::
34+
--output-format=<fmt>::
35+
Set the reporting format to 'normal' or 'json'.
36+
Default is 'normal'.
37+
38+
EXAMPLES
39+
--------
40+
* Display SMART log in human-readable format:
41+
+
42+
------------
43+
# nvme micron smart-log /dev/nvme0
44+
------------
45+
46+
* Display SMART log in JSON format:
47+
+
48+
------------
49+
# nvme micron smart-log /dev/nvme0 -o json
50+
------------
51+
52+
NVME
53+
----
54+
Part of the nvme-user suite

completions/_nvme

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2972,6 +2972,8 @@ _nvme () {
29722972
clear-fw-activate-history':Clear FW activation history'
29732973
vs-smbus-option':Enable/Disable SMBUS on the drive'
29742974
ocp-telemetry-log-parse':Parse OCP Telemetry DA1 and DA2 logs'
2975+
smart-log':Retrieve SMART/Health log with Micron vendor-specific fields'
2976+
id-ctrl':Identify Controller with Micron vendor-specific fields'
29752977
help':Display this help'
29762978
)
29772979
_arguments '*:: :->subcmds'

completions/bash-nvme-completion.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1713,7 +1713,8 @@ _nvme_subcmds () {
17131713
vs-drive-info plugin-version cloud-SSD-plugin-version \
17141714
log-page-directory vs-fw-activate-history \
17151715
vs-error-reason-identifier vs-smart-add-log \
1716-
clear-fw-activate-history vs-smbus-option ocp-telemetry-log-parse"
1716+
clear-fw-activate-history vs-smbus-option ocp-telemetry-log-parse \
1717+
smart-log id-ctrl"
17171718
[seagate]="vs-temperature-stats vs-log-page-sup \
17181719
vs-smart-add-log vs-pcie-stats clear-pcie-correctable-errors \
17191720
get-host-tele get-ctrl-tele vs-internal-log \

0 commit comments

Comments
 (0)