logd: liblog: logcat: Add LogWhiteBlackList

- liblog android_logger_get_log_size and android_logger_get_readable_size
  adjusted to return long instead of int because of -G flag extending range

NB: ifdef'd only for userdebug and eng builds

- liblog Add android_logger_[sg]et_prune_list and android_logger_set_log_size
- logcat Add -P, -p and -G flags
- logd Add LogWhiteBlackList and configurable log size

(cherry picked from commit 18a5432158ad43b8faefe4950b30e760200ce0b4)

Change-Id: I1572338c1b34bd968ad7867857ef708156ec3b6a
diff --git a/logd/LogStatistics.cpp b/logd/LogStatistics.cpp
index 50ce442..49ee50d 100644
--- a/logd/LogStatistics.cpp
+++ b/logd/LogStatistics.cpp
@@ -335,8 +335,8 @@
     return elements;
 }
 
-size_t LogStatistics::format(char **buf,
-                             uid_t uid, unsigned int logMask, log_time oldest) {
+void LogStatistics::format(char **buf,
+                           uid_t uid, unsigned int logMask, log_time oldest) {
     const unsigned short spaces_current = 13;
     const unsigned short spaces_total = 19;
 
@@ -551,20 +551,5 @@
         }
     }
 
-    // Calculate total buffer size prefix
-    char re_fmt[32];
-    size_t ret;
-    for(size_t l = string.length(), y = 0, x = 6;
-           y != x;
-           y = x, x = strlen(re_fmt) - 2) {
-       snprintf(re_fmt, sizeof(re_fmt), "%zu\n%%s\n\f", l + x);
-       ret = l + x;
-    }
-
-    android::String8 intermediate = string.format(re_fmt, string.string());
-    string.clear();
-
-    *buf = strdup(intermediate.string());
-
-    return ret;
+    *buf = strdup(string.string());
 }