summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Salyzyn2015-02-09 10:21:05 -0600
committerMark Salyzyn2015-04-15 21:43:28 -0500
commit202e153f94a0957185ae4b4bed4c5356513e4322 (patch)
treea98f097195a246e9b9fa41af35815208db3fb1b8 /logd/LogListener.cpp
parentc47b0d5278fc403e6a30ea6f4225699b16613879 (diff)
downloadplatform-system-core-202e153f94a0957185ae4b4bed4c5356513e4322.tar.gz
platform-system-core-202e153f94a0957185ae4b4bed4c5356513e4322.tar.xz
platform-system-core-202e153f94a0957185ae4b4bed4c5356513e4322.zip
logd: propagate ::log status
Add a return value for the ::log() methods, this allows us to optimize the wakeup for the readers to only occur when the log message is actually placed. This is for a future where we may dedupe identical log messages, filter out log messages, and certainly if we filter the messages out with an internal logd check of __android_log_is_loggable(). Change-Id: I763b2a7c29502ab7fa0a5d5022c7b60244fcfde4
Diffstat (limited to 'logd/LogListener.cpp')
-rw-r--r--logd/LogListener.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/logd/LogListener.cpp b/logd/LogListener.cpp
index 3b4ef8822..05ced062b 100644
--- a/logd/LogListener.cpp
+++ b/logd/LogListener.cpp
@@ -98,10 +98,11 @@ bool LogListener::onDataAvailable(SocketClient *cli) {
98 // NB: hdr.msg_flags & MSG_TRUNC is not tested, silently passing a 98 // NB: hdr.msg_flags & MSG_TRUNC is not tested, silently passing a
99 // truncated message to the logs. 99 // truncated message to the logs.
100 100
101 logbuf->log((log_id_t)header->id, header->realtime, 101 if (logbuf->log((log_id_t)header->id, header->realtime,
102 cred->uid, cred->pid, header->tid, msg, 102 cred->uid, cred->pid, header->tid, msg,
103 ((size_t) n <= USHRT_MAX) ? (unsigned short) n : USHRT_MAX); 103 ((size_t) n <= USHRT_MAX) ? (unsigned short) n : USHRT_MAX) >= 0) {
104 reader->notifyNewLog(); 104 reader->notifyNewLog();
105 }
105 106
106 return true; 107 return true;
107} 108}