summaryrefslogtreecommitdiffstats
path: root/logd/LogStatistics.h
Commit message (Collapse)AuthorAgeFilesLines
* logd: optimize code hotspotsMark Salyzyn2015-11-011-2/+2
| | | | | | | | | | | 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-0/+1
| | | | | | Move prototypes from LogBufferElement.h to LogUtils.h Change-Id: I55e42e17e6c997e35b2b78b87fd2f84f8f393282
* logd: serialize accesses to stats helpersMark Salyzyn2015-06-251-1/+1
| | | | | | | | | | | | | (cherry pick from commit ed777e9eece54bf899f1a77a83f8b702970de686) Quick low-risk to resolve possible hash table corruption. Resolved an unlikely path memory leak. ToDo: replace lock with nested lock so no lock helpers are required. Bug: 22068332 Change-Id: I303ab06608502c7d61d42f111a9c43366f184d0c
* logd: switch to unordered_map from BasicHashtableMark Salyzyn2015-06-041-30/+34
| | | | | | | | | | | | (charry pick from commit 511338dd575572d567c04d69eaea60627b6c3452) BasicHashtable is relatively untested, move over to a C++ template library that has more bake time. Bug: 20419786 Bug: 21590652 Bug: 20500228 Change-Id: I926aaecdc8345eca75c08fdd561b0473504c5d95
* logd: Add TID statisticsMark Salyzyn2015-05-131-0/+56
| | | | | | | (cherry pick from commit 17ed6797df722464eb5cc6dfc3e1e32aec284b70) Bug: 19608965 Change-Id: Ifbf0b00c48ef12b5970b9f9f217bd1dd8f587f2c
* logd: Add Tag statisticsMark Salyzyn2015-05-121-2/+25
| | | | | | | | | | | | | (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: pidToName deficiencyMark Salyzyn2015-05-121-0/+4
| | | | | | | | (Cherry pick from commit aa43ae2268076227e8b72ea095f8aeac439b3168) any logging in zygote permanently sets the pidToName Change-Id: I0b8fdc96fb5965a04d4dc4293c39815beef5eb8e
* logd: class hierarcy for Uid and Pid statistics.Mark Salyzyn2015-05-071-24/+111
| | | | | | | | | | | | | | (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: annotate worst-UID pruned entriesMark Salyzyn2015-04-101-5/+19
| | | | | | | | | | | | | | | | - 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: Add Pid statisticsMark Salyzyn2015-04-081-4/+80
| | | | | | | | | | | - Optional class of statistics for PID - Enhance pidToName - Enhanced uidToName - Enhance pidToUid - template sort and iteration Bug: 19608965 Change-Id: I04a1f02e9851b62987f9b176908134e455f22d1d
* logd: optimize statisticsMark Salyzyn2015-03-201-140/+25
| | | | | | | | | - Go back to basic requirements - Simplify - use hash tables to minimize memory impact Bug: 19608965 Change-Id: If7becb34354d6415e5c387ecea7d4109a15259c8
* Revert "logd: Add minimum time bucket statistics"Mark Salyzyn2015-03-041-5/+0
| | | | | | | | | | | | | 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: Add control statistics enable/disable.Mark Salyzyn2014-10-061-0/+2
| | | | | | | | | | - 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-061-3/+9
| | | | | | | | | | | - 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: oneline statistics does not report PID goneMark Salyzyn2014-05-011-0/+2
| | | | | | | - oneline, add check for gone - Add pidGone() method, which caches the gone status Change-Id: I8f03daeafb58583c2b08ec6b540486c05da0872d
* logd: Statistics improvementsMark Salyzyn2014-04-251-2/+13
| | | | | | | | - 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: Add pidToUid helperMark Salyzyn2014-04-071-0/+1
| | | | Change-Id: I23ebae1957c027bff6cbc2573a227bf0c44c08a2
* logd: Add pidToName helperMark Salyzyn2014-04-071-1/+16
| | | | Change-Id: Idd8e804ab65feb8dc432150ae701464de1ad5302
* logd: Add minimum time bucket statisticsMark Salyzyn2014-04-011-0/+10
| | | | | | | | | | * 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: logcat: Add LogWhiteBlackListMark Salyzyn2014-03-131-1/+1
| | | | | | | | | | | | | | | - 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: liblog: logcat: Add StatisticsMark Salyzyn2014-03-131-0/+152
- 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