From 2b92541e7f4882ad68f89aa78866df0a404d6ea7 Mon Sep 17 00:00:00 2001 From: Suren Baghdasaryan Date: Thu, 4 Nov 2021 15:29:01 -0700 Subject: [PATCH] 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 Change-Id: If93bf9e981eaa3921a9da5f3160db26c4fe17e66 --- llkd/libllkd.cpp | 3 +-- llkd/llkd-debuggable.rc | 2 +- llkd/tests/llkd_test.cpp | 10 +--------- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/llkd/libllkd.cpp b/llkd/libllkd.cpp index c4c58eef3..42602e9ee 100644 --- a/llkd/libllkd.cpp +++ b/llkd/libllkd.cpp @@ -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); } } diff --git a/llkd/llkd-debuggable.rc b/llkd/llkd-debuggable.rc index 8697e9ae7..8355e9d96 100644 --- a/llkd/llkd-debuggable.rc +++ b/llkd/llkd-debuggable.rc @@ -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 diff --git a/llkd/tests/llkd_test.cpp b/llkd/tests/llkd_test.cpp index 475512c38..8eb9b001f 100644 --- a/llkd/tests/llkd_test.cpp +++ b/llkd/tests/llkd_test.cpp @@ -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");