blob: 2693583860ee3c53718107e985b631113e3e3db2 [file] [log] [blame]
Mark Salyzyn12bac902014-02-26 09:50:16 -08001/*
2 * Copyright (C) 2012-2014 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Mark Salyzyn4e756fb2014-05-06 07:34:59 -070017#include <ctype.h>
Mark Salyzyn12bac902014-02-26 09:50:16 -080018#include <stdio.h>
Mark Salyzyn4e756fb2014-05-06 07:34:59 -070019#include <stdlib.h>
Mark Salyzyn12bac902014-02-26 09:50:16 -080020#include <string.h>
Mark Salyzyn7b85c592014-05-09 17:44:18 -070021#include <sys/user.h>
Mark Salyzyn12bac902014-02-26 09:50:16 -080022#include <time.h>
23#include <unistd.h>
24
Mark Salyzyn4e756fb2014-05-06 07:34:59 -070025#include <cutils/properties.h>
Mark Salyzyn12bac902014-02-26 09:50:16 -080026#include <log/logger.h>
27
28#include "LogBuffer.h"
Mark Salyzyn4e756fb2014-05-06 07:34:59 -070029#include "LogReader.h"
Mark Salyzynd774bce2014-02-06 14:48:50 -080030#include "LogStatistics.h"
Mark Salyzync89839a2014-02-11 12:29:31 -080031#include "LogWhiteBlackList.h"
Mark Salyzyn12bac902014-02-26 09:50:16 -080032
Mark Salyzync89839a2014-02-11 12:29:31 -080033// Default
Mark Salyzyn12bac902014-02-26 09:50:16 -080034#define LOG_BUFFER_SIZE (256 * 1024) // Tuned on a per-platform basis here?
Mark Salyzync89839a2014-02-11 12:29:31 -080035#define log_buffer_size(id) mMaxSize[id]
Mark Salyzyn7b85c592014-05-09 17:44:18 -070036#define LOG_BUFFER_MIN_SIZE (64 * 1024UL)
37#define LOG_BUFFER_MAX_SIZE (256 * 1024 * 1024UL)
38
39static bool valid_size(unsigned long value) {
40 if ((value < LOG_BUFFER_MIN_SIZE) || (LOG_BUFFER_MAX_SIZE < value)) {
41 return false;
42 }
43
44 long pages = sysconf(_SC_PHYS_PAGES);
45 if (pages < 1) {
46 return true;
47 }
48
49 long pagesize = sysconf(_SC_PAGESIZE);
50 if (pagesize <= 1) {
51 pagesize = PAGE_SIZE;
52 }
53
54 // maximum memory impact a somewhat arbitrary ~3%
55 pages = (pages + 31) / 32;
56 unsigned long maximum = pages * pagesize;
57
58 if ((maximum < LOG_BUFFER_MIN_SIZE) || (LOG_BUFFER_MAX_SIZE < maximum)) {
59 return true;
60 }
61
62 return value <= maximum;
63}
Mark Salyzyn12bac902014-02-26 09:50:16 -080064
Mark Salyzyn4e756fb2014-05-06 07:34:59 -070065static unsigned long property_get_size(const char *key) {
66 char property[PROPERTY_VALUE_MAX];
67 property_get(key, property, "");
68
69 char *cp;
70 unsigned long value = strtoul(property, &cp, 10);
71
72 switch(*cp) {
73 case 'm':
74 case 'M':
75 value *= 1024;
76 /* FALLTHRU */
77 case 'k':
78 case 'K':
79 value *= 1024;
80 /* FALLTHRU */
81 case '\0':
82 break;
83
84 default:
85 value = 0;
86 }
87
Mark Salyzyn7b85c592014-05-09 17:44:18 -070088 if (!valid_size(value)) {
89 value = 0;
90 }
91
Mark Salyzyn4e756fb2014-05-06 07:34:59 -070092 return value;
93}
94
Mark Salyzyn3fe25932015-03-10 16:45:17 -070095void LogBuffer::init() {
Mark Salyzyn7b85c592014-05-09 17:44:18 -070096 static const char global_tuneable[] = "persist.logd.size"; // Settings App
97 static const char global_default[] = "ro.logd.size"; // BoardConfig.mk
98
99 unsigned long default_size = property_get_size(global_tuneable);
100 if (!default_size) {
101 default_size = property_get_size(global_default);
102 }
Mark Salyzyn4e756fb2014-05-06 07:34:59 -0700103
Mark Salyzync89839a2014-02-11 12:29:31 -0800104 log_id_for_each(i) {
Mark Salyzyn4e756fb2014-05-06 07:34:59 -0700105 char key[PROP_NAME_MAX];
Mark Salyzyn4e756fb2014-05-06 07:34:59 -0700106
Mark Salyzyn7b85c592014-05-09 17:44:18 -0700107 snprintf(key, sizeof(key), "%s.%s",
108 global_tuneable, android_log_id_to_name(i));
109 unsigned long property_size = property_get_size(key);
110
111 if (!property_size) {
112 snprintf(key, sizeof(key), "%s.%s",
113 global_default, android_log_id_to_name(i));
114 property_size = property_get_size(key);
115 }
116
117 if (!property_size) {
118 property_size = default_size;
119 }
120
121 if (!property_size) {
122 property_size = LOG_BUFFER_SIZE;
123 }
124
125 if (setSize(i, property_size)) {
126 setSize(i, LOG_BUFFER_MIN_SIZE);
127 }
Mark Salyzync89839a2014-02-11 12:29:31 -0800128 }
Mark Salyzyn12bac902014-02-26 09:50:16 -0800129}
130
Mark Salyzyn3fe25932015-03-10 16:45:17 -0700131LogBuffer::LogBuffer(LastLogTimes *times)
132 : mTimes(*times) {
133 pthread_mutex_init(&mLogElementsLock, NULL);
134
135 init();
136}
137
Mark Salyzyn71391172014-03-05 07:41:49 -0800138void LogBuffer::log(log_id_t log_id, log_time realtime,
Mark Salyzyn3661dd02014-03-20 16:09:38 -0700139 uid_t uid, pid_t pid, pid_t tid,
140 const char *msg, unsigned short len) {
Mark Salyzyn12bac902014-02-26 09:50:16 -0800141 if ((log_id >= LOG_ID_MAX) || (log_id < 0)) {
142 return;
143 }
144 LogBufferElement *elem = new LogBufferElement(log_id, realtime,
Mark Salyzyn3661dd02014-03-20 16:09:38 -0700145 uid, pid, tid, msg, len);
Mark Salyzyn12bac902014-02-26 09:50:16 -0800146
147 pthread_mutex_lock(&mLogElementsLock);
148
149 // Insert elements in time sorted order if possible
150 // NB: if end is region locked, place element at end of list
151 LogBufferElementCollection::iterator it = mLogElements.end();
152 LogBufferElementCollection::iterator last = it;
Mark Salyzyna222a772014-10-13 16:49:47 -0700153 while (last != mLogElements.begin()) {
154 --it;
Mark Salyzyn5b7a8d82014-02-18 11:23:53 -0800155 if ((*it)->getRealTime() <= realtime) {
Mark Salyzyn12bac902014-02-26 09:50:16 -0800156 break;
157 }
158 last = it;
159 }
Mark Salyzyn5b7a8d82014-02-18 11:23:53 -0800160
Mark Salyzyn12bac902014-02-26 09:50:16 -0800161 if (last == mLogElements.end()) {
162 mLogElements.push_back(elem);
163 } else {
Mark Salyzyn0aaf6cd2015-03-03 13:39:37 -0800164 uint64_t end = 1;
Mark Salyzyn12bac902014-02-26 09:50:16 -0800165 bool end_set = false;
166 bool end_always = false;
167
168 LogTimeEntry::lock();
169
170 LastLogTimes::iterator t = mTimes.begin();
171 while(t != mTimes.end()) {
172 LogTimeEntry *entry = (*t);
173 if (entry->owned_Locked()) {
174 if (!entry->mNonBlock) {
175 end_always = true;
176 break;
177 }
178 if (!end_set || (end <= entry->mEnd)) {
179 end = entry->mEnd;
180 end_set = true;
181 }
182 }
183 t++;
184 }
185
186 if (end_always
Mark Salyzyn0aaf6cd2015-03-03 13:39:37 -0800187 || (end_set && (end >= (*last)->getSequence()))) {
Mark Salyzyn12bac902014-02-26 09:50:16 -0800188 mLogElements.push_back(elem);
189 } else {
190 mLogElements.insert(last,elem);
191 }
192
193 LogTimeEntry::unlock();
194 }
195
Mark Salyzynd774bce2014-02-06 14:48:50 -0800196 stats.add(len, log_id, uid, pid);
Mark Salyzyn12bac902014-02-26 09:50:16 -0800197 maybePrune(log_id);
198 pthread_mutex_unlock(&mLogElementsLock);
199}
200
201// If we're using more than 256K of memory for log entries, prune
Mark Salyzyn9d4e34e2014-01-13 16:37:51 -0800202// at least 10% of the log entries.
Mark Salyzyn12bac902014-02-26 09:50:16 -0800203//
204// mLogElementsLock must be held when this function is called.
205void LogBuffer::maybePrune(log_id_t id) {
Mark Salyzynd774bce2014-02-06 14:48:50 -0800206 size_t sizes = stats.sizes(id);
Mark Salyzync89839a2014-02-11 12:29:31 -0800207 if (sizes > log_buffer_size(id)) {
208 size_t sizeOver90Percent = sizes - ((log_buffer_size(id) * 9) / 10);
Mark Salyzynd774bce2014-02-06 14:48:50 -0800209 size_t elements = stats.elements(id);
Mark Salyzyn9d4e34e2014-01-13 16:37:51 -0800210 unsigned long pruneRows = elements * sizeOver90Percent / sizes;
211 elements /= 10;
212 if (pruneRows <= elements) {
213 pruneRows = elements;
214 }
215 prune(id, pruneRows);
Mark Salyzyn12bac902014-02-26 09:50:16 -0800216 }
217}
218
219// prune "pruneRows" of type "id" from the buffer.
220//
221// mLogElementsLock must be held when this function is called.
Mark Salyzyn276d5352014-06-12 11:16:16 -0700222void LogBuffer::prune(log_id_t id, unsigned long pruneRows, uid_t caller_uid) {
Mark Salyzyn12bac902014-02-26 09:50:16 -0800223 LogTimeEntry *oldest = NULL;
224
225 LogTimeEntry::lock();
226
227 // Region locked?
228 LastLogTimes::iterator t = mTimes.begin();
229 while(t != mTimes.end()) {
230 LogTimeEntry *entry = (*t);
TraianX Schiau6ba427e2014-12-17 10:53:41 +0200231 if (entry->owned_Locked() && entry->isWatching(id)
Mark Salyzyn12bac902014-02-26 09:50:16 -0800232 && (!oldest || (oldest->mStart > entry->mStart))) {
233 oldest = entry;
234 }
235 t++;
236 }
237
Mark Salyzyn5c06ca42014-02-06 18:11:13 -0800238 LogBufferElementCollection::iterator it;
239
Mark Salyzyn276d5352014-06-12 11:16:16 -0700240 if (caller_uid != AID_ROOT) {
241 for(it = mLogElements.begin(); it != mLogElements.end();) {
242 LogBufferElement *e = *it;
243
Mark Salyzyn0aaf6cd2015-03-03 13:39:37 -0800244 if (oldest && (oldest->mStart <= e->getSequence())) {
Mark Salyzyn276d5352014-06-12 11:16:16 -0700245 break;
246 }
247
248 if (e->getLogId() != id) {
249 ++it;
250 continue;
251 }
252
253 uid_t uid = e->getUid();
254
255 if (uid == caller_uid) {
256 it = mLogElements.erase(it);
Mark Salyzyn03a6a1a2014-09-21 14:22:18 -0700257 stats.subtract(e->getMsgLen(), id, uid, e->getPid());
Mark Salyzyn276d5352014-06-12 11:16:16 -0700258 delete e;
259 pruneRows--;
260 if (pruneRows == 0) {
261 break;
262 }
263 } else {
264 ++it;
265 }
266 }
267 LogTimeEntry::unlock();
268 return;
269 }
270
Mark Salyzyn5c06ca42014-02-06 18:11:13 -0800271 // prune by worst offender by uid
272 while (pruneRows > 0) {
273 // recalculate the worst offender on every batched pass
274 uid_t worst = (uid_t) -1;
275 size_t worst_sizes = 0;
276 size_t second_worst_sizes = 0;
277
Mark Salyzyn855c7302014-04-07 14:58:08 -0700278 if ((id != LOG_ID_CRASH) && mPrune.worstUidEnabled()) {
Mark Salyzync89839a2014-02-11 12:29:31 -0800279 LidStatistics &l = stats.id(id);
Mark Salyzyn1867ca42014-04-04 16:35:59 -0700280 l.sort();
281 UidStatisticsCollection::iterator iu = l.begin();
282 if (iu != l.end()) {
283 UidStatistics *u = *iu;
284 worst = u->getUid();
285 worst_sizes = u->sizes();
286 if (++iu != l.end()) {
287 second_worst_sizes = (*iu)->sizes();
Mark Salyzync89839a2014-02-11 12:29:31 -0800288 }
Mark Salyzyn5c06ca42014-02-06 18:11:13 -0800289 }
290 }
291
292 bool kick = false;
293 for(it = mLogElements.begin(); it != mLogElements.end();) {
294 LogBufferElement *e = *it;
295
Mark Salyzyn0aaf6cd2015-03-03 13:39:37 -0800296 if (oldest && (oldest->mStart <= e->getSequence())) {
Mark Salyzyn5c06ca42014-02-06 18:11:13 -0800297 break;
298 }
299
Mark Salyzync89839a2014-02-11 12:29:31 -0800300 if (e->getLogId() != id) {
301 ++it;
302 continue;
303 }
304
305 uid_t uid = e->getUid();
306
Mark Salyzyn03a6a1a2014-09-21 14:22:18 -0700307 if ((uid == worst) || mPrune.naughty(e)) { // Worst or BlackListed
Mark Salyzyn5c06ca42014-02-06 18:11:13 -0800308 it = mLogElements.erase(it);
309 unsigned short len = e->getMsgLen();
Mark Salyzyn03a6a1a2014-09-21 14:22:18 -0700310 stats.subtract(len, id, uid, e->getPid());
Mark Salyzync89839a2014-02-11 12:29:31 -0800311 delete e;
312 pruneRows--;
Mark Salyzyn03a6a1a2014-09-21 14:22:18 -0700313 if (uid == worst) {
314 kick = true;
315 if ((pruneRows == 0) || (worst_sizes < second_worst_sizes)) {
316 break;
317 }
318 worst_sizes -= len;
319 } else if (pruneRows == 0) {
Mark Salyzync89839a2014-02-11 12:29:31 -0800320 break;
321 }
Mark Salyzync402bc72014-04-01 17:19:47 -0700322 } else {
Mark Salyzyn5c06ca42014-02-06 18:11:13 -0800323 ++it;
324 }
325 }
326
Mark Salyzync402bc72014-04-01 17:19:47 -0700327 if (!kick || !mPrune.worstUidEnabled()) {
Mark Salyzyn5c06ca42014-02-06 18:11:13 -0800328 break; // the following loop will ask bad clients to skip/drop
329 }
330 }
331
Mark Salyzync89839a2014-02-11 12:29:31 -0800332 bool whitelist = false;
Mark Salyzyn5c06ca42014-02-06 18:11:13 -0800333 it = mLogElements.begin();
Mark Salyzyn12bac902014-02-26 09:50:16 -0800334 while((pruneRows > 0) && (it != mLogElements.end())) {
335 LogBufferElement *e = *it;
336 if (e->getLogId() == id) {
Mark Salyzyn0aaf6cd2015-03-03 13:39:37 -0800337 if (oldest && (oldest->mStart <= e->getSequence())) {
Mark Salyzync402bc72014-04-01 17:19:47 -0700338 if (!whitelist) {
Mark Salyzync89839a2014-02-11 12:29:31 -0800339 if (stats.sizes(id) > (2 * log_buffer_size(id))) {
340 // kick a misbehaving log reader client off the island
341 oldest->release_Locked();
342 } else {
TraianX Schiau6ba427e2014-12-17 10:53:41 +0200343 oldest->triggerSkip_Locked(id, pruneRows);
Mark Salyzync89839a2014-02-11 12:29:31 -0800344 }
Mark Salyzyn12bac902014-02-26 09:50:16 -0800345 }
346 break;
347 }
Mark Salyzync402bc72014-04-01 17:19:47 -0700348
Mark Salyzync89839a2014-02-11 12:29:31 -0800349 if (mPrune.nice(e)) { // WhiteListed
350 whitelist = true;
351 it++;
352 continue;
353 }
Mark Salyzync402bc72014-04-01 17:19:47 -0700354
Mark Salyzyn12bac902014-02-26 09:50:16 -0800355 it = mLogElements.erase(it);
Mark Salyzynd774bce2014-02-06 14:48:50 -0800356 stats.subtract(e->getMsgLen(), id, e->getUid(), e->getPid());
Mark Salyzyn12bac902014-02-26 09:50:16 -0800357 delete e;
358 pruneRows--;
359 } else {
360 it++;
361 }
362 }
363
Mark Salyzync89839a2014-02-11 12:29:31 -0800364 if (whitelist && (pruneRows > 0)) {
365 it = mLogElements.begin();
366 while((it != mLogElements.end()) && (pruneRows > 0)) {
367 LogBufferElement *e = *it;
368 if (e->getLogId() == id) {
Mark Salyzyn0aaf6cd2015-03-03 13:39:37 -0800369 if (oldest && (oldest->mStart <= e->getSequence())) {
Mark Salyzync89839a2014-02-11 12:29:31 -0800370 if (stats.sizes(id) > (2 * log_buffer_size(id))) {
371 // kick a misbehaving log reader client off the island
372 oldest->release_Locked();
373 } else {
TraianX Schiau6ba427e2014-12-17 10:53:41 +0200374 oldest->triggerSkip_Locked(id, pruneRows);
Mark Salyzync89839a2014-02-11 12:29:31 -0800375 }
376 break;
377 }
378 it = mLogElements.erase(it);
379 stats.subtract(e->getMsgLen(), id, e->getUid(), e->getPid());
380 delete e;
381 pruneRows--;
382 } else {
383 it++;
384 }
385 }
386 }
Mark Salyzync89839a2014-02-11 12:29:31 -0800387
Mark Salyzyn12bac902014-02-26 09:50:16 -0800388 LogTimeEntry::unlock();
389}
390
391// clear all rows of type "id" from the buffer.
Mark Salyzyn276d5352014-06-12 11:16:16 -0700392void LogBuffer::clear(log_id_t id, uid_t uid) {
Mark Salyzyn12bac902014-02-26 09:50:16 -0800393 pthread_mutex_lock(&mLogElementsLock);
Mark Salyzyn276d5352014-06-12 11:16:16 -0700394 prune(id, ULONG_MAX, uid);
Mark Salyzyn12bac902014-02-26 09:50:16 -0800395 pthread_mutex_unlock(&mLogElementsLock);
396}
397
398// get the used space associated with "id".
399unsigned long LogBuffer::getSizeUsed(log_id_t id) {
400 pthread_mutex_lock(&mLogElementsLock);
Mark Salyzynd774bce2014-02-06 14:48:50 -0800401 size_t retval = stats.sizes(id);
Mark Salyzyn12bac902014-02-26 09:50:16 -0800402 pthread_mutex_unlock(&mLogElementsLock);
403 return retval;
404}
405
Mark Salyzync89839a2014-02-11 12:29:31 -0800406// set the total space allocated to "id"
407int LogBuffer::setSize(log_id_t id, unsigned long size) {
408 // Reasonable limits ...
Mark Salyzyn7b85c592014-05-09 17:44:18 -0700409 if (!valid_size(size)) {
Mark Salyzync89839a2014-02-11 12:29:31 -0800410 return -1;
411 }
412 pthread_mutex_lock(&mLogElementsLock);
413 log_buffer_size(id) = size;
414 pthread_mutex_unlock(&mLogElementsLock);
415 return 0;
416}
417
418// get the total space allocated to "id"
419unsigned long LogBuffer::getSize(log_id_t id) {
420 pthread_mutex_lock(&mLogElementsLock);
421 size_t retval = log_buffer_size(id);
422 pthread_mutex_unlock(&mLogElementsLock);
423 return retval;
424}
425
Mark Salyzyn0aaf6cd2015-03-03 13:39:37 -0800426uint64_t LogBuffer::flushTo(
427 SocketClient *reader, const uint64_t start, bool privileged,
428 int (*filter)(const LogBufferElement *element, void *arg), void *arg) {
Mark Salyzyn12bac902014-02-26 09:50:16 -0800429 LogBufferElementCollection::iterator it;
Mark Salyzyn0aaf6cd2015-03-03 13:39:37 -0800430 uint64_t max = start;
Mark Salyzyn12bac902014-02-26 09:50:16 -0800431 uid_t uid = reader->getUid();
432
433 pthread_mutex_lock(&mLogElementsLock);
Dragoslav Mitrinovic81624f22015-01-15 09:29:43 -0600434
Mark Salyzyn0aaf6cd2015-03-03 13:39:37 -0800435 if (start <= 1) {
Dragoslav Mitrinovic81624f22015-01-15 09:29:43 -0600436 // client wants to start from the beginning
437 it = mLogElements.begin();
438 } else {
439 // Client wants to start from some specified time. Chances are
440 // we are better off starting from the end of the time sorted list.
441 for (it = mLogElements.end(); it != mLogElements.begin(); /* do nothing */) {
442 --it;
443 LogBufferElement *element = *it;
Mark Salyzyn0aaf6cd2015-03-03 13:39:37 -0800444 if (element->getSequence() <= start) {
Dragoslav Mitrinovic81624f22015-01-15 09:29:43 -0600445 it++;
446 break;
447 }
448 }
449 }
450
451 for (; it != mLogElements.end(); ++it) {
Mark Salyzyn12bac902014-02-26 09:50:16 -0800452 LogBufferElement *element = *it;
453
454 if (!privileged && (element->getUid() != uid)) {
455 continue;
456 }
457
Mark Salyzyn0aaf6cd2015-03-03 13:39:37 -0800458 if (element->getSequence() <= start) {
Mark Salyzyn12bac902014-02-26 09:50:16 -0800459 continue;
460 }
461
462 // NB: calling out to another object with mLogElementsLock held (safe)
Mark Salyzyn0aaf6cd2015-03-03 13:39:37 -0800463 if (filter) {
464 int ret = (*filter)(element, arg);
465 if (ret == false) {
466 continue;
467 }
468 if (ret != true) {
469 break;
470 }
Mark Salyzyn12bac902014-02-26 09:50:16 -0800471 }
472
473 pthread_mutex_unlock(&mLogElementsLock);
474
475 // range locking in LastLogTimes looks after us
476 max = element->flushTo(reader);
477
478 if (max == element->FLUSH_ERROR) {
479 return max;
480 }
481
482 pthread_mutex_lock(&mLogElementsLock);
483 }
484 pthread_mutex_unlock(&mLogElementsLock);
485
486 return max;
487}
Mark Salyzynd774bce2014-02-06 14:48:50 -0800488
Mark Salyzync89839a2014-02-11 12:29:31 -0800489void LogBuffer::formatStatistics(char **strp, uid_t uid, unsigned int logMask) {
Mark Salyzyn0aaf6cd2015-03-03 13:39:37 -0800490 uint64_t oldest = UINT64_MAX;
Mark Salyzynd774bce2014-02-06 14:48:50 -0800491
492 pthread_mutex_lock(&mLogElementsLock);
493
494 // Find oldest element in the log(s)
495 LogBufferElementCollection::iterator it;
496 for (it = mLogElements.begin(); it != mLogElements.end(); ++it) {
497 LogBufferElement *element = *it;
498
499 if ((logMask & (1 << element->getLogId()))) {
Mark Salyzyn0aaf6cd2015-03-03 13:39:37 -0800500 oldest = element->getSequence();
Mark Salyzynd774bce2014-02-06 14:48:50 -0800501 break;
502 }
503 }
504
Mark Salyzync89839a2014-02-11 12:29:31 -0800505 stats.format(strp, uid, logMask, oldest);
Mark Salyzynd774bce2014-02-06 14:48:50 -0800506
507 pthread_mutex_unlock(&mLogElementsLock);
Mark Salyzynd774bce2014-02-06 14:48:50 -0800508}