diff options
authorMark Salyzyn2015-02-12 17:14:26 -0600
committerMark Salyzyn2015-03-04 15:21:41 -0600
commitd45d36e011bf2a42bffac07424d3990022287f3c (patch)
tree45ca563150afa1e1d44b6fed19d164ab67db9a9f /liblog/README
parent29eb57066c37bf667a56bb4a7143b50664d5eb44 (diff)
liblog: Instrument logging of logd write drops
- If logger system is prostrated, send an event message with the liblog tag from the associated UID and PID with a count of dropped messages once logging is resumed. - Added to the README a description of the error return values. - Describe in the README the appropriate mitigations for dropped messages. - If the caller sees this message, then /proc/sys/net/unix/max_dgram_qlen is likely too small Change-Id: Iaf387b9e5e1b6aa93bebc7481f9e8353732e3229
Diffstat (limited to 'liblog/README')
1 files changed, 27 insertions, 0 deletions
diff --git a/liblog/README b/liblog/README
index 461dfbe98..f29ac045b 100644
--- a/liblog/README
+++ b/liblog/README
@@ -131,6 +131,33 @@ DESCRIPTION
131 when opening the sub-log. It is recommended to open the log 131 when opening the sub-log. It is recommended to open the log
132 ANDROID_LOG_RDONLY in these cases. 132 ANDROID_LOG_RDONLY in these cases.
133 133
135 If messages fail, a negative error code will be returned to the caller.
137 The -ENOTCONN return code indicates that the logger daemon is stopped.
139 The -EBADF return code indicates that the log access point can not be
140 opened, or the log buffer id is out of range.
142 For the -EAGAIN return code, this means that the logging message was
143 temporarily backed-up either because of Denial Of Service (DOS) logging
144 pressure from some chatty application or service in the Android system,
145 or if too small of a value is set in /proc/sys/net/unix/max_dgram_qlen.
146 To aid in diagnosing the occurence of this, a binary event from liblog
147 will be sent to the log daemon once a new message can get through
148 indicating how many messages were dropped as a result. Please take
149 action to resolve the structural problems at the source.
151 It is generally not advised for the caller to retry the -EAGAIN return
152 code as this will only make the problem(s) worse and cause your
153 application to temporarily drop to the logger daemon priority, BATCH
154 scheduling policy and background task cgroup. If you require a group of
155 messages to be passed atomically, merge them into one message with
156 embedded newlines to the maximum length LOGGER_ENTRY_MAX_PAYLOAD.
158 Other return codes from writing operation can be returned. Since the
159 library retries on EINTR, -EINTR should never be returned.
135 syslogd(8) 162 syslogd(8)
136 163