summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Salyzyn2016-09-26 15:21:05 -0500
committerMark Salyzyn2016-10-18 11:48:55 -0500
commite455373b57bc09551eaa2e595bcecbd39acf6a1a (patch)
tree89fdc084beb7afb82c916eb3efe2a2655e8f02e7 /include/private
parentc1f74ca5aaa71513bdca60ea399116b0746676cd (diff)
downloadplatform-system-core-e455373b57bc09551eaa2e595bcecbd39acf6a1a.tar.gz
platform-system-core-e455373b57bc09551eaa2e595bcecbd39acf6a1a.tar.xz
platform-system-core-e455373b57bc09551eaa2e595bcecbd39acf6a1a.zip
liblog: Add private interfaces for buffer size properties
Add private function __android_logger_get_buffer_size() to read properties and compose the default buffer size. This interface complements the existing android_looger_get_size() which returns the logd setting which can differ at runtime. For use in logd and dumpstate. Side effect is we also add the private functions __android_logger_property_get_bool() and __android_logger_valid_buffer_size() for reuse in logd. Test: gTest liblog-unit-test, logd-unit-tests and logcat-unit-tests in combination with commit 'logd: Use private interfaces for buffer size properties' Bug: 31750617 Change-Id: Id95cb68f775ef6b427c122e10f6f8291d336d184
Diffstat (limited to 'include/private')
-rw-r--r--include/private/android_logger.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/private/android_logger.h b/include/private/android_logger.h
index 94095d1df..02764d3d3 100644
--- a/include/private/android_logger.h
+++ b/include/private/android_logger.h
@@ -21,6 +21,7 @@
21 21
22/* Android private interfaces */ 22/* Android private interfaces */
23 23
24#include <stdbool.h>
24#include <stdint.h> 25#include <stdint.h>
25#include <sys/types.h> 26#include <sys/types.h>
26 27
@@ -132,6 +133,20 @@ int __android_log_security(); /* Device Owner is present */
132 133
133int __android_log_is_debuggable(); 134int __android_log_is_debuggable();
134 135
136#define BOOL_DEFAULT_FLAG_TRUE_FALSE 0x1
137#define BOOL_DEFAULT_FALSE 0x0 /* false if property not present */
138#define BOOL_DEFAULT_TRUE 0x1 /* true if property not present */
139#define BOOL_DEFAULT_FLAG_PERSIST 0x2 /* <key>, persist.<key>, ro.<key> */
140#define BOOL_DEFAULT_FLAG_ENG 0x4 /* off for user */
141#define BOOL_DEFAULT_FLAG_SVELTE 0x8 /* off for low_ram */
142bool __android_logger_property_get_bool(const char *key, int flag);
143
144#define LOG_BUFFER_SIZE (256 * 1024) /* Tuned with ro.logd.size per-platform */
145#define LOG_BUFFER_MIN_SIZE (64 * 1024UL)
146#define LOG_BUFFER_MAX_SIZE (256 * 1024 * 1024UL)
147unsigned long __android_logger_get_buffer_size(log_id_t logId);
148bool __android_logger_valid_buffer_size(unsigned long value);
149
135#if defined(__cplusplus) 150#if defined(__cplusplus)
136} 151}
137#endif 152#endif