Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
tp-qemu
提交
271c8dbb
T
tp-qemu
项目概览
openeuler
/
tp-qemu
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
tp-qemu
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
271c8dbb
编写于
3月 16, 2014
作者:
Amos_沧海桑田
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #34 from kongove/master
perf: fix netperf testcase
上级
8faeab5e
ff11f256
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
53 addition
and
20 deletion
+53
-20
generic/tests/cfg/netperf.cfg
generic/tests/cfg/netperf.cfg
+1
-1
generic/tests/netperf.py
generic/tests/netperf.py
+52
-19
未找到文件。
generic/tests/cfg/netperf.cfg
浏览文件 @
271c8dbb
...
@@ -50,7 +50,7 @@
...
@@ -50,7 +50,7 @@
os_type_host = linux
os_type_host = linux
shell_prompt_host = \[root@.{0,50}][\#\$]
shell_prompt_host = \[root@.{0,50}][\#\$]
#Test base env configration
#Test base env configration
ver_cmd = rpm -q
a |grep
kvm
ver_cmd = rpm -q
qemu-
kvm
netperf_version = 2.6.0
netperf_version = 2.6.0
netperf_download_link = ftp://ftp.netperf.org/netperf/netperf-2.6.0.tar.bz2
netperf_download_link = ftp://ftp.netperf.org/netperf/netperf-2.6.0.tar.bz2
pkg_md5sum = 9654ffdfd4c4f2c93ce3733cd9ed9236
pkg_md5sum = 9654ffdfd4c4f2c93ce3733cd9ed9236
...
...
generic/tests/netperf.py
浏览文件 @
271c8dbb
...
@@ -6,7 +6,7 @@ import re
...
@@ -6,7 +6,7 @@ import re
import
time
import
time
from
autotest.client
import
utils
from
autotest.client
import
utils
from
autotest.client.shared
import
error
from
autotest.client.shared
import
error
from
virttest
import
utils_test
,
utils_misc
,
remote
,
data_dir
from
virttest
import
utils_test
,
utils_misc
,
utils_net
,
remote
,
data_dir
def
format_result
(
result
,
base
=
"12"
,
fbase
=
"2"
):
def
format_result
(
result
,
base
=
"12"
,
fbase
=
"2"
):
...
@@ -109,6 +109,15 @@ def run(test, params, env):
...
@@ -109,6 +109,15 @@ def run(test, params, env):
login_timeout
=
int
(
params
.
get
(
"login_timeout"
,
360
))
login_timeout
=
int
(
params
.
get
(
"login_timeout"
,
360
))
session
=
vm
.
wait_for_login
(
timeout
=
login_timeout
)
session
=
vm
.
wait_for_login
(
timeout
=
login_timeout
)
queues
=
int
(
params
.
get
(
"queues"
,
1
))
if
queues
>
1
:
if
params
.
get
(
"os_type"
)
==
"linux"
:
ethname
=
utils_net
.
get_linux_ifname
(
session
,
vm
.
get_mac_address
(
0
))
session
.
cmd_status_output
(
"ethtool -L %s combined %s"
%
(
ethname
,
queues
))
else
:
logging
.
info
(
"FIXME: support to enable MQ for Windows guest!"
)
config_cmds
=
params
.
get
(
"config_cmds"
)
config_cmds
=
params
.
get
(
"config_cmds"
)
if
config_cmds
:
if
config_cmds
:
for
config_cmd
in
config_cmds
.
split
(
","
):
for
config_cmd
in
config_cmds
.
split
(
","
):
...
@@ -140,7 +149,7 @@ def run(test, params, env):
...
@@ -140,7 +149,7 @@ def run(test, params, env):
if
len
(
params
.
get
(
"nics"
,
""
).
split
())
>
1
:
if
len
(
params
.
get
(
"nics"
,
""
).
split
())
>
1
:
vm
.
wait_for_login
(
nic_index
=
1
,
timeout
=
login_timeout
)
vm
.
wait_for_login
(
nic_index
=
1
,
timeout
=
login_timeout
)
server_ip
=
vm
.
wait_for_get_address
(
1
,
timeout
=
5
)
server_
ctl_
ip
=
vm
.
wait_for_get_address
(
1
,
timeout
=
5
)
logging
.
debug
(
commands
.
getoutput
(
"numactl --hardware"
))
logging
.
debug
(
commands
.
getoutput
(
"numactl --hardware"
))
logging
.
debug
(
commands
.
getoutput
(
"numactl --show"
))
logging
.
debug
(
commands
.
getoutput
(
"numactl --show"
))
...
@@ -263,8 +272,13 @@ def start_test(server, server_ctl, host, clients, resultsdir, l=60,
...
@@ -263,8 +272,13 @@ def start_test(server, server_ctl, host, clients, resultsdir, l=60,
record_list
=
[
'size'
,
'sessions'
,
'throughput'
,
'trans.rate'
,
'CPU'
,
record_list
=
[
'size'
,
'sessions'
,
'throughput'
,
'trans.rate'
,
'CPU'
,
'thr_per_CPU'
,
'rx_pkts'
,
'tx_pkts'
,
'rx_byts'
,
'tx_byts'
,
'thr_per_CPU'
,
'rx_pkts'
,
'tx_pkts'
,
'rx_byts'
,
'tx_byts'
,
're_pkts'
,
'rx_intr'
,
'tx_intr'
,
'io_exit'
,
'irq_inj'
,
're_pkts'
,
'irq_inj'
,
'io_exit'
,
'rpkt_per_irq'
,
'tpkt_per_exit'
]
'tpkt_per_exit'
,
'rpkt_per_irq'
]
for
i
in
range
(
int
(
params
.
get
(
"queues"
,
0
))):
record_list
.
append
(
'rx_intr_%s'
%
i
)
record_list
.
append
(
'rx_intr_sum'
)
for
i
in
range
(
int
(
params
.
get
(
"queues"
,
0
))):
record_list
.
append
(
'tx_intr_%s'
%
i
)
record_list
.
append
(
'tx_intr_sum'
)
base
=
params
.
get
(
"format_base"
,
"12"
)
base
=
params
.
get
(
"format_base"
,
"12"
)
fbase
=
params
.
get
(
"format_fbase"
,
"2"
)
fbase
=
params
.
get
(
"format_fbase"
,
"2"
)
...
@@ -308,10 +322,10 @@ def start_test(server, server_ctl, host, clients, resultsdir, l=60,
...
@@ -308,10 +322,10 @@ def start_test(server, server_ctl, host, clients, resultsdir, l=60,
cpu
=
100
-
float
(
ret
[
'mpstat'
].
split
()[
mpstat_index
])
cpu
=
100
-
float
(
ret
[
'mpstat'
].
split
()[
mpstat_index
])
normal
=
thu
/
cpu
normal
=
thu
/
cpu
if
ret
.
get
(
'rx_pkts'
)
and
ret
.
get
(
'irq_inj'
):
if
ret
.
get
(
'rx_pkts'
)
and
ret
.
get
(
'irq_inj'
):
ret
[
'rpkt_per_
exit
'
]
=
float
(
ret
[
'rpkt_per_
irq
'
]
=
float
(
ret
[
'rx_pkts'
])
/
float
(
ret
[
'irq_inj'
])
ret
[
'rx_pkts'
])
/
float
(
ret
[
'irq_inj'
])
if
ret
.
get
(
'tx_pkts'
)
and
ret
.
get
(
'io_exit'
):
if
ret
.
get
(
'tx_pkts'
)
and
ret
.
get
(
'io_exit'
):
ret
[
'tpkt_per_
irq
'
]
=
float
(
ret
[
'tpkt_per_
exit
'
]
=
float
(
ret
[
'tx_pkts'
])
/
float
(
ret
[
'io_exit'
])
ret
[
'tx_pkts'
])
/
float
(
ret
[
'io_exit'
])
ret
[
'size'
]
=
int
(
i
)
ret
[
'size'
]
=
int
(
i
)
ret
[
'sessions'
]
=
int
(
j
)
ret
[
'sessions'
]
=
int
(
j
)
...
@@ -343,7 +357,7 @@ def start_test(server, server_ctl, host, clients, resultsdir, l=60,
...
@@ -343,7 +357,7 @@ def start_test(server, server_ctl, host, clients, resultsdir, l=60,
kill_cmd
=
"killall netperf"
kill_cmd
=
"killall netperf"
if
params
.
get
(
"os_type"
)
==
"windows"
:
if
params
.
get
(
"os_type"
)
==
"windows"
:
kill_cmd
=
"taskkill /F /IM netperf*"
kill_cmd
=
"taskkill /F /IM netperf*"
ssh_cmd
(
clients
[
-
1
],
kill_cmd
)
ssh_cmd
(
clients
[
-
1
],
kill_cmd
,
ignore_status
=
True
)
logging
.
debug
(
"Remove temporary files"
)
logging
.
debug
(
"Remove temporary files"
)
commands
.
getoutput
(
"rm -f /tmp/netperf.%s.nf"
%
ret
[
'pid'
])
commands
.
getoutput
(
"rm -f /tmp/netperf.%s.nf"
%
ret
[
'pid'
])
...
@@ -351,7 +365,7 @@ def start_test(server, server_ctl, host, clients, resultsdir, l=60,
...
@@ -351,7 +365,7 @@ def start_test(server, server_ctl, host, clients, resultsdir, l=60,
fd
.
close
()
fd
.
close
()
def
ssh_cmd
(
session
,
cmd
,
timeout
=
120
):
def
ssh_cmd
(
session
,
cmd
,
timeout
=
120
,
ignore_status
=
False
):
"""
"""
Execute remote command and return the output
Execute remote command and return the output
...
@@ -360,9 +374,11 @@ def ssh_cmd(session, cmd, timeout=120):
...
@@ -360,9 +374,11 @@ def ssh_cmd(session, cmd, timeout=120):
:param timeout: timeout for the command
:param timeout: timeout for the command
"""
"""
if
session
==
"localhost"
:
if
session
==
"localhost"
:
return
utils
.
system_output
(
cmd
,
timeout
=
timeout
)
o
=
utils
.
system_output
(
cmd
,
timeout
=
timeout
,
ignore_status
=
ignore_status
)
else
:
else
:
return
session
.
cmd_output
(
cmd
,
timeout
=
timeout
)
o
=
session
.
cmd
(
cmd
,
timeout
=
timeout
,
ignore_all_errors
=
ignore_status
)
return
o
@
error
.
context_aware
@
error
.
context_aware
...
@@ -424,13 +440,18 @@ def launch_client(sessions, server, server_ctl, host, clients, l, nf_args,
...
@@ -424,13 +440,18 @@ def launch_client(sessions, server, server_ctl, host, clients, l, nf_args,
def
count_interrupt
(
name
):
def
count_interrupt
(
name
):
"""
"""
:param name: the name of interrupt, such as "virtio0-input"
Get a list of interrut number for each queue
@param name: the name of interrupt, such as "virtio0-input"
"""
"""
intr
=
0
sum
=
0
intr
=
[]
stat
=
ssh_cmd
(
server_ctl
,
"cat /proc/interrupts |grep %s"
%
name
)
stat
=
ssh_cmd
(
server_ctl
,
"cat /proc/interrupts |grep %s"
%
name
)
stat
=
stat
.
strip
().
split
(
"
\n
"
)[
-
1
]
for
i
in
stat
.
strip
().
split
(
"
\n
"
):
for
cpu
in
range
(
int
(
ncpu
)):
for
cpu
in
range
(
int
(
ncpu
)):
intr
+=
int
(
stat
.
split
()[
cpu
+
1
])
sum
+=
int
(
i
.
split
()[
cpu
+
1
])
intr
.
append
(
sum
)
sum
=
0
return
intr
return
intr
def
get_state
():
def
get_state
():
...
@@ -456,10 +477,22 @@ def launch_client(sessions, server, server_ctl, host, clients, l, nf_args,
...
@@ -456,10 +477,22 @@ def launch_client(sessions, server, server_ctl, host, clients, l, nf_args,
try
:
try
:
nrx_intr
=
count_interrupt
(
"virtio.-input"
)
nrx_intr
=
count_interrupt
(
"virtio.-input"
)
ntx_intr
=
count_interrupt
(
"virtio.-output"
)
ntx_intr
=
count_interrupt
(
"virtio.-output"
)
state_list
.
append
(
'rx_intr'
)
sum
=
0
state_list
.
append
(
nrx_intr
)
for
i
in
range
(
len
(
nrx_intr
)):
state_list
.
append
(
'tx_intr'
)
state_list
.
append
(
'rx_intr_%s'
%
i
)
state_list
.
append
(
ntx_intr
)
state_list
.
append
(
nrx_intr
[
i
])
sum
+=
nrx_intr
[
i
]
state_list
.
append
(
'rx_intr_sum'
)
state_list
.
append
(
sum
)
sum
=
0
for
i
in
range
(
len
(
ntx_intr
)):
state_list
.
append
(
'tx_intr_%s'
%
i
)
state_list
.
append
(
ntx_intr
[
i
])
sum
+=
ntx_intr
[
i
]
state_list
.
append
(
'tx_intr_sum'
)
state_list
.
append
(
sum
)
except
IndexError
:
except
IndexError
:
ninit
=
count_interrupt
(
"virtio."
)
ninit
=
count_interrupt
(
"virtio."
)
state_list
.
append
(
'intr'
)
state_list
.
append
(
'intr'
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录