From: Erwan Velu Date: Sun, 17 Oct 2021 20:00:02 +0000 (+0200) Subject: t/one-core-peak: Don't report errors if missing NVME features X-Git-Tag: fio-3.29~49^2 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=1122c303e582cb5385df35358b71d33dbac8fe52;hp=dd1f1ba00c9efb056dcc26894b608ca1214ddf03;p=fio.git t/one-core-peak: Don't report errors if missing NVME features Some NVMEs doesn't support some features, an error message is reported like in the following example : NVMe status: INVALID_FIELD: A reserved coded value or an unsupported value in a defined field(0x4002) nvme2n1: Temp:26 C, Autonomous Power State Transition:, PowerState:0, Completion Queues:135, Submission Queues:135 This commit will only report features if available : nvme2n1: Completion Queues:135, Submission Queues:135, PowerState:0, Temp:27 C Signed-off-by: Erwan Velu --- diff --git a/t/one-core-peak.sh b/t/one-core-peak.sh index 08cffcd4..9da8304e 100755 --- a/t/one-core-peak.sh +++ b/t/one-core-peak.sh @@ -199,12 +199,18 @@ show_nvme() { info ${device_name} "MODEL=${model} FW=${fw} serial=${serial} PCI=${pci_addr}@${link_speed} IRQ=${irq} NUMA=${numa} CPUS=${cpus} " which nvme &> /dev/null if [ $? -eq 0 ]; then - NCQA=$(nvme get-feature -H -f 0x7 ${device} |grep NCQA |cut -d ':' -f 2 | xargs) - NSQA=$(nvme get-feature -H -f 0x7 ${device} |grep NSQA |cut -d ':' -f 2 | xargs) - power_state=$(nvme get-feature -H -f 0x2 ${device} | grep PS |cut -d ":" -f 2 | xargs) - apste=$(nvme get-feature -H -f 0xc ${device} | grep APSTE |cut -d ":" -f 2 | xargs) - temp=$(nvme smart-log ${device} |grep 'temperature' |cut -d ':' -f 2 |xargs) - info ${device_name} "Temp:${temp}, Autonomous Power State Transition:${apste}, PowerState:${power_state}, Completion Queues:${NCQA}, Submission Queues:${NSQA}" + status="" + NCQA=$(nvme get-feature -H -f 0x7 ${device} 2>&1 |grep NCQA |cut -d ':' -f 2 | xargs) + [ -n "${NCQA}" ] && status="${status}Completion Queues:${NCQA}, " + NSQA=$(nvme get-feature -H -f 0x7 ${device} 2>&1 |grep NSQA |cut -d ':' -f 2 | xargs) + [ -n "${NSQA}" ] && status="${status}Submission Queues:${NSQA}, " + power_state=$(nvme get-feature -H -f 0x2 ${device} 2>&1 | grep PS |cut -d ":" -f 2 | xargs) + [ -n "${power_state}" ] && status="${status}PowerState:${power_state}, " + apste=$(nvme get-feature -H -f 0xc ${device} 2>&1 | grep APSTE |cut -d ":" -f 2 | xargs) + [ -n "${apste}" ] && status="${status} Autonomous Power State Transition:${apste}, " + temp=$(nvme smart-log ${device} 2>&1 |grep 'temperature' |cut -d ':' -f 2 |xargs) + [ -n "${temp}" ] && status="${status}Temp:${temp}" + info ${device_name} "${status}" fi }