Skip to content

Commit

Permalink
DEV 22.06.26
Browse files Browse the repository at this point in the history
- 新增 移除`swjunk`
- 改进 功耗分配
- 改进 任务放置
- 修复 后台程序破音
- ...合计19个commit

Signed-off-by: Matt Yang <yccy@outlook.com>
  • Loading branch information
yc9559 committed Jun 26, 2022
1 parent 12bb192 commit b7f0436
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 67 deletions.
7 changes: 7 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# 更新日志

## DEV 22.06.26

- 新增 移除`swjunk`
- 改进 功耗分配
- 改进 任务放置
- 修复 后台程序破音

## DEV 22.06.05

- 新增 更多兼容性CPU频率写入器
Expand Down
9 changes: 2 additions & 7 deletions config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ touch --> switch: detected window animation
touch --> junk: detected junk
gesture --> switch: detected window animation
gesture --> junk: detected junk
switch --> swjunk: detected junk
junk --> touch: timeout / finished junk
swjunk --> switch: timeout / finished junk
trigger --> touch: timeout / not rendering
gesture --> touch: timeout / not rendering
switch --> touch: timeout / not rendering
Expand All @@ -71,7 +69,6 @@ touch --> idle: timeout / not rendering
| gesture | float | (单位:秒)全面屏手势 |
| switch | float | (单位:秒)应用切换动画/点亮屏幕 |
| junk | float | (单位:秒)touch/gesture 中 sfanalysis 检测到掉帧 |
| swjunk | float | (单位:秒)switch 中 sfanalysis 检测到掉帧 |

### atrace/数据打点

Expand Down Expand Up @@ -302,7 +299,7 @@ touch --> idle: timeout / not rendering
| latencyTime | float | (单位:秒)(0.0~10.0)CPU 整体升频最小延迟 |
| slowLimitPower | float | (单位:瓦)(0.05~999.0)CPU 长期功耗限制 |
| fastLimitPower | float | (单位:瓦)(0.05~999.0)CPU 短期功耗限制,能耗缓冲池消耗完毕后进入长期功耗限制 |
| fastLimitCapacity | float | (单位:瓦秒)(0.0~999.0)CPU 短期功耗限制容量 |
| fastLimitCapacity | float | (单位:瓦秒)(0.0~999.0)CPU 短期功耗限制容量,增加时重置余量为限制容量 |
| fastLimitRecoverScale | float | (0.1~10.0)CPU 短期功耗限制容量恢复缩放因子 |
| predictThd | float | (0.1~1.0)CPU 集群最大负载增加量大于该阈值,则集群调频使用预测的负载值,并忽略`latencyTime` |
| margin | float | (0.0~1.0)调频提供的性能余量 |
Expand Down Expand Up @@ -333,7 +330,7 @@ touch --> idle: timeout / not rendering

功能模块的参数预设段,在这里定义不同的性能模式,如均衡模式、节能模式。

每组参数预设必须包含`*`, `idle`, `touch`, `trigger`, `gesture`, `junk`, `switch`, `swjunk`,如下样例所示。参数预设中子配置名称定义同[动态配置切换器](#switcher/动态配置切换器),在状态跳转后应用对应模式的动态参数。其中`*`中的参数为该组参数预设的动态参数默认值。
每组参数预设必须包含`*`, `idle`, `touch`, `trigger`, `gesture`, `junk`, `switch`,如下样例所示。参数预设中子配置名称定义同[动态配置切换器](#switcher/动态配置切换器),在状态跳转后应用对应模式的动态参数。其中`*`中的参数为该组参数预设的动态参数默认值。

```json
"balance": {
Expand All @@ -350,8 +347,6 @@ touch --> idle: timeout / not rendering
"junk": {
},
"switch": {
},
"swjunk": {
}
}
```
Expand Down
79 changes: 27 additions & 52 deletions config/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@
"hintDuration": {
"idle": 0.0,
"touch": 4.0,
"trigger": 0.02,
"trigger": 0.05,
"gesture": 0.1,
"switch": 0.4,
"junk": 0.02,
"swjunk": 0.02
"junk": 0.02
}
},
"atrace": {
Expand Down Expand Up @@ -63,24 +62,25 @@
},
"affinity": {
"auto": { "bg": "", "fg": "", "idle": "", "touch": "", "boost": "" },
"norm": { "bg": "norm", "fg": "eff", "idle": "all", "touch": "norm", "boost": "norm" },
"norm": { "bg": "norm", "fg": "norm", "idle": "all", "touch": "norm", "boost": "norm" },
"bg": { "bg": "norm", "fg": "eff", "idle": "eff", "touch": "eff", "boost": "eff" },
"coop": { "bg": "norm", "fg": "norm", "idle": "norm", "touch": "norm", "boost": "all" },
"ui": { "bg": "norm", "fg": "norm", "idle": "norm", "touch": "bal", "boost": "bal" },
"binder": { "bg": "norm", "fg": "norm", "idle": "norm", "touch": "norm", "boost": "perf" },
"crit": { "bg": "norm", "fg": "norm", "idle": "bal", "touch": "bal", "boost": "bal" },
"gtperf": { "bg": "norm", "fg": "norm", "idle": "all", "touch": "perf", "boost": "all" },
"gtcoop": { "bg": "norm", "fg": "norm", "idle": "perf", "touch": "gtcoop", "boost": "all" },
"gtmain": { "bg": "norm", "fg": "norm", "idle": "perf", "touch": "gtmain", "boost": "all" }
},
"prio": {
"auto": { "bg": 0, "fg": 0, "idle": 0, "touch": 0, "boost": 0 },
"norm": { "bg": -3, "fg": -1, "idle": -1, "touch": -1, "boost": -1 },
"norm": { "bg": -1, "fg": -1, "idle": -1, "touch": -1, "boost": -1 },
"bg": { "bg": -3, "fg": 139, "idle": 139, "touch": 139, "boost": -3 },
"coop": { "bg": -3, "fg": 121, "idle": 121, "touch": 121, "boost": -3 },
"ui": { "bg": -3, "fg": 120, "idle": 110, "touch": 98, "boost": 116 },
"main": { "bg": -3, "fg": 120, "idle": 110, "touch": 104, "boost": 98 },
"rtusr": { "bg": 98, "fg": 98, "idle": 98, "touch": 98, "boost": 97 },
"rtsys": { "bg": 97, "fg": 97, "idle": 97, "touch": 97, "boost": 96 }
"main": { "bg": -3, "fg": 120, "idle": 110, "touch": 98, "boost": 100 },
"rtusr": { "bg": 98, "fg": 98, "idle": 97, "touch": 97, "boost": 98 },
"rtsys": { "bg": 97, "fg": 97, "idle": 96, "touch": 96, "boost": 97 }
},
"rules": [
{
Expand Down Expand Up @@ -111,8 +111,8 @@
"regex": "system_server",
"pinned": true,
"rules": [
{ "k": "^(android.anim|android.display|android.bg)", "ac": "crit", "pc": "rtusr" },
{ "k": "^Binder:", "ac": "binder", "pc": "auto" },
{ "k": "^(android.anim|android.display)", "ac": "crit", "pc": "rtusr" },
{ "k": "^(Binder:|android.bg)", "ac": "binder", "pc": "auto" },
{ "k": "^(TaskSnapshot|Greezer|CachedApp|SystemPressure|SensorService)|[Mm]emory", "ac": "bg", "pc": "auto" },
{ "k": ".", "ac": "auto", "pc": "auto" }
]
Expand Down Expand Up @@ -173,6 +173,7 @@
{ "k": "/MAIN_THREAD/", "ac": "ui", "pc": "main" },
{ "k": "^(UnityMain|RenderThread |GameThread)", "ac": "gtmain", "pc": "auto" },
{ "k": "^(Unity|Worker Thread|TaskGraph|RHIThread)", "ac": "gtcoop", "pc": "auto" },
{ "k": "^Thread-", "ac": "gtperf", "pc": "auto" },
{ "k": "^(RenderThread|GLThread|JNISurfaceText|IJK_External_Re)|[Aa]nim|([.]raster|[.]ui)$", "ac": "ui", "pc": "ui" },
{ "k": "^(Chrome_InProc|CrRendererMain|CrGpuMain|CompositorTile)", "ac": "coop", "pc": "coop" },
{ "k": "^(Viz|Chrome_|Compositor)|[Vv]sync|mali-", "ac": "norm", "pc": "ui" },
Expand All @@ -195,8 +196,8 @@
"slowLimitPower": 3.0,
"fastLimitPower": 6.0,
"fastLimitCapacity": 10.0,
"fastLimitRecoverScale": 0.6,
"predictThd": 0.1,
"fastLimitRecoverScale": 0.5,
"predictThd": 0.3,
"margin": 0.25,
"burst": 0.0,
"guideCap": true,
Expand All @@ -218,14 +219,15 @@
"*": {
"cpu.latencyTime": 0.2,
"cpu.slowLimitPower": 2.5,
"cpu.fastLimitPower": 5.0,
"cpu.fastLimitCapacity": 1.0,
"cpu.fastLimitPower": 4.0,
"cpu.fastLimitCapacity": 45.0,
"cpu.margin": 0.2
},
"idle": {
"cpu.baseSampleTime": 0.04,
"cpu.baseSlackTime": 0.08,
"cpu.predictThd": 0.1,
"cpu.fastLimitPower": 2.5,
"cpu.predictThd": 0.3,
"cpu.limitEfficiency": true,
"sched.scene": "idle"
},
Expand All @@ -234,45 +236,36 @@
"sched.scene": "touch"
},
"trigger": {
"cpu.margin": 0.6,
"cpu.margin": 0.3,
"sched.scene": "touch"
},
"gesture": {
"cpu.margin": 0.6,
"sched.scene": "touch"
},
"junk": {
"cpu.baseSampleTime": 0.04,
"cpu.burst": 0.5,
"cpu.burst": 0.6,
"sched.scene": "touch"
},
"switch": {
"cpu.latencyTime": 0.0,
"cpu.slowLimitPower": 5.0,
"cpu.fastLimitCapacity": 0.0,
"cpu.margin": 0.4,
"sched.scene": "boost"
},
"swjunk": {
"cpu.latencyTime": 0.0,
"cpu.slowLimitPower": 5.0,
"cpu.fastLimitCapacity": 0.0,
"cpu.fastLimitPower": 7.5,
"cpu.margin": 0.4,
"cpu.burst": 0.5,
"sched.scene": "boost"
}
},
"powersave": {
"*": {
"cpu.latencyTime": 0.4,
"cpu.slowLimitPower": 1.0,
"cpu.fastLimitPower": 2.5,
"cpu.fastLimitCapacity": 0.5,
"cpu.fastLimitPower": 1.5,
"cpu.fastLimitCapacity": 5.0,
"cpu.margin": 0.1
},
"idle": {
"cpu.baseSampleTime": 0.04,
"cpu.baseSlackTime": 0.08,
"cpu.fastLimitPower": 1.0,
"cpu.predictThd": 1.0,
"cpu.limitEfficiency": true,
"sched.scene": "idle"
Expand All @@ -282,31 +275,21 @@
"sched.scene": "touch"
},
"trigger": {
"cpu.margin": 0.6,
"cpu.margin": 0.3,
"sched.scene": "touch"
},
"gesture": {
"cpu.margin": 0.6,
"sched.scene": "touch"
},
"junk": {
"cpu.baseSampleTime": 0.04,
"cpu.burst": 0.3,
"sched.scene": "touch"
},
"switch": {
"cpu.latencyTime": 0.0,
"cpu.slowLimitPower": 2.5,
"cpu.fastLimitCapacity": 0.0,
"cpu.margin": 0.3,
"sched.scene": "boost"
},
"swjunk": {
"cpu.latencyTime": 0.0,
"cpu.slowLimitPower": 2.5,
"cpu.fastLimitCapacity": 0.0,
"cpu.fastLimitPower": 3.0,
"cpu.margin": 0.3,
"cpu.burst": 0.3,
"sched.scene": "boost"
}
},
Expand Down Expand Up @@ -335,16 +318,12 @@
"sched.scene": "touch"
},
"junk": {
"cpu.burst": 0.5,
"cpu.burst": 0.6,
"sched.scene": "touch"
},
"switch": {
"cpu.burst": 0.2,
"sched.scene": "boost"
},
"swjunk": {
"cpu.burst": 0.5,
"sched.scene": "boost"
}
},
"fast": {
Expand Down Expand Up @@ -372,16 +351,12 @@
"sched.scene": "touch"
},
"junk": {
"cpu.burst": 0.5,
"cpu.burst": 0.6,
"sched.scene": "touch"
},
"switch": {
"cpu.burst": 0.2,
"sched.scene": "boost"
},
"swjunk": {
"cpu.burst": 0.5,
"sched.scene": "boost"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions magisk/module.prop
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
id=uperf
name=Uperf
version=v3(22.06.05)
versionCode=220605
version=v3(22.06.26)
versionCode=220626
author=Matt Yang
description=Userspace performance controller for android. Repo: https://github.com/yc9559/uperf/
updateJson=https://github.com/yc9559/uperf/raw/master/version.json
6 changes: 4 additions & 2 deletions magisk/script/initsvc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ lock_val "1048576" /proc/sys/fs/inotify/max_user_watches
lock_val "1024" /proc/sys/fs/inotify/max_user_instances

mv $USER_PATH/uperf_log.txt $USER_PATH/uperf_log.txt.bak
ASAN_LIB="$(ls $BIN_PATH/libclang_rt.asan-*-android.so)"
export LD_PRELOAD="$ASAN_LIB $BIN_PATH/libc++_shared.so"
if [ -f $BIN_PATH/libc++_shared.so ]; then
ASAN_LIB="$(ls $BIN_PATH/libclang_rt.asan-*-android.so)"
export LD_PRELOAD="$ASAN_LIB $BIN_PATH/libc++_shared.so"
fi
$BIN_PATH/uperf $USER_PATH/uperf.json -o $USER_PATH/uperf_log.txt
2 changes: 1 addition & 1 deletion magisk/script/powercfg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Uperf",
"author": "Matt Yang",
"version": "22.06.05",
"version": "22.06.26",
"versionCode": 3,
"features": {
"strict": true,
Expand Down
2 changes: 1 addition & 1 deletion magisk/script/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ install_uperf() {
echo ""
echo "* Uperf https://github.com/yc9559/uperf/"
echo "* Author: Matt Yang"
echo "* Version: v3(22.06.05)"
echo "* Version: v3(22.06.26)"
echo ""

echo "- Installing uperf"
Expand Down
4 changes: 2 additions & 2 deletions version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"versionCode": 220605,
"versionCode": 220626,
"version": "v3",
"zipUrl": "https://github.com/yc9559/uperf/releases/download/dev-22.06.05/uperf-dev-22.06.05.zip",
"zipUrl": "https://github.com/yc9559/uperf/releases/download/dev-22.06.26/uperf-dev-22.06.26.zip",
"changelog": "https://github.com/yc9559/uperf/raw/master/changelog.md"
}

0 comments on commit b7f0436

Please sign in to comment.