提交 f77868bf 编写于 作者: Y yama

fio_perf: update fio version and fix python3 string issue

The previous fio version is too old and cann't be compiled.
Signed-off-by: Nyama <yama@redhat.com>
上级 1b06df60
...@@ -11,12 +11,12 @@ ...@@ -11,12 +11,12 @@
kvm_ver_chk_cmd = "rpm -q qemu-kvm-rhev || rpm -q qemu-kvm" kvm_ver_chk_cmd = "rpm -q qemu-kvm-rhev || rpm -q qemu-kvm"
Linux: Linux:
no ide no ide
pattern = ".*[read|write].*bw=(\d+(?:\.\d+)?[\w|\s]B/s),\siops=(\d+).*" pattern = ".*[read|write].*IOPS=(\d+(?:\.\d+)?[\w|\s]),\sBW=(\d+(?:\.\d+)?[\w|\s]*B/s)"
order_list = "Block_size Iodepth Threads BW(MB/S) IOPS Latency(ms) Host_CPU BW/CPU KVM_Exits Util%" order_list = "Block_size Iodepth Threads BW(MB/S) IOPS Latency(ms) Host_CPU BW/CPU KVM_Exits Util%"
guest_ver_cmd = "uname -r" guest_ver_cmd = "uname -r"
check_install_fio = "which fio" check_install_fio = "which fio"
tarball = "performance/fio-2.2.9.tar.gz" tarball = "performance/fio-3.11.tar.gz"
fio_path = "/tmp/fio-2.2.9" fio_path = "/tmp/fio-3.11"
compile_cmd = "make && make install" compile_cmd = "make && make install"
pre_cmd = "i=`/bin/ls /dev/[vs]db` && mkfs.xfs $i > /dev/null; partprobe; umount /mnt; mount $i /mnt" pre_cmd = "i=`/bin/ls /dev/[vs]db` && mkfs.xfs $i > /dev/null; partprobe; umount /mnt; mount $i /mnt"
ppc64, ppc64le: ppc64, ppc64le:
......
...@@ -7,7 +7,7 @@ import logging ...@@ -7,7 +7,7 @@ import logging
from avocado.utils import process from avocado.utils import process
from virttest import utils_misc, utils_test from virttest import utils_misc, utils_test, utils_numeric
from virttest import data_dir from virttest import data_dir
...@@ -248,20 +248,25 @@ def run(test, params, env): ...@@ -248,20 +248,25 @@ def run(test, params, env):
io_exits_a = int(process.system_output("cat /sys/kernel/debug/kvm/exits")) io_exits_a = int(process.system_output("cat /sys/kernel/debug/kvm/exits"))
vm.copy_files_from(guest_result_file, data_dir.get_tmp_dir()) vm.copy_files_from(guest_result_file, data_dir.get_tmp_dir())
fio_result_file = os.path.join(data_dir.get_tmp_dir(), "fio_result") fio_result_file = os.path.join(data_dir.get_tmp_dir(), "fio_result")
o = process.system_output("egrep '(read|write)' %s" % fio_result_file) o = process.system_output("egrep '(read|write)' %s" %
fio_result_file).decode()
results = re.findall(pattern, o) results = re.findall(pattern, o)
o = process.system_output("egrep 'lat' %s" % fio_result_file) o = process.system_output("egrep 'lat' %s" %
fio_result_file).decode()
laten = re.findall(r"\s{5}lat\s\((\wsec)\).*?avg=[\s]?(\d+(?:[\.][\d]+)?).*?", o) laten = re.findall(r"\s{5}lat\s\((\wsec)\).*?avg=[\s]?(\d+(?:[\.][\d]+)?).*?", o)
bw = float(utils_misc.normalize_data_size(results[0][0])) bw = float(utils_numeric.normalize_data_size(results[0][1]))
iops = int(results[0][1]) iops = float(utils_numeric.normalize_data_size(results[0][0],
order_magnitude="B", factor=1000))
if os_type == "linux": if os_type == "linux":
o = process.system_output("egrep 'util' %s" % fio_result_file) o = process.system_output("egrep 'util' %s" %
fio_result_file).decode()
util = float(re.findall(r".*?util=(\d+(?:[\.][\d]+))%", o)[0]) util = float(re.findall(r".*?util=(\d+(?:[\.][\d]+))%", o)[0])
lat = float(laten[0][1]) / 1000 if laten[0][0] == "usec" else float(laten[0][1]) lat = float(laten[0][1]) / 1000 if laten[0][0] == "usec" else float(laten[0][1])
if re.findall("rw", io_pattern): if re.findall("rw", io_pattern):
bw = bw + float(utils_misc.normalize_data_size(results[1][0])) bw = bw + float(utils_numeric.normalize_data_size(results[1][1]))
iops = iops + int(results[1][1]) iops = iops + float(utils_numeric.normalize_data_size(results[1][0],
order_magnitude="B", factor=1000))
lat1 = float(laten[1][1]) / 1000 if laten[1][0] == "usec" else float(laten[1][1]) lat1 = float(laten[1][1]) / 1000 if laten[1][0] == "usec" else float(laten[1][1])
lat = lat + lat1 lat = lat + lat1
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册