From fdf365f642b20bbf6586b64e9b9f985781dfd733 Mon Sep 17 00:00:00 2001 From: Rick Yiu Date: Mon, 26 Oct 2020 12:33:36 +0800 Subject: [PATCH] sunfish: Add vendor libprocessgroup json file While schedtune is removed from AOSP libprocessgroup json files, we need to add it back through vendor json files. Bug: 170507876 Test: schedtune works Change-Id: I64af0158c7e7a59e6db7afb4a6a5f304751ef7af Merged-In: I64af0158c7e7a59e6db7afb4a6a5f304751ef7af --- cgroups.json | 11 +++++ device.mk | 4 ++ task_profiles.json | 121 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 136 insertions(+) create mode 100644 cgroups.json create mode 100644 task_profiles.json diff --git a/cgroups.json b/cgroups.json new file mode 100644 index 00000000..17d49294 --- /dev/null +++ b/cgroups.json @@ -0,0 +1,11 @@ +{ + "Cgroups": [ + { + "Controller": "schedtune", + "Path": "/dev/stune", + "Mode": "0755", + "UID": "system", + "GID": "system" + } + ] +} diff --git a/device.mk b/device.mk index 36228090..04900ee3 100644 --- a/device.mk +++ b/device.mk @@ -873,6 +873,10 @@ PRODUCT_PROPERTY_OVERRIDES += \ PRODUCT_COPY_FILES += \ $(LOCAL_PATH)/powerhint.json:$(TARGET_COPY_OUT_VENDOR)/etc/powerhint.json +PRODUCT_COPY_FILES += \ + $(LOCAL_PATH)/task_profiles.json:$(TARGET_COPY_OUT_VENDOR)/etc/task_profiles.json \ + $(LOCAL_PATH)/cgroups.json:$(TARGET_COPY_OUT_VENDOR)/etc/cgroups.json + # Vendor verbose logging default property ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) PRODUCT_PROPERTY_OVERRIDES += \ diff --git a/task_profiles.json b/task_profiles.json new file mode 100644 index 00000000..a9e45b5d --- /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" + } + } + ] + } + ] +}