Skip to content

Please document how the *-log command outputs are ordered #3339

@martinvonwittich

Description

@martinvonwittich

When I run a command like nvme error-log /dev/ng1n1 on my computer, I get a list of error log entries, in my case from entry 0 to entry 15:

Details
host ~ # nvme error-log /dev/ng1n1
Error Log Entries for device:ng1n1 entries:16
.................
 Entry[ 0]   
.................
error_count	: 17
sqid		: 0
cmdid		: 0x6010
status_field	: 0x2002(Invalid Field in Command: A reserved coded value or an unsupported value in a defined field)
phase_tag	: 0x1
parm_err_loc	: 0x28
lba		: 0
nsid		: 0
vs		: 0
trtype		: The transport type is not indicated or the error is not transport related.
cs		: 0
trtype_spec_info: 0
.................
 Entry[ 1]   
.................
error_count	: 0
sqid		: 0
cmdid		: 0
status_field	: 0(Successful Completion: The command completed without error)
phase_tag	: 0
parm_err_loc	: 0
lba		: 0
nsid		: 0
vs		: 0
trtype		: The transport type is not indicated or the error is not transport related.
cs		: 0
trtype_spec_info: 0
.................
 Entry[ 2]   
.................
error_count	: 0
sqid		: 0
cmdid		: 0
status_field	: 0(Successful Completion: The command completed without error)
phase_tag	: 0
parm_err_loc	: 0
lba		: 0
nsid		: 0
vs		: 0
trtype		: The transport type is not indicated or the error is not transport related.
cs		: 0
trtype_spec_info: 0
.................
 Entry[ 3]   
.................
error_count	: 0
sqid		: 0
cmdid		: 0
status_field	: 0(Successful Completion: The command completed without error)
phase_tag	: 0
parm_err_loc	: 0
lba		: 0
nsid		: 0
vs		: 0
trtype		: The transport type is not indicated or the error is not transport related.
cs		: 0
trtype_spec_info: 0
.................
 Entry[ 4]   
.................
error_count	: 0
sqid		: 0
cmdid		: 0
status_field	: 0(Successful Completion: The command completed without error)
phase_tag	: 0
parm_err_loc	: 0
lba		: 0
nsid		: 0
vs		: 0
trtype		: The transport type is not indicated or the error is not transport related.
cs		: 0
trtype_spec_info: 0
.................
 Entry[ 5]   
.................
error_count	: 0
sqid		: 0
cmdid		: 0
status_field	: 0(Successful Completion: The command completed without error)
phase_tag	: 0
parm_err_loc	: 0
lba		: 0
nsid		: 0
vs		: 0
trtype		: The transport type is not indicated or the error is not transport related.
cs		: 0
trtype_spec_info: 0
.................
 Entry[ 6]   
.................
error_count	: 0
sqid		: 0
cmdid		: 0
status_field	: 0(Successful Completion: The command completed without error)
phase_tag	: 0
parm_err_loc	: 0
lba		: 0
nsid		: 0
vs		: 0
trtype		: The transport type is not indicated or the error is not transport related.
cs		: 0
trtype_spec_info: 0
.................
 Entry[ 7]   
.................
error_count	: 0
sqid		: 0
cmdid		: 0
status_field	: 0(Successful Completion: The command completed without error)
phase_tag	: 0
parm_err_loc	: 0
lba		: 0
nsid		: 0
vs		: 0
trtype		: The transport type is not indicated or the error is not transport related.
cs		: 0
trtype_spec_info: 0
.................
 Entry[ 8]   
.................
error_count	: 0
sqid		: 0
cmdid		: 0
status_field	: 0(Successful Completion: The command completed without error)
phase_tag	: 0
parm_err_loc	: 0
lba		: 0
nsid		: 0
vs		: 0
trtype		: The transport type is not indicated or the error is not transport related.
cs		: 0
trtype_spec_info: 0
.................
 Entry[ 9]   
.................
error_count	: 0
sqid		: 0
cmdid		: 0
status_field	: 0(Successful Completion: The command completed without error)
phase_tag	: 0
parm_err_loc	: 0
lba		: 0
nsid		: 0
vs		: 0
trtype		: The transport type is not indicated or the error is not transport related.
cs		: 0
trtype_spec_info: 0
.................
 Entry[10]   
.................
error_count	: 0
sqid		: 0
cmdid		: 0
status_field	: 0(Successful Completion: The command completed without error)
phase_tag	: 0
parm_err_loc	: 0
lba		: 0
nsid		: 0
vs		: 0
trtype		: The transport type is not indicated or the error is not transport related.
cs		: 0
trtype_spec_info: 0
.................
 Entry[11]   
.................
error_count	: 0
sqid		: 0
cmdid		: 0
status_field	: 0(Successful Completion: The command completed without error)
phase_tag	: 0
parm_err_loc	: 0
lba		: 0
nsid		: 0
vs		: 0
trtype		: The transport type is not indicated or the error is not transport related.
cs		: 0
trtype_spec_info: 0
.................
 Entry[12]   
.................
error_count	: 0
sqid		: 0
cmdid		: 0
status_field	: 0(Successful Completion: The command completed without error)
phase_tag	: 0
parm_err_loc	: 0
lba		: 0
nsid		: 0
vs		: 0
trtype		: The transport type is not indicated or the error is not transport related.
cs		: 0
trtype_spec_info: 0
.................
 Entry[13]   
.................
error_count	: 0
sqid		: 0
cmdid		: 0
status_field	: 0(Successful Completion: The command completed without error)
phase_tag	: 0
parm_err_loc	: 0
lba		: 0
nsid		: 0
vs		: 0
trtype		: The transport type is not indicated or the error is not transport related.
cs		: 0
trtype_spec_info: 0
.................
 Entry[14]   
.................
error_count	: 0
sqid		: 0
cmdid		: 0
status_field	: 0(Successful Completion: The command completed without error)
phase_tag	: 0
parm_err_loc	: 0
lba		: 0
nsid		: 0
vs		: 0
trtype		: The transport type is not indicated or the error is not transport related.
cs		: 0
trtype_spec_info: 0
.................
 Entry[15]   
.................
error_count	: 0
sqid		: 0
cmdid		: 0
status_field	: 0(Successful Completion: The command completed without error)
phase_tag	: 0
parm_err_loc	: 0
lba		: 0
nsid		: 0
vs		: 0
trtype		: The transport type is not indicated or the error is not transport related.
cs		: 0
trtype_spec_info: 0
.................

Unfortunately, the log entries don't seem to contain timestamps, and I can't find any documentation about the order, so I was confused if the most recent entry is entry 0, or entry 15. https://github.com/linux-nvme/nvme-cli/blob/master/Documentation/nvme-error-log.txt didn't give me any hint.

In the end I had to look it up in the NVMe specification: https://nvmexpress.org/wp-content/uploads/NVM-Express-Base-Specification-Revision-2.3-2025.08.01-Ratified.pdf

5.2.12.1.2 Error Information (Log Page Identifier 01h)
This error log may return the last n errors. If the host specifies a data transfer of the size of n error logs,
then the error logs for the most recent n errors are returned. The ordering of the entries is based on the
time when the error occurred, with the most recent error being returned as the first log entry.

I think it would be helpful if this would be documented :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions