Merge "logd: ro.config.low_ram set buffer size to 64K"

am: 236fecd923

* commit '236fecd92352217e8a3272751b44c1e5a23ad1b2':
  logd: ro.config.low_ram set buffer size to 64K
This commit is contained in:
Mark Salyzyn 2015-12-17 23:54:40 +00:00 committed by android-build-merger
commit 6773967938
3 changed files with 9 additions and 1 deletions

View file

@ -100,6 +100,11 @@ void LogBuffer::init() {
unsigned long default_size = property_get_size(global_tuneable); unsigned long default_size = property_get_size(global_tuneable);
if (!default_size) { if (!default_size) {
default_size = property_get_size(global_default); default_size = property_get_size(global_default);
if (!default_size) {
default_size = property_get_bool("ro.config.low_ram", false) ?
LOG_BUFFER_MIN_SIZE : // 64K
LOG_BUFFER_SIZE; // 256K
}
} }
log_id_for_each(i) { log_id_for_each(i) {

View file

@ -43,6 +43,9 @@ const char *tagToName(uint32_t tag);
bool clientHasLogCredentials(uid_t uid, gid_t gid, pid_t pid); bool clientHasLogCredentials(uid_t uid, gid_t gid, pid_t pid);
bool clientHasLogCredentials(SocketClient *cli); bool clientHasLogCredentials(SocketClient *cli);
// Furnished in main.cpp
bool property_get_bool(const char *key, bool def);
static inline bool worstUidEnabledForLogid(log_id_t id) { static inline bool worstUidEnabledForLogid(log_id_t id) {
return (id == LOG_ID_MAIN) || (id == LOG_ID_SYSTEM) || (id == LOG_ID_RADIO); return (id == LOG_ID_MAIN) || (id == LOG_ID_SYSTEM) || (id == LOG_ID_RADIO);
} }

View file

@ -143,7 +143,7 @@ static int drop_privs() {
} }
// Property helper // Property helper
static bool property_get_bool(const char *key, bool def) { bool property_get_bool(const char *key, bool def) {
char property[PROPERTY_VALUE_MAX]; char property[PROPERTY_VALUE_MAX];
property_get(key, property, ""); property_get(key, property, "");