author | Robin Lee <rgl@google.com> | 2020-11-06 13:45:17 (GMT) |
---|---|---|
committer | Robin Lee <rgl@google.com> | 2020-11-06 13:45:21 (GMT) |
commit | 115dd74699de9a51728ceb54eed93776af446ce5 (patch) | |
tree | 41f2a3c6894926de2e979e375cc45e2813fb8f39 | |
parent | 6e7049dfcb9fa2942e68cfafcd227bdf8f4b68ac (diff) | |
download | common-115dd74699de9a51728ceb54eed93776af446ce5.zip common-115dd74699de9a51728ceb54eed93776af446ce5.tar.gz common-115dd74699de9a51728ceb54eed93776af446ce5.tar.bz2 |
Add schedtune compatibility shim files
schedtune is an out-of-tree controller which will not be supported in
Android 12 or above. This is to work around the intermediate state where
schedtune has been removed but the bluetooth process is still using it.
Test: adb logcat -b all | grep SIGABRT
Bug: 170507876
Bug: 172464521
Change-Id: If39c1ad3a938a9bcd88823645b4211e0e12f22dd
-rw-r--r-- | cgroups.json | 11 | ||||
-rwxr-xr-x | products/mbox/sm1/device.mk | 9 | ||||
-rw-r--r-- | task_profiles.json | 121 |
3 files changed, 141 insertions, 0 deletions
diff --git a/cgroups.json b/cgroups.json new file mode 100644 index 0000000..17d4929 --- a/dev/null +++ b/cgroups.json @@ -0,0 +1,11 @@ +{ + "Cgroups": [ + { + "Controller": "schedtune", + "Path": "/dev/stune", + "Mode": "0755", + "UID": "system", + "GID": "system" + } + ] +} diff --git a/products/mbox/sm1/device.mk b/products/mbox/sm1/device.mk index 151b213..4d4c589 100755 --- a/products/mbox/sm1/device.mk +++ b/products/mbox/sm1/device.mk @@ -82,6 +82,15 @@ PRODUCT_COPY_FILES += \ ######################################################################### # +# Workaround bluetooth schedtune (b/170507876) +# +######################################################################### +PRODUCT_COPY_FILES += \ + device/amlogic/common/task_profiles.json:$(TARGET_COPY_OUT_VENDOR)/etc/task_profiles.json \ + device/amlogic/common/cgroups.json:$(TARGET_COPY_OUT_VENDOR)/etc/cgroups.json + +######################################################################### +# # Set default USB configuration # ######################################################################### diff --git a/task_profiles.json b/task_profiles.json new file mode 100644 index 0000000..a9e45b5 --- a/dev/null +++ b/task_profiles.json @@ -0,0 +1,121 @@ +{ + "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": "CpuPolicySpread", + "Actions": [ + { + "Name": "SetAttribute", + "Params": + { + "Name": "STunePreferIdle", + "Value": "1" + } + } + ] + }, + { + "Name": "CpuPolicyPack", + "Actions": [ + { + "Name": "SetAttribute", + "Params": + { + "Name": "STunePreferIdle", + "Value": "0" + } + } + ] + } + ] +} |