summaryrefslogtreecommitdiffstats
path: root/logd
Commit message (Collapse)AuthorAgeFilesLines
* logd: statistics: missing commaMark Salyzyn2015-03-201-1/+1
| | | | | | regression from statistics rewrite series resulted in build breakage Change-Id: I71b532b23437b9b5f3af47b18c9110f3d7dda48a
* logd: optimize statisticsMark Salyzyn2015-03-206-924/+281
| | | | | | | | | - Go back to basic requirements - Simplify - use hash tables to minimize memory impact Bug: 19608965 Change-Id: If7becb34354d6415e5c387ecea7d4109a15259c8
* logd: replace internal CLOCK_MONOTONIC use with sequence numbersMark Salyzyn2015-03-189-66/+77
| | | | | | | | | - 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: report reinitMark Salyzyn2015-03-122-9/+23
| | | | | Bug: 19681572 Change-Id: I343b9d108f064f87df79512a0fdf1b35513c3136
* logd: add reinit commandMark Salyzyn2015-03-125-19/+143
| | | | | | | | | | - 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
* logd: build cleanupMark Salyzyn2015-03-091-1/+10
| | | | | | - Hard code the "auditd" event tag Change-Id: I5f76fd286628be5c0ca819e8ed775648c0d2fa44
* Revert "logd: Add minimum time bucket statistics"Mark Salyzyn2015-03-047-306/+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: use <endian.h>Mark Salyzyn2015-03-041-18/+15
| | | | Change-Id: Iba843c054ea4fbe1a26c7821b5613fdb5e8001a1
* logd: logd placed into background cgroupMark Salyzyn2015-02-041-0/+5
| | | | Change-Id: I38d7be05ab77fc944a9dbef2b6575d4caa920d08
* Add missing <malloc.h> and <string.h> includes.Elliott Hughes2015-01-282-0/+2
| | | | Change-Id: Ia41756e607663d056e7d2fdd7ecbec7e5841a913
* 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: create private/android_logger.hMark Salyzyn2015-01-231-16/+8
| | | | | | | | | - create a structure to depict the private header expected at logd end of socket. - utilize this new structure instead of unscalable byte stream technique used to unpack in logd. Change-Id: I2d0e5c3531c279f2dc1fbd74807210ff8d804de0
* logd: Fix pruningTraianX Schiau2015-01-143-14/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: auditd remove logDmesg methodMark Salyzyn2014-12-053-34/+44
| | | | | | | | | | | | | - logDmesg method consumes considerable memory resources (typically 128KB depending on kernel) - In the future (eg: klogd, syslogd) there may be need to feed multiple logs or threads with the retrieved data. - By moving the actions of logDmesg into the mainline that instantiates the thread objects, we can leverage a single allocation of the the kernel log allocation. - logDmesg (private) is replaced with log (public) which has a more useful and descriptive purpose for the class. Change-Id: Ie2dd0370661493c1e596a7e486904a0e8caab9ff
* logd: throttle SELinux denials to 20/secNick Kralevich2014-11-193-22/+13
| | | | | | | | | | | Impose a limit of 20 selinux denials per second. Denials beyond that point don't add any value, and have the potential to cause crashes or denial of service attacks. Do some other misc cleanup while I'm here. Bug: 18341932 Change-Id: I6125d629ae4d6ae131d2e53bfa41e1f50277d402
* logd: insert order for first entryMark Salyzyn2014-10-141-1/+2
| | | | Change-Id: I39e8e6d32407a1796a0c3a121f9dc4dc5402c3df
* logd: LogStatistics leakMark Salyzyn2014-10-061-0/+4
| | | | | | - uid = -1 in subtract operation to match add Change-Id: I7d0b85b5334c5264fd04309cb78e0c9aec0ad261
* logd: kill(0,0) issueMark Salyzyn2014-10-061-1/+6
| | | | | | | | - Recognize pid=0 as special case (kernel or pre-init sourced) and refrain from treating it in the general case. Bug: 17526159 Change-Id: I74796043ac34753c6dd10018719ebc0bcd94e012
* logd: Add control statistics enable/disable.Mark Salyzyn2014-10-065-14/+42
| | | | | | | | | | - ro.build.type=user turn off statistics - ro.config.low_ram=true turn off statistics - logd.statistics override Bug: 17526159 Bug: 17526187 Change-Id: I74796043ac34753c6dd10018719ebc0bcd94e00f
* logd: cleanupMark Salyzyn2014-10-064-56/+56
| | | | | | | | | | | - 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: in nonblocking read, sched_yield() synchronizationMark Salyzyn2014-09-291-0/+5
| | | | | | | | - sched_yield and lock synchronization in reader thread startup to give writer thread a chance to catch up Bug: 17512203 Change-Id: I43cf0b4e2829b22b3ab4e537fa95ce13c76a869c
* logd: auditd: report facility LOG_AUTHMark Salyzyn2014-09-281-4/+15
| | | | Change-Id: Ie325e1b58f52b6c728d5cfd6f6b87287fcf32e10
* logd: auditd: kmsg priorityMark Salyzyn2014-09-191-9/+12
| | | | Change-Id: I2016fe140e2daf6c69efbd10aef205fffb931aa1
* logd: fix format-extra-args warning.Chih-Hung Hsieh2014-09-123-13/+28
| | | | Bug: 17409250 Change-Id: Id50ebb57754b12d69ed605d0e2901b8e05c607c6
* Fix for parenthesis errorArseniy Antonov2014-09-031-1/+1
| | | | | | | | Added parentheses as it was suggested by compiler. error: suggest parentheses around operand of '!' or change '&' to '&&' or '!' to '~' [-Werror=parentheses] Change-Id: Ic3746d9804488411d10d460ddfda11f1fad8efef Signed-off-by: Arseniy Antonov <arseniy.antonov@intel.com>
* logd: persistent reader threadsMark Salyzyn2014-08-122-21/+18
| | | | | | | (cherry picked from commit c113c5813ebd620e0bc60ece9a32ea14c08ea237) Bug: 16822776 Change-Id: I5bea468a41089b51108880044f32e2b2df1278e7
* Fix implicit declaration of function 'prctl' in logd.Elliott Hughes2014-07-181-2/+1
| | | | Change-Id: I0f655ad15295739adb8f04ec62c88a220413875e
* logd: test: disable kernel LOGGERMark Salyzyn2014-07-101-5/+3
| | | | | Bug: 15384806 Change-Id: I3072d6dd0618fa9ebe151c78a85eb121327f9df3
* Merge "logd: Allow apps to clear their UID-specific data"Mark Salyzyn2014-06-173-9/+43
|\
| * logd: Allow apps to clear their UID-specific dataMark Salyzyn2014-06-133-9/+43
| | | | | | | | | | Bug: 13501501 Change-Id: Ia72e25fc19430ce63fb359cd9b3f0523d41f5aa8
* | logd: test: deal with spam filter turned offMark Salyzyn2014-06-181-14/+39
| | | | | | | | Change-Id: I759c65e869d0c7cd81063fa7993ba3d67ef9cd06
* | logd: test: modernizeMark Salyzyn2014-06-182-10/+11
|/ | | | | | | | - Correct default tense for kernel or user logger - harden code that parses the benchmark data - give more meaning to the spam filter test Change-Id: I97699037ca9d56718f53f08d22be79092fb431de
* logd: logcat unexpected EOF on slow consolesMark Salyzyn2014-06-061-0/+1
| | | | Change-Id: I3520aa05e080de85df352ef36ae16e0406311f3c
* logd: logcat: debuggerd: audit logs to events and mainMark Salyzyn2014-05-271-26/+81
| | | | | | | | | | | - auditd spawn log copy to events and main - logcat delete events as one of the default logs - debuggerd do not collect events. - squish multiple spaces - switch from strcpy to memmove for overlapping buffers BUG: 14626551 Change-Id: I89b30273ce931ed2b25a53ea9be48e77f4c1bbf4
* logd: used before set warningMark Salyzyn2014-05-231-1/+1
| | | | Change-Id: I30c078f8b22ebe4dcb48d57adf88b3e51b4fa202
* Merge "logd: logcat: debuggerd: auditd logs to events"Mark Salyzyn2014-05-163-33/+54
|\
| * logd: logcat: debuggerd: auditd logs to eventsMark Salyzyn2014-05-153-33/+54
| | | | | | | | | | | | | | | | | | | | | | - auditd switch to recording logs to events log id - logcat add events as one of the default logs - debuggerd collect events log as well. ToDo: debuggerd & bugreport collect intermixed logs. BUG: 14626551 Change-Id: I958f0e729b7596748be57488a38824db5645be7b
* | init: logd: Allow Developer settings to adjust logd sizeMark Salyzyn2014-05-132-9/+62
|/ | | | | | | | | | | | - 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-062-2/+54
| | | | | | | | | - 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: default off by-UID spam filterMark Salyzyn2014-05-061-2/+2
| | | | | Bug: 14469172 Change-Id: I37c8dbcea0490afb994cbe6f033591fea1c58bc8
* logd: build breakage in git_master-nova @ 1151709Mark Salyzyn2014-05-021-1/+1
| | | | Change-Id: Ic7920d1b0930155c20a896720a79af62f8acacc1
* logd: turn on -WerrorMark Salyzyn2014-05-023-5/+2
| | | | | | - Deal with some -Wunused / -Wunused-variable issues Change-Id: Ic86cd7b0680868ad0536198b71a34cb19134fc21
* logd: 64-bit compile issueMark Salyzyn2014-05-021-3/+3
| | | | | | | - ULONG_MAX is used against an uint32 - Add tv_sec_max and tv_nsec_max constants to log_time Change-Id: Ic86cd7b0680868ad0536198b71a34cb19134fc22
* logd: oneline statistics does not report PID goneMark Salyzyn2014-05-012-10/+28
| | | | | | | - oneline, add check for gone - Add pidGone() method, which caches the gone status Change-Id: I8f03daeafb58583c2b08ec6b540486c05da0872d
* logd: add logd.auditd propertyMark Salyzyn2014-04-294-23/+41
| | | | | | | | - permit us a mechanism to disable auditd - standardize property boolean Bug: 14275676 Change-Id: I76f245c6aee511ed44274159e0ea55915b484dda
* logd: add thread setnameMark Salyzyn2014-04-295-0/+25
| | | | | | | - permits easier determination of logd thread at fault in a stack trace from debuggerd. Bug: 14275676 Change-Id: Iac2c523147e2bcce34ab7ddcecd02582c5fa7cc0
* logd: enable UID spam filter and testMark Salyzyn2014-04-252-3/+52
| | | | Change-Id: Ie9c7a744e341e6e64afa14973d4d095717c97933
* logd: Statistics improvementsMark Salyzyn2014-04-253-38/+108
| | | | | | | | - Drop in-place sorting. - Add fast-track for uid sizes and elements. - Add sort() for per-uid and per-pid statistics. Change-Id: Ib8655d4cc0b3bd4e87534522987bcc7fc7a5251a
* Merge "logd: liblog: ALOG silently drops excessively long messages"Mark Salyzyn2014-04-241-1/+1
|\
| * logd: liblog: ALOG silently drops excessively long messagesMark Salyzyn2014-04-241-1/+1
| | | | | | | | | | Bug: 14280914 Change-Id: Idddd29784625094e54144953c29f64692a88eee9