Boeffla generic wakelock blocker
...is a new expert feature that has been introduced in all my modern kernels for OnePlus 5, 3T, 3, 2, X and One.
Why is it called "generic" and how does it work?
It is called "generic", because it is not limited to a predefined number of wakelocks to be blocked. You, the user, have the full flexibility to block any kernel wakelock you want by simply putting it on a blocker list. As simple as that. The only thing you need to know is the name of the wakelock. But this can be simply derived from tools like BetterBatteryStats or similar apps.
Why is there no native support for it in Boeffla-Config?
This is simple: Wakelocks are usually there for a reason. Driver and app programmers surely had their reasons to put wakelocks into the code in certain areas. This means, by blocking some of them you can introduce smaller or bigger issues, you can trigger strange side effects and in worst case render the system completely unusable.
In short: It is a function for experts only, people that know exactly what they do (and can block) and what not. People that are experts on that level have no issue with not having native app support but using the "profile scripting" functionality in Boeffla-Config for it.
Note, in any case: If you block wakelocks, you are out of support by me !
Blocking wakelocks is solely your own responsibility and if you break things by it, it is your own fault only.
So how can I now use it and block wakelocks with Boeffla-Config?
Note: More and more Boeffla-Kernels are equipped with Boeffla wakelock blocker driver 1.1.0 or higher. This driver already blocks a couple of harmless wakelocks by default, namely: qcom_rx_wakelock, wlan, wlan_wow_wl, wlan_extscan_wl, netmgr_wl and NETLINK. You do not need to block these on your own. Check kernel change log to find out which driver version is used in your kernel (or check content of /sys/class/misc/boeffla_wakelock_blocker/version for the version information).
Very simple, you need to add the following command to the profile scripting screen (Boeffla-Config donation version required):
echo "list" > /sys/class/misc/boeffla_wakelock_blocker/wakelock_blocker
where list is a list of wakelocks you want to block, separated by semicolons. Never use blanks in that list, mind the case sensitivity of commands.
You can, of course, use any way you want to put the wakelocks into this file. You can use other scripting, editors, etc etc. Just bear in mind this is not sticky across reboots (impossible as it is a kernel file), so using Boeffla-Config makes sure it will be applied after a reboot again.
I did not fully understand, can I have an example?
Of course. Let's assume you want to block two wakelocks with the following names: NlpWakeLock and [timerfd]
All you need to do is to put the following command in your profile scripting field in Boeffla-Config:
echo "NlpWakeLock;[timerfd]" > /sys/class/misc/boeffla_wakelock_blocker/wakelock_blocker
Execute it for a test in Boeffla-Config and do not forget to press the save button to store it into your profile.
How do I know my configuration works?
Well, you can either use the tools and apps you used so far to identify the wakelocks you want to block. After the blocker is active, you should not see this blocks anymore growing in time and count.
Alternative, for advanced experts:
Pipe 1 into file /sys/class/misc/boeffla_wake_blocker/debug.
This will enable Boeffla wakelock blocker to log lot's of information into the kernel log (make sure kernel logger is activated in Boeffla-Config, otherwise you won't see anything).
By doing a
dmesg -c | grep "Boeffla WL"
in a terminal, you will see all wakelocks that are requested from the kernel and all which are being blocked (or not) in real time.
Do not forget to pipe 0 into the debug file again afterwards, as your log really gets flooded by useless messages you are usually not interested in.
Last not least: Switching this debug function on for a while of course can also help you to identify wakelocks you want to try and block.