summaryrefslogtreecommitdiffstats
path: root/logd/LogBuffer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* logd: replace internal CLOCK_MONOTONIC use with sequence numbersMark Salyzyn2015-03-181-17/+23
| | | | | | | | | - switch to simpler and faster internal sequence number, drops a syscall overhead on 32-bit platforms. - add ability to break-out of flushTo loop with filter return -1 allowing in reduction in reader overhead. Change-Id: Ic5cb2b9afa4d9470153971fc9197b07279e2b79d
* logd: add reinit commandMark Salyzyn2015-03-121-4/+8
| | | | | | | | | | - respond to SIGHUP - respond to logd command "reinit" - respond to logd --reinit - reopens files on /data, eg: re-read of persistent properties Bug: 19681572 Change-Id: Iadac58e6653f027cb7355497bd675eef376ce0a8
* Revert "logd: Add minimum time bucket statistics"Mark Salyzyn2015-03-041-19/+1
| | | | | | | | | | | | | This forward port reverts commit e457b74ce6ee6d799812dc2ec5e4b8b18bcd3e91 No longer as necessary once we add liblog: Instrument logging of logd write drops Although this provided an indication of how close statistically we were to overloading logd it is simpler to understand fails thus to hunt and peck a corrected value for /proc/sys/net/unix/max_dgram_qlen Change-Id: I2b30e0fc30625a48fd11a12c2d2cc6a41f26226f
* logd: fix persistent blocking reader performanceDragoslav Mitrinovic2015-01-241-1/+18
| | | | | | | | | | | | | | | logd suffers major performance degradation when persistent (blocking) client reader connects to it (e.g. logcat). The root cause of the degradation is that each time when reader is notified of the arrival of new log entries, the reader commences its search for the new entries from the beginning of the linked list (oldest entries first). This commit alters the search to start from the end of the linked list and work backwards. This dramatically decreases logd CPU consumption when blocking reader is connected, and increases the maximum logging throughput (before the logs start getting lost) by a factor ~ 20. Change-Id: Ib60955ce05544e52a8b24acc3dcf5863e1e39c5c
* logd: Fix pruningTraianX Schiau2015-01-141-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a scenario in which an on-line (blocking) client is running and a clean is attempted (logcat -c), the following can be observed: 1) the on-line logger seems to freeze 2) any other clear attempt will have no effect What is actually happening: In this case prune function will "instruct" the oldest timeEntry to skip a huge number (very close to ULONG_MAX) of messages, this being the cause of 1. Since the consumer thread will skip all the log entries, mStart updating will also be skipped. So a new cleaning attempt will have the same oldest entry, nothing will be done. Fix description: a. keep a separated skipAhead count for individual log buffers (log_id_t) LogTimeEntry::LogTimeEntry LogTimeEntry::FilterSecondPass LogTimeEntry::skipAhead LogTimeEntry::riggerSkip_Locked b. update LogTimeEntry::mStart even if the current message is skipped LogTimeEntry::FilterSecondPass c. while pruning, only take into account the LogTimeEntrys that are monitoring the log_id in question, and provide a public method of checking this. LogTimeEntry::isWatching LogTimeEntry::FilterFirstPass LogTimeEntry::FilterSecondPass d. Reset the skip cont befor the client thtread starts to sleep, at this point we should be up to date. LogTimeEntry::cleanSkip_Locked LogTimeEntry::threadStart Change-Id: I1b369dc5b02476e633e52578266a644e37e188a5 Signed-off-by: TraianX Schiau <traianx.schiau@intel.com>
* logd: insert order for first entryMark Salyzyn2014-10-141-1/+2
| | | | Change-Id: I39e8e6d32407a1796a0c3a121f9dc4dc5402c3df
* logd: cleanupMark Salyzyn2014-10-061-19/+14
| | | | | | | | | | | - simplify access and control exposure to class list - indent - compile warning - Follow standard naming convention for variables and methods - merge common fragments - Side Effects: none Change-Id: I74796043ac34753c6dd10018719ebc0bcd94e010
* logd: Allow apps to clear their UID-specific dataMark Salyzyn2014-06-131-3/+35
| | | | | Bug: 13501501 Change-Id: Ia72e25fc19430ce63fb359cd9b3f0523d41f5aa8
* logd: used before set warningMark Salyzyn2014-05-231-1/+1
| | | | Change-Id: I30c078f8b22ebe4dcb48d57adf88b3e51b4fa202
* init: logd: Allow Developer settings to adjust logd sizeMark Salyzyn2014-05-131-8/+61
| | | | | | | | | | | | - AID_SYSTEM can set persist.logd.size - AID_SYSTEM can issue command to /dev/socket/logd to change the runtime global log sizes. - Add support for ro.logd.size.* as populated by BoardConfig.mk - Limit size to maximum ~3% of physical memory. Bug: 14563261 Bug: 14627052 Change-Id: I606420db2e9d9d032296e71149e4a5b20cbd1137
* logd: logcat: Add persist.logd.size group of propertiesMark Salyzyn2014-05-061-2/+41
| | | | | | | | | - logd Add persist.logd.size (global), persist.logd.size.<logid> - logcat report a more flexible multiplier in -g command. Bug: 14563261 Bug: 14469172 Change-Id: Ie389caa14ad3ae3d4a3a3cc463425bb9dbc5e483
* logd: Statistics improvementsMark Salyzyn2014-04-251-11/+8
| | | | | | | | - Drop in-place sorting. - Add fast-track for uid sizes and elements. - Add sort() for per-uid and per-pid statistics. Change-Id: Ib8655d4cc0b3bd4e87534522987bcc7fc7a5251a
* logd: liblog: logcat: debuggerd: Add LOG_ID_CRASHMark Salyzyn2014-04-161-1/+1
| | | | Change-Id: Iea453764a1a4fc1661f461f10c641c30150e4d20
* logd: liblog: logcat: enable prune features for userMark Salyzyn2014-04-021-42/+7
| | | | | | - Enable whitelist, blacklist and logsize tuneables for user Change-Id: Id0c283844c71c5263a8cfbebf2e550f7ac415858
* logd: build breakage in userMark Salyzyn2014-04-011-0/+2
| | | | | | build breakage in branch: git_klp-dev-gpl @ 1101951 Change-Id: I4c9681bf4c97368ec19f5a79fef134aba937f337
* logd: Add minimum time bucket statisticsMark Salyzyn2014-04-011-2/+19
| | | | | | | | | | * Only enabled for dev builds because halves performance. - Used to establish if /proc/sys/net/unix/max_dgram_qlen is appropriate for the platform (see logd/LogStatistics.cpp comments) - enabled if logd.dgram_qlen.statistics is not zero/empty Change-Id: Ib8ecfeb75b6f0f954c099a6b1032b8afb5efcbd4
* logd: liblog: Thread IDs missing from logcat -v threadMark Salyzyn2014-03-211-3/+3
| | | | | | | - stuff caller's thread id into the packet. Bug: 13568206 Change-Id: I02d0cdf9b1d9e839ff8969f591db42dfe6e4cc95
* logd: liblog: logcat: Add LogWhiteBlackListMark Salyzyn2014-03-131-27/+132
| | | | | | | | | | | | | | | - 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
* logd: prune by worst offending UIDMark Salyzyn2014-03-131-1/+54
| | | | | | (cherry picked from commit 3c4919e4748d32d7f3e147ab57f4fafee28c7447) Change-Id: I39965007569123ff5eebe01b5bfa555bbcb2dfe7
* logd: liblog: logcat: Add StatisticsMark Salyzyn2014-03-131-14/+31
| | | | | | | | | | | - logd add statistical collection and formatting - liblog add android_logger_get_statistics call - logcat add -S flag - logcat add -b all (cherry picked from commit 51a29c8dc445e4fb89860561933e54a231e6ffb4) Change-Id: I521753b1969ecd4590c956aeeb1557d101059d67
* logd: liblog: 64-bit issuesMark Salyzyn2014-03-051-3/+3
| | | | | | | | | - structure packing - move towards log_time from struct timespec - extend log_time to cover differences between log_time and struct timespec Change-Id: I106ed0b609917306d170044054b5b32645f2a295
* logd: Adjust to match defacto coding styleMark Salyzyn2014-02-261-2/+3
| | | | | | (cherry picked from commit c46f77bd2ad01f3a695416c4cf22d6a9738bb7b8) Change-Id: I80685cdc7116e10c5a5a77abe856fd96804f9117
* logd: prune more aggressively when over the topMark Salyzyn2014-02-261-3/+11
| | | | | | (cherry picked from commit 63c15d50615a4c9e9ad25f601ef9dcb1161d8990) Change-Id: I929dddc7da048c032fb791c7af23f215f8856bf3
* logd: initial checkin.Mark Salyzyn2014-02-261-0/+214
* Create a new userspace log daemon for handling logging messages. Original-Change-Id: I75267df16359684490121e6c31cca48614d79856 Signed-off-by: Nick Kralevich <nnk@google.com> * Merge conflicts * rename new syslog daemon to logd to prevent confusion with bionic syslog * replace racy getGroups call with KISS call to client->getGid() * Timestamps are filed at logging source * insert entries into list in timestamp order * Added LogTimeEntry tail filtration handling * Added region locking around LogWriter list * separate threads for each writer * /dev/socket/logd* permissions Signed-off-by: Mark Salyzyn <salyzyn@google.com> (cherry picked from commit 3e76e0a49760c4970b7cda6153e51026af98e4f3) Author: Nick Kralevich <nnk@google.com> Change-Id: Ice88b1412d8f9daa7f9119b2b5aaf684a5e28098