From: Erwan Velu Date: Fri, 1 Oct 2021 19:43:07 +0000 (+0200) Subject: t/one-core-peak: nvme-cli as optional tooling X-Git-Tag: fio-3.29~81^2 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=22bb358e5b2d94db1267cb337864fafc1403dc77;p=fio.git t/one-core-peak: nvme-cli as optional tooling Not all systems has nvme-cli installed. If present then let's print additional low-level info, If not, let's ignore and continue. Signed-off-by: Erwan Velu --- diff --git a/t/one-core-peak.sh b/t/one-core-peak.sh index fda870ab..d0649d2e 100755 --- a/t/one-core-peak.sh +++ b/t/one-core-peak.sh @@ -198,12 +198,15 @@ show_nvme() { fw=$(cat ${device_dir}/firmware_rev | xargs) #xargs for trimming spaces serial=$(cat ${device_dir}/serial | xargs) #xargs for trimming spaces info ${device_name} "MODEL=${model} FW=${fw} serial=${serial} PCI=${pci_addr}@${link_speed} IRQ=${irq} NUMA=${numa} CPUS=${cpus} " - 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}" + 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}" + fi } show_device() { @@ -249,7 +252,7 @@ show_system() { ### MAIN check_args ${args} check_root -check_binary t/io_uring lscpu grep taskset cpupower awk tr xargs dmidecode nvme +check_binary t/io_uring lscpu grep taskset cpupower awk tr xargs dmidecode detect_first_core info "##################################################"