diff options
author | Greg Kaiser <gkaiser@google.com> | 2024-02-29 22:44:52 +0000 |
---|---|---|
committer | Greg Kaiser <gkaiser@google.com> | 2024-02-29 22:50:00 +0000 |
commit | 99c545d3098018a544cb292e1501daca694bee0f (patch) | |
tree | a4531a2f66af1b1abf718a5c0634ce8f142ce10d | |
parent | 3bfd963895d670455cc8dfd6a49aab2022065ab8 (diff) | |
download | logging-99c545d3098018a544cb292e1501daca694bee0f.tar.gz |
Use standard buffer size when debugging low_ram
This change has no impact on RAM usage in "user" builds.
This change increases RAM usage in "userdebug" and "eng" builds
of low_ram targets.
In general, low_ram devices want to minimize their RAM usage,
so using a lower buffer size here makes sense. However, when
debugging, the cost of ~1.5MB RAM is generally worth it to make
sure we have more context in logcat, especially from boot, to
find issues.
Bug: 327647503
Test: Confirmed a mokey_go32 userdebug build's logcat captures more data ("adb logcat -d > file.txt" gets around 2MB now), and that "adb bugreport" still does not time out.
Change-Id: I47628d3f3347592eedac969b8c51ab9dd2ae8d36
-rw-r--r-- | logd/LogSize.cpp | 7 | ||||
-rw-r--r-- | logd/README.property | 3 |
2 files changed, 8 insertions, 2 deletions
diff --git a/logd/LogSize.cpp b/logd/LogSize.cpp index cbc2090e..b9d41ce1 100644 --- a/logd/LogSize.cpp +++ b/logd/LogSize.cpp @@ -77,7 +77,12 @@ size_t GetBufferSizeFromProperties(log_id_t log_id) { } } - if (android::base::GetBoolProperty("ro.config.low_ram", false)) { + /* + * For non-debuggable low_ram devices, we want to save memory here and use + * the minimum size. + */ + const auto isLowRam = android::base::GetBoolProperty("ro.config.low_ram", false); + if (isLowRam && !isDebuggable) { return kLogBufferMinSize; } diff --git a/logd/README.property b/logd/README.property index 0f07eddf..cd0d04ad 100644 --- a/logd/README.property +++ b/logd/README.property @@ -33,7 +33,8 @@ ro.logd.size number svelte default for persist.logd.size. Larger persist.logd.size.<buffer> number ro Size of the buffer for <buffer> log ro.logd.size.<buffer> number svelte default for persist.logd.size.<buffer> ro.config.low_ram bool false if true, ro.logd.kernel defaults to false, - and logd.size is 64K instead of 256K. + and (if ro.debuggable is unset/false) + logd.size is 64K instead of 256K. persist.logd.filter string Pruning filter to optimize content. At runtime use: logcat -P "<string>" ro.logd.filter string "~! ~1000/!" default for persist.logd.filter. |