SmartPack / SmartPack-Kernel-Manager

Source code of SmartPack-Kernel Manager, the Ultimate Tool to Manage your Kernel
https://play.google.com/store/apps/details?id=com.smartpack.kernelmanager.pro
GNU General Public License v3.0
628 stars 73 forks source link

Add support for Kprofiles [Feature Request] #146

Open dariusz-goc opened 1 year ago

dariusz-goc commented 1 year ago

Many recent kernels have started using so called "kprofiles". This solution is similar to Spectrum, however it uses different contact points. A similar UI to Spectrum UI could be utilized for that feature as those two seem to be very similar. There should be one switch for Auto Kprofiles and one list selection for Disabled/Battery/Balanced/Performance (auto kprofiles and kprofiles mode are independent settings). There should also be a switch to apply those settings on Boot, because they don't seem to stick.

Description taken from the project's GitHub page below:

Kprofiles is a simple Linux kernel module that can be used to regulate in-kernel activities such as boosts that are normally not exposed to the userspace. Kprofiles operates in a profile-oriented manner So, It has four profile modes: Disabled, Battery, Balanced, and Performance. Each mode is allocated a mode number. Developers can use the Kprofiles API function in conditions to limit or enable in-kernel tasks in a certain profile mode (look at usage section for example). Userspace can interact with Kprofiles by adjusting the mode number in /sys/module/kprofiles/parameters/kp_mode. The table below shows which mode number corresponds to the profile mode.

Profile Mode Mode Number Disabled (default) 0 Battery 1 Balanced 2 Performance 3

Furthermore, Kprofiles provides automatic profile changer (auto Kprofiles), which uses FB notifier, MSM DRM notifier or MI DRM notifier to enforce battery profile mode when the device's screen goes off and switches back to previously active mode when the device wakes up. Users can disable or enable this feature at runtime without recompiling the kernel by changing the bool value in /sys/module/kprofiles/parameters/auto_kprofiles to Y or N.

Original documentation

sunilpaulmathew commented 1 year ago

@dariusz-goc Extremely sorry for the delayed response. I shall look on it. But, I hope you'll be there to test (not using a root-enabled device atm).

dariusz-goc commented 1 year ago

Sure, happy to help