sdm660-common: Ship copy of API 28 cgroups/task_profiles.json in vendor

Google's prebuilt cgroups.json and task_profiles.json for products
launched with previous API levels only covers
ro.product.first_api_level >= 28. [1]

Xiaomi sdm660 devices were launched with Nougat/Nougat MR1/Oreo (API levels 24-26), so schedtune and
task groups are completely broken. Since the system also checks
/vendor/etc for vendor profiles, make a copy of cgroups_28.json
and task_profiles_28.json and ship them to /vendor/etc. Profiles
for previous API levels are all the same anyway.

Test: boot and check /dev/stune/

[1] system/core/libprocessgroup/profiles/

Signed-off-by: Chenyang Zhong <zhongcy95@gmail.com>
Signed-off-by: Jarl-Penguin <jarlpenguin@outlook.com>
Signed-off-by: SakilMondal <mondalsakil@gmail.com>
Change-Id: I8e54ae2d79034f54447616d79294573bf74ed6e1
Signed-off-by: pix106 <sbordenave@gmail.com>
This commit is contained in:
Chenyang Zhong 2021-10-08 09:48:37 -04:00 committed by pix106
parent 5a44c31e45
commit d979f6a671
3 changed files with 151 additions and 0 deletions

11
configs/cgroups.json Normal file
View file

@ -0,0 +1,11 @@
{
"Cgroups": [
{
"Controller": "schedtune",
"Path": "/dev/stune",
"Mode": "0755",
"UID": "system",
"GID": "system"
}
]
}

135
configs/task_profiles.json Normal file
View file

@ -0,0 +1,135 @@
{
"Attributes": [
{
"Name": "STuneBoost",
"Controller": "schedtune",
"File": "schedtune.boost"
},
{
"Name": "STunePreferIdle",
"Controller": "schedtune",
"File": "schedtune.prefer_idle"
}
],
"Profiles": [
{
"Name": "HighEnergySaving",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "schedtune",
"Path": "background"
}
}
]
},
{
"Name": "NormalPerformance",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "schedtune",
"Path": ""
}
}
]
},
{
"Name": "HighPerformance",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "schedtune",
"Path": "foreground"
}
}
]
},
{
"Name": "MaxPerformance",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "schedtune",
"Path": "top-app"
}
}
]
},
{
"Name": "RealtimePerformance",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "schedtune",
"Path": "rt"
}
}
]
},
{
"Name": "CameraServicePerformance",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "schedtune",
"Path": "camera-daemon"
}
}
]
},
{
"Name": "NNApiHALPerformance",
"Actions": [
{
"Name": "JoinCgroup",
"Params":
{
"Controller": "schedtune",
"Path": "nnapi-hal"
}
}
]
},
{
"Name": "CpuPolicySpread",
"Actions": [
{
"Name": "SetAttribute",
"Params":
{
"Name": "STunePreferIdle",
"Value": "1"
}
}
]
},
{
"Name": "CpuPolicyPack",
"Actions": [
{
"Name": "SetAttribute",
"Params":
{
"Name": "STunePreferIdle",
"Value": "0"
}
}
]
}
]
}

View file

@ -156,6 +156,11 @@ PRODUCT_PACKAGES += \
com.android.media.swcodec \ com.android.media.swcodec \
libsfplugin_ccodec libsfplugin_ccodec
# Cgroup and task_profiles
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/cgroups.json:$(TARGET_COPY_OUT_VENDOR)/etc/cgroups.json \
$(LOCAL_PATH)/configs/task_profiles.json:$(TARGET_COPY_OUT_VENDOR)/etc/task_profiles.json
# Component overrides # Component overrides
PRODUCT_COPY_FILES += \ PRODUCT_COPY_FILES += \
$(COMMON_PATH)/configs/component-overrides.xml:$(TARGET_COPY_OUT_VENDOR)/etc/sysconfig/component-overrides.xml $(COMMON_PATH)/configs/component-overrides.xml:$(TARGET_COPY_OUT_VENDOR)/etc/sysconfig/component-overrides.xml