llkd: Disable in userdebug builds by default

While llkd helps in discovering issues in apps which leave zombies, it
creates issues for dogfooders when apps are killed. Disable it by
default.

Bug: 202411543
Test: boot and check llkd not running
Test: `setprop ro.llk.enable true` enables llkd
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: If93bf9e981eaa3921a9da5f3160db26c4fe17e66
This commit is contained in:
Suren Baghdasaryan 2021-11-04 15:29:01 -07:00
parent a86af7c9b1
commit 2b92541e7f
3 changed files with 3 additions and 12 deletions

View file

@ -1283,8 +1283,7 @@ bool llkInit(const char* threadname) {
llkEnableSysrqT &= !llkLowRam;
if (debuggable) {
llkEnableSysrqT |= llkCheckEng(LLK_ENABLE_SYSRQ_T_PROPERTY);
if (!LLK_ENABLE_DEFAULT) { // NB: default is currently true ...
llkEnable |= llkCheckEng(LLK_ENABLE_PROPERTY);
if (!LLK_ENABLE_DEFAULT) {
khtEnable |= llkCheckEng(KHT_ENABLE_PROPERTY);
}
}

View file

@ -1,5 +1,5 @@
on property:ro.debuggable=1
setprop llk.enable ${ro.llk.enable:-1}
setprop llk.enable ${ro.llk.enable:-0}
setprop khungtask.enable ${ro.khungtask.enable:-1}
on property:ro.llk.enable=eng

View file

@ -69,13 +69,9 @@ void execute(const char* command) {
seconds llkdSleepPeriod(char state) {
auto default_eng = android::base::GetProperty(LLK_ENABLE_PROPERTY, "eng") == "eng";
auto default_enable = LLK_ENABLE_DEFAULT;
if (!LLK_ENABLE_DEFAULT && default_eng &&
android::base::GetBoolProperty("ro.debuggable", false)) {
default_enable = true;
}
default_enable = android::base::GetBoolProperty(LLK_ENABLE_PROPERTY, default_enable);
if (default_eng) {
GTEST_LOG_INFO << LLK_ENABLE_PROPERTY " defaults to \"eng\" thus "
GTEST_LOG_INFO << LLK_ENABLE_PROPERTY " defaults to "
<< (default_enable ? "true" : "false") << "\n";
}
// Hail Mary hope is unconfigured.
@ -108,10 +104,6 @@ seconds llkdSleepPeriod(char state) {
rest();
}
default_enable = LLK_ENABLE_DEFAULT;
if (!LLK_ENABLE_DEFAULT && (android::base::GetProperty(LLK_ENABLE_PROPERTY, "eng") == "eng") &&
android::base::GetBoolProperty("ro.debuggable", false)) {
default_enable = true;
}
default_enable = android::base::GetBoolProperty(LLK_ENABLE_PROPERTY, default_enable);
if (default_enable) {
execute("start llkd-1");