linux-nvme / nvme-cli

NVMe management command line interface.
https://nvmexpress.org
GNU General Public License v2.0
1.45k stars 650 forks source link

plugins: Add a new DapuStor plugin and the smart-log-add command #2451

Closed xyzhang-up closed 1 month ago

xyzhang-up commented 1 month ago

Add the DapuStor plugin to support the retrieval and display of the Vendor Specific SMART logs: Additional SMART log page (0xCA) Extended Additional SMART log page (0xCB)

After the command nvme dapustor smart-log-add is executed, the information in the following format will be returned:


key                               normalized raw
program_fail_count              : 100%       0
erase_fail_count                : 100%       0
wear_leveling                   : 100%       min: 3, max: 4, avg: 3
end_to_end_error_detection_count: 100%       0
crc_error_count                 : 100%       0
timed_workload_media_wear       : 100%       0.000%
timed_workload_host_reads       : 100%       100%
timed_workload_timer            : 100%       0 min
thermal_throttle_status         : 100%       0%, cnt: 0
retry_buffer_overflow_count     : 100%       0
pll_lock_loss_count             : 100%       0
nand_bytes_written              : 100%       sectors: 835061
host_bytes_written              : 100%       sectors: 291153
system_area_life_remaining      : 100%       100
nand_bytes_read                 : 100%       241909
temperature                     : 100%       min: 294, max: 318, cur: 299
power_consumption               : 100%       min: 0, max: 3667, avg: 22
power_on_temperature            : 100%       min: 295, max: 301, cur: 299
power_loss_protection           : 100%       100
read_fail_count                 : 100%       0
thermal_throttle_time           : 100%       0
flash_error_media_count         : 100%       0
lifetime_write_amplification    : 100%       111
firmware_update_count           : 100%       1
dram_cecc_count                 : 100%       0
dram_uecc_count                 : 100%       0
xor_pass_count                  : 100%       0
xor_fail_count                  : 100%       0
xor_invoked_count               : 100%       0
inflight_read_io_cmd            : 100%       0
temp_since_born                 : 100%       min: 294, max: 318, cur: 299
temp_since_bootup               : 100%       min: 295, max: 301, cur: 299
inflight_write_io_cmd           : 100%       0
xyzhang-up commented 1 month ago

I have dealt with the errors detected by the workflow as much as possible.

there are two alerts that I think do not need to be processed:

#define CMD_INC_FILE plugins/dapustor/dapustor-nvme Macros does not need to be enclosed in parentheses here.

ENTRY("smart-log-add", "Retrieve DapuStor SMART Log, show it", dapustor_additional_smart_log) I think it is better to keep it on one line.

Besides, where should I update the maintainer information of the new files? Thank you.

igaw commented 1 month ago

checkpatch complaints need to be taken with a grain of salt. I agree with you, the long line looks nicer. Anyway, this looks in good shape. Please consider to update the tab completion and provide documentation to this new plugin. I go ahead and merge it as it is. We can improve it in the tree. Thanks!