Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
A-Tune
提交
b38a3851
A
A-Tune
项目概览
openeuler
/
A-Tune
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
A-Tune
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b38a3851
编写于
2月 24, 2020
作者:
H
hanxinke
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
atune: support the case of the same key in the same section in the profile
上级
40bc70ed
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
36 addition
and
25 deletion
+36
-25
analysis/plugin/configurator/script/script.py
analysis/plugin/configurator/script/script.py
+34
-16
database/init.sql
database/init.sql
+2
-9
未找到文件。
analysis/plugin/configurator/script/script.py
浏览文件 @
b38a3851
...
@@ -20,7 +20,7 @@ import os
...
@@ -20,7 +20,7 @@ import os
import
subprocess
import
subprocess
import
random
import
random
from
analysis.plugin.public
import
GetConfigError
from
analysis.plugin.public
import
GetConfigError
,
SetConfigError
from
..common
import
Configurator
from
..common
import
Configurator
LOGGER
=
logging
.
getLogger
(
__name__
)
LOGGER
=
logging
.
getLogger
(
__name__
)
...
@@ -30,6 +30,7 @@ class Script(Configurator):
...
@@ -30,6 +30,7 @@ class Script(Configurator):
"""The script extention of CPI"""
"""The script extention of CPI"""
_module
=
"SCRIPT"
_module
=
"SCRIPT"
_submod
=
"SCRIPT"
_submod
=
"SCRIPT"
cmd_delimiter
=
"|"
def
__init__
(
self
,
user
=
None
):
def
__init__
(
self
,
user
=
None
):
Configurator
.
__init__
(
self
,
user
)
Configurator
.
__init__
(
self
,
user
)
...
@@ -37,19 +38,13 @@ class Script(Configurator):
...
@@ -37,19 +38,13 @@ class Script(Configurator):
def
_set
(
self
,
key
,
value
):
def
_set
(
self
,
key
,
value
):
name
=
os
.
path
.
basename
(
key
)
name
=
os
.
path
.
basename
(
key
)
script
=
"{}/set.sh"
.
format
(
key
)
script
=
"{}/set.sh"
.
format
(
key
)
output
=
subprocess
.
run
(
if
not
os
.
path
.
exists
(
script
):
"{script} {val}"
.
format
(
raise
SetConfigError
(
"script {} not implement"
.
format
(
script
))
script
=
script
,
if
value
is
not
None
:
val
=
value
).
split
(),
for
command
in
value
.
split
(
self
.
cmd_delimiter
):
stdout
=
subprocess
.
DEVNULL
,
self
.
run_script
(
name
,
script
,
command
,
subprocess
.
DEVNULL
)
stderr
=
subprocess
.
PIPE
,
else
:
shell
=
False
,
self
.
run_script
(
name
,
script
,
value
,
subprocess
.
DEVNULL
)
check
=
True
)
if
len
(
output
.
stderr
)
!=
0
:
err
=
UserWarning
(
name
+
": "
+
output
.
stderr
.
decode
())
LOGGER
.
error
(
"%s.%s: %s"
,
self
.
__class__
.
__name__
,
inspect
.
stack
()[
0
][
3
],
str
(
err
))
raise
err
return
0
return
0
def
_get
(
self
,
key
,
value
):
def
_get
(
self
,
key
,
value
):
...
@@ -57,12 +52,35 @@ class Script(Configurator):
...
@@ -57,12 +52,35 @@ class Script(Configurator):
script
=
"{}/get.sh"
.
format
(
key
)
script
=
"{}/get.sh"
.
format
(
key
)
if
not
os
.
path
.
exists
(
script
):
if
not
os
.
path
.
exists
(
script
):
raise
GetConfigError
(
"script {} not implement"
.
format
(
script
))
raise
GetConfigError
(
"script {} not implement"
.
format
(
script
))
output_list
=
[]
if
value
is
not
None
:
for
command
in
value
.
split
(
self
.
cmd_delimiter
):
out
=
self
.
run_script
(
name
,
script
,
command
,
subprocess
.
PIPE
)
output_list
.
append
(
out
.
stdout
.
decode
().
strip
())
output
=
self
.
cmd_delimiter
.
join
(
output_list
)
else
:
out
=
self
.
run_script
(
name
,
script
,
value
,
subprocess
.
PIPE
)
output
=
out
.
stdout
.
decode
()
LOGGER
.
info
(
"get script: %s %s"
,
name
,
output
)
return
output
def
run_script
(
self
,
name
,
script
,
value
,
stdout
):
"""
run specified script.
:param name: The path name of script
:param script: The absolute path of script
:param value: The script parameter
:param stdout: The type of stdout
:return output: The result of running the script
:raise Exception: Failed to run script
"""
LOGGER
.
info
(
"exec %s %s"
,
script
,
value
)
output
=
subprocess
.
run
(
output
=
subprocess
.
run
(
"{script} {val}"
.
format
(
"{script} {val}"
.
format
(
script
=
script
,
script
=
script
,
val
=
value
).
split
(),
val
=
value
).
split
(),
stdout
=
s
ubprocess
.
PIPE
,
stdout
=
s
tdout
,
stderr
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
shell
=
False
,
shell
=
False
,
check
=
True
)
check
=
True
)
...
@@ -71,7 +89,7 @@ class Script(Configurator):
...
@@ -71,7 +89,7 @@ class Script(Configurator):
LOGGER
.
error
(
"%s.%s: %s"
,
self
.
__class__
.
__name__
,
LOGGER
.
error
(
"%s.%s: %s"
,
self
.
__class__
.
__name__
,
inspect
.
stack
()[
0
][
3
],
str
(
err
))
inspect
.
stack
()[
0
][
3
],
str
(
err
))
raise
err
raise
err
return
output
.
stdout
.
decode
()
return
output
@
staticmethod
@
staticmethod
def
check
(
_
,
__
):
def
check
(
_
,
__
):
...
...
database/init.sql
浏览文件 @
b38a3851
...
@@ -283,10 +283,7 @@ irqbalance=stop
...
@@ -283,10 +283,7 @@ irqbalance=stop
[script]
[script]
prefetch = off
prefetch = off
ethtool = -K {network} gro on
ethtool = -K {network} gro on | -K {network} gso on | -K {network} tso on | -X {network} hfunc toeplitz
ethtool = -K {network} gso on
ethtool = -K {network} tso on
ethtool = -X {network} hfunc toeplitz
swap = -a off
swap = -a off
[tip]
[tip]
...
@@ -655,11 +652,7 @@ bind network interrupts to its affinity numa node = affinity
...
@@ -655,11 +652,7 @@ bind network interrupts to its affinity numa node = affinity
[script]
[script]
prefetch = off
prefetch = off
ifconfig = {network} mtu 1500
ifconfig = {network} mtu 1500
ethtool = -C {network} adaptive-rx on
ethtool = -C {network} adaptive-rx on | -K {network} gro on | -K {network} gso on | -K {network} tso on
ethtool = -K {network} gro on
ethtool = -K {network} gso on
ethtool = -K {network} tso on
#ethtool = -K {network} lro on
[ulimit]
[ulimit]
{user}.hard.nofile = 102400
{user}.hard.nofile = 102400
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录