summaryrefslogtreecommitdiffstats
path: root/logd/LogBufferElement.h
Commit message (Collapse)AuthorAgeFilesLines
* logd: optimize code hotspotsMark Salyzyn2015-11-011-1/+1
| | | | | | | | | | | Discovered that we had a few libc hotspots. Adjust code to generally reduce or nullify the number of calls to malloc, free, strlen, strcmp, strncmp, memcmp & strncasecmp. Total gain looks to be about 3% of logd's processing time. malloc still contributes to 3%, but all others are now total 0.5%. Bug: 23685592 Change-Id: Ife721121667969260cdb8b055524ae90f5911278
* logd: Add LogUtils.hMark Salyzyn2015-11-011-21/+0
| | | | | | Move prototypes from LogBufferElement.h to LogUtils.h Change-Id: I55e42e17e6c997e35b2b78b87fd2f84f8f393282
* logd: filters remove leading expire messages and rateMark Salyzyn2015-06-051-1/+2
| | | | | | | | | | | | | | | | | | | (cherry pick from commit 047cc0729fd837a03b99db901941c1421ef15f96) - Cleanup resulting from experience and feedback - When filtering inside logd, drop any leading expire messages, they are cluttering up leading edge of tombstones (which filter by pid) - Increase and introduce EXPIRE_RATELIMIT from 1 to 10 seconds - Increase EXPIRE_THRESHOLD from 4 to 10 count - Improve the expire messages from: logd : uid=1000(system) too chatty comm=com.google.android.phone, expire 2800 lines change tag to be more descriptive, and reduce accusatory tone to: chatty : uid=1000(system) com.google.android.phone expire 2800 lines - if the UID name forms a prefix for comm name, then drop UID name Change-Id: Ied7cc04c0ab3ae02167649a0b97378e44ef7b588
* logd: worst-UID only to preserve a dayMark Salyzyn2015-05-201-0/+5
| | | | | | | | | | (cherry pick from commit 833a9b1e38ce65f2cdf3ebd095aaa99a92eb9467) Do not invoke worst-UID pruning in the face of other UIDs logs that are more than a day old, switch to pruning oldest only. Change-Id: Icf988b8d5458400a660d0f8e9d2df3f9d9a4c2d9
* logd: Add TID statisticsMark Salyzyn2015-05-131-0/+1
| | | | | | | (cherry pick from commit 17ed6797df722464eb5cc6dfc3e1e32aec284b70) Bug: 19608965 Change-Id: Ifbf0b00c48ef12b5970b9f9f217bd1dd8f587f2c
* logd: Add klogdMark Salyzyn2015-05-131-1/+1
| | | | | | | | | | | | | | | | | | (cherry pick from commit ae4d928d816e30dbe57c2c321b0f0759d0567b3f) - Add a klogd to collect the kernel logs and place them into a new kernel log buffer - Parse priority, tag and message from the kernel log messages. - Turn off pruning for worst UID for the kernel log buffer - Sniff for 'PM: suspend exit', 'PM: suspend enter' and 'Suspended for' messages and correct the internal definition time correction against monotonic dynamically. - Discern if we have monotonic or real time (delineation 1980) in audit messages. - perform appropriate math to correct the timestamp to be real time - filter out any external sources of kernel logging Change-Id: I8d4c7c5ac19f1f3218079ee3a05a50e2ca55f60d
* logd: Add Tag statisticsMark Salyzyn2015-05-121-0/+5
| | | | | | | | | | | | | (cherry pick from commit 344bff4391dd434dda501e812f18f524290c5a7c) - Optional class of statistics for events Tags - export tagToName from LogBuffer (located in main.cp to address https://android-review.googlesource.com/#/c/110204) - Can not handle dropped because getTag() can not work, will need to be fixed if we start filtering. Bug: 19608965 Change-Id: I7b90607ca588bf37bab71f19b1570a290e772776
* logd: class hierarcy for Uid and Pid statistics.Mark Salyzyn2015-05-071-0/+3
| | | | | | | | | | | | | | (Cherry pick from commit 81b3eabc49736b89c4f99940f79785074955eaa5) Add EntryBase and EntryBaseDropped base classes for statistical entries to inherit from. Abstract add(), subtract() and drop() methods to common LogBufferElement in each for entry policy decisions. Some move of details out of LogStatistics.cpp and place them into LogStatistics.h. Add statistical add(), subtract() and drop() methods to hash table to call entries for policy. Bug: 19608965 Change-Id: Ib8a33a8fe28871ef165d1632c6546a5c606231e8
* logd: improve details on chatty recordsMark Salyzyn2015-04-301-3/+8
| | | | | | | | | | | | | (Cherry pick from commit 21fb7e0b753b2251369bfaa1c6f6a09e58e64437) - Report applications UID, TID/PID by name. - change wording to have an accurate connotation - drop privilege check since filtered upstream Bug: 19608965 Bug: 20334069 Bug: 20370119 Change-Id: I2b1c26580b4c2de293874214ff5ae745546f3cca
* logd: disable worst uid prune for events bufferMark Salyzyn2015-04-101-0/+4
| | | | | | | | | | There is some usage statistics that would be hurt by pruning by UID, since _all_ usage statistics come from system_server. In other words we expect it to be chatty. Until we formulate and evaluate a better (eg: per-tag?) filtration mechanism, lets hold off pruning by UID. Bug: 19608965 Change-Id: Iddd45a671e13bdcf3394c20919ad1f2e4ef36616
* logd: annotate worst-UID pruned entriesMark Salyzyn2015-04-101-2/+17
| | | | | | | | | | | | | | | | - internal dropped entries are associated by prune by worst UID and are applied by UID and by PID - track dropped entries by rewriting them in place - merge similar dropped entries together for same UID(implied), PID and TID so that blame can more clearly be placed - allow aging of dropped entries by the general backgound pruning - report individual dropped entries formatted to reader - add statistics to track dropped entries by UID, the combination of statistics and dropped logging can track over-the-top Chattiest clients. Bug: 19608965 Change-Id: Ibc68480df0c69c55703270cd70c6b26aea165853
* logd: uidToName improvementMark Salyzyn2015-04-081-0/+8
| | | | | | | | - read packages.list to acquire package names - hijack the reinit handler as a privileged worker Bug: 19608965 Change-Id: If7becb34354d6415e5c387ecea7d4109a15259c9
* logd: optimize statisticsMark Salyzyn2015-03-201-1/+2
| | | | | | | | | - 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-181-4/+7
| | | | | | | | | - 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: liblog: Thread IDs missing from logcat -v threadMark Salyzyn2014-03-211-1/+4
| | | | | | | - stuff caller's thread id into the packet. Bug: 13568206 Change-Id: I02d0cdf9b1d9e839ff8969f591db42dfe6e4cc95
* 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: initial checkin.Mark Salyzyn2014-02-261-0/+50
* 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