History log of /system/core/logd/LogStatistics.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
bec3c3def945576d59d3344c16e149e6d9154e15 28-Aug-2015 Mark Salyzyn <salyzyn@google.com> logd: Add worst pid of system filter

- Add a new statistic that reports per pid and log_id for AID_SYSTEM
- Add a new pruning filter ~1000/! boolean
- Use this new statistic to prune on worst pid within AID_SYSTEM

Bug: 26029733
Bug: 21615139
Bug: 22855208
Change-Id: Iab5dd28f807dcf03d276372853883f3b6afa8294
/system/core/logd/LogStatistics.cpp
ee3b838e13dc2140ac2051c1012d471effd0fd5f 17-Dec-2015 Mark Salyzyn <salyzyn@google.com> logd: statistics per-pid filter

Primarily gives access to the Chattiest TIDs and TAGs
associated with a pid.

Has a secondary effect of allowing us to pull out the
command line, comm and in some cases the associated
PACKAGE for a specific pid while the logs are still
present even if the executable is gone.

Bug: 26029733
Bug: 21615139
Change-Id: I1ea63165a680a9318360579b70b1512078ed5682
/system/core/logd/LogStatistics.cpp
083b037c0740ca00f72429e4457bfdd4b4d4dfa7 04-Dec-2015 Mark Salyzyn <salyzyn@google.com> logd: liblog: logcat: Add LOG_ID_SECURITY

- Largish commit, buffer and access controls done together
- Add LOG_ID_SECURITY binary content log
- Add "default" meta buffer
- allow LOG_ID_SECURITY only from AID_SYSTEM and AID_ROOT UID & GID
- Use __android_log_security() to gate logging
- Add __android_log_security_bwrite() native access to security
logging.
- Add liblog.__security_buffer end-to-end gTest

Bug: 26029733
Change-Id: Ibcf5b4660c17c1aa6902c0d93f8ffd29c93d9a93
/system/core/logd/LogStatistics.cpp
c723df805a1a3199577cac947cebf2ab53abdb34 24-Aug-2015 Mark Salyzyn <salyzyn@google.com> logd: statistics report chatty effective percentage

Report the ESTIMATED instantaneous percentage decrease or increase
that an UID has to the logs as a result of the chatty filtration.

Bug: 22855208
Change-Id: If1e77afb81a2739a72b39bc7c57071763c1d64d8
/system/core/logd/LogStatistics.cpp
58b8be8906f903ac3d83c41bcb0fb9c7841945f0 30-Sep-2015 Mark Salyzyn <salyzyn@google.com> logd: correct for number of elements in prune

Chatty logs would distort the average log size by elevating the
elements, but not the size. Add statistical collection for the
number of elements that report chatty, and subtract that from
the number of elements to improve the pruning estimate. Pick
minElements as 1% rather than 10% of the total with this more
accurate number of elements, to a minumum of 4.

Bug: 24511000
Change-Id: I3f36558138aa0b2a50e4fac6440c3a8505d95276
/system/core/logd/LogStatistics.cpp
758058ffd8820df71c27db7675c50a90a5fa02b4 22-Aug-2015 Mark Salyzyn <salyzyn@google.com> logd: object layer format statistics

Simplify table generation by placing the line and header formatting
into each type's (UID, PID, TID) object. Switch to const return
values for the ownership passing functions (*ToName() functions
and methods). Use longer variable names to reduce confusion.

Switch from LINES To NUM for pruned column as that more accurately
reflects what is dropped since one entry can contain several lines.

Bug: 22855208
Change-Id: Ib110dce98a68cf5f844eb30f8a192a1f691eeba2
/system/core/logd/LogStatistics.cpp
ddda212faa81d62f637926680cd8163345120f71 02-Oct-2015 Mark Salyzyn <salyzyn@google.com> logd: optimize code hotspots

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
/system/core/logd/LogStatistics.cpp
73160acc5cb5236b30327569e6b51dbfe73e4a0f 20-Aug-2015 Mark Salyzyn <salyzyn@google.com> logd: switch asprintf to std::string

Bug: 23350706
Change-Id: I715cdd4563a09de3680081947a3439f0cac623be
/system/core/logd/LogStatistics.cpp
decbcd9c418a4d076965971e74fd51fab497414b 20-Aug-2015 Mark Salyzyn <salyzyn@google.com> logd: statistics switch to std::string

Bug: 23350706
Change-Id: I5564898c4f67b8fcc43cee64604855f789409482
/system/core/logd/LogStatistics.cpp
511338dd575572d567c04d69eaea60627b6c3452 19-May-2015 Mark Salyzyn <salyzyn@google.com> logd: switch to unordered_map from BasicHashtable

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
/system/core/logd/LogStatistics.cpp
d1371a8b8b55352e19332ba87f4b3ece6db58e1f 13-May-2015 Mark Salyzyn <salyzyn@google.com> Merge "logd: Add TID statistics"
7718778793b106498b931dd708a466cf3a6f6a0f 13-May-2015 Mark Salyzyn <salyzyn@google.com> logd: Cleanup

- Android Coding Standard for Constructors
- Side effects NONE

Change-Id: I2cda9dd73f3ac3ab58f394015cb810820093d47b
/system/core/logd/LogStatistics.cpp
ae4d928d816e30dbe57c2c321b0f0759d0567b3f 15-Oct-2014 Mark Salyzyn <salyzyn@google.com> logd: Add klogd

- 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
/system/core/logd/LogStatistics.cpp
17ed6797df722464eb5cc6dfc3e1e32aec284b70 20-Apr-2015 Mark Salyzyn <salyzyn@google.com> logd: Add TID statistics

Bug: 19608965
Change-Id: Ifbf0b00c48ef12b5970b9f9f217bd1dd8f587f2c
/system/core/logd/LogStatistics.cpp
344bff4391dd434dda501e812f18f524290c5a7c 13-Apr-2015 Mark Salyzyn <salyzyn@google.com> logd: Add Tag statistics

- 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
/system/core/logd/LogStatistics.cpp
023f51f360472f6bb9bad495e55cdb32b5411bc5 29-Apr-2015 Mark Salyzyn <salyzyn@google.com> logd: uidToName add dex2oat UID

- When searching for uidToName from /data/system/packages.list
one must search for the uid % AID_USER;
- If uid % AID_USER is greater than AID_SHARED_GID_START - AID_APP,
then subract it and try again to pick up uidToName.

Change-Id: I24df42957ff7e746fffa5d39484637b1b726b9c0
/system/core/logd/LogStatistics.cpp
81b3eabc49736b89c4f99940f79785074955eaa5 13-Apr-2015 Mark Salyzyn <salyzyn@google.com> logd: class hierarcy for Uid and Pid statistics.

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
/system/core/logd/LogStatistics.cpp
5720d2c168f17afb57eefb6ed762a120a24c8ecb 21-Apr-2015 Mark Salyzyn <salyzyn@google.com> logd: Statistics headers

Answer to the question "Bytes or Lines?"

Change-Id: I352737265aeac63ea8d89e778d4222a9123bdf07
/system/core/logd/LogStatistics.cpp
56c6575da72653c3ffd79baf1b431574d6f7e1ea 15-Apr-2015 Mark Salyzyn <salyzyn@google.com> Merge "logd: syscall optimization"
c32afdf913f082235b1e66f5a57678c7f0723129 14-Apr-2015 Mark Salyzyn <salyzyn@google.com> logd: pidToUid incorrect

Change-Id: I9b0e655780924db125568179771e57b01e80aaae
/system/core/logd/LogStatistics.cpp
ae769238391f7f9fa5c03a436d5f1fd73130e6bd 18-Mar-2015 Mark Salyzyn <salyzyn@google.com> logd: disable worst uid prune for events buffer

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
/system/core/logd/LogStatistics.cpp
ab0dcf682867bd7e1fdebfd8d8f9fafaccfad7f6 16-Mar-2015 Mark Salyzyn <salyzyn@google.com> logd: annotate worst-UID pruned entries

- 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
/system/core/logd/LogStatistics.cpp
c6637859c224b64e899b6bcea3cc4ba303624070 09-Apr-2015 Mark Salyzyn <salyzyn@google.com> logd: Build Breakage

a change slipped in from a rebase conflict, repairing.

Change-Id: Ib6479f88fb044f37b6721035c2f7cc75577c0411
/system/core/logd/LogStatistics.cpp
08739ba71fc1f2659149be760405d622e5b68f06 16-Mar-2015 Mark Salyzyn <salyzyn@google.com> logd: uidToName improvement

- read packages.list to acquire package names
- hijack the reinit handler as a privileged worker

Bug: 19608965
Change-Id: If7becb34354d6415e5c387ecea7d4109a15259c9
/system/core/logd/LogStatistics.cpp
720f6d1d55d936d98cc9752e96f479e03e6d5009 16-Mar-2015 Mark Salyzyn <salyzyn@google.com> logd: Add Pid statistics

- Optional class of statistics for PID
- Enhance pidToName
- Enhanced uidToName
- Enhance pidToUid
- template sort and iteration

Bug: 19608965
Change-Id: I04a1f02e9851b62987f9b176908134e455f22d1d
/system/core/logd/LogStatistics.cpp
e3aeeeeccc260c29ca5907a444f8d746bcc2f8a5 17-Mar-2015 Mark Salyzyn <salyzyn@google.com> logd: syscall optimization

- prset(PR_SET_NAME) call once
- No need to call getuid(), should be AID_LOGD

Change-Id: I4dde0b178bc84e711b355cd7677b0dbf905a0634
/system/core/logd/LogStatistics.cpp
317843decf92ddf63d8110df8169c33546d587c3 20-Mar-2015 Mark Salyzyn <salyzyn@google.com> logd: statistics: missing comma

regression from statistics rewrite series resulted in build breakage

Change-Id: I71b532b23437b9b5f3af47b18c9110f3d7dda48a
/system/core/logd/LogStatistics.cpp
97c1c2beee2cbd8c67c1cd507367e5b084d853c8 10-Mar-2015 Mark Salyzyn <salyzyn@google.com> logd: optimize statistics

- Go back to basic requirements
- Simplify
- use hash tables to minimize memory impact

Bug: 19608965
Change-Id: If7becb34354d6415e5c387ecea7d4109a15259c8
/system/core/logd/LogStatistics.cpp
4ed16b4381e6723670575ff8da3cfe12fe74998a 03-Mar-2015 Mark Salyzyn <salyzyn@google.com> Revert "logd: Add minimum time bucket statistics"

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
/system/core/logd/LogStatistics.cpp
a744b05984a963966cec08758ffe582d241be9d7 28-Jan-2015 Elliott Hughes <enh@google.com> Add missing <malloc.h> and <string.h> includes.

Change-Id: Ia41756e607663d056e7d2fdd7ecbec7e5841a913
/system/core/logd/LogStatistics.cpp
f48ea7c8dcfbf2220ececccb1f4fb2f42df9048c 22-Sep-2014 Mark Salyzyn <salyzyn@google.com> logd: LogStatistics leak

- uid = -1 in subtract operation to match add

Change-Id: I7d0b85b5334c5264fd04309cb78e0c9aec0ad261
/system/core/logd/LogStatistics.cpp
df5aa61f05ccbef441cf8b024d4bbc1b717451f9 21-Sep-2014 Mark Salyzyn <salyzyn@google.com> logd: kill(0,0) issue

- 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
/system/core/logd/LogStatistics.cpp
f5fc50958978fc039bc3207cbfcb140a277442eb 21-Sep-2014 Mark Salyzyn <salyzyn@google.com> logd: Add control statistics enable/disable.

- 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
/system/core/logd/LogStatistics.cpp
e72c6e43668c8c6e1af77e2e5038557581cbf148 21-Sep-2014 Mark Salyzyn <salyzyn@google.com> logd: cleanup

- 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
/system/core/logd/LogStatistics.cpp
634118e261d2a3c6f67212f43a4ec3f075d705b6 13-Sep-2014 Chih-Hung Hsieh <chh@google.com> logd: fix format-extra-args warning.

Bug: 17409250
Change-Id: Id50ebb57754b12d69ed605d0e2901b8e05c607c6
/system/core/logd/LogStatistics.cpp
c3ce224c622e064207d1aff03f2440ca19617b4a 03-Sep-2014 Arseniy Antonov <arseniy.antonov@intel.com> Fix for parenthesis error

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>
/system/core/logd/LogStatistics.cpp
3cb54987857690fa5b73f0192cc052eb55b562f7 30-Apr-2014 Mark Salyzyn <salyzyn@google.com> logd: 64-bit compile issue

- ULONG_MAX is used against an uint32
- Add tv_sec_max and tv_nsec_max constants to log_time

Change-Id: Ic86cd7b0680868ad0536198b71a34cb19134fc22
/system/core/logd/LogStatistics.cpp
fdabe7287609af29793bb6ca15712582ba082521 21-Apr-2014 Mark Salyzyn <salyzyn@google.com> logd: oneline statistics does not report PID gone

- oneline, add check for gone
- Add pidGone() method, which caches the gone status

Change-Id: I8f03daeafb58583c2b08ec6b540486c05da0872d
/system/core/logd/LogStatistics.cpp
c8a576c637ae00577273b778498019dd609fcd15 05-Apr-2014 Mark Salyzyn <salyzyn@google.com> logd: Statistics improvements

- Drop in-place sorting.
- Add fast-track for uid sizes and elements.
- Add sort() for per-uid and per-pid statistics.

Change-Id: Ib8655d4cc0b3bd4e87534522987bcc7fc7a5251a
/system/core/logd/LogStatistics.cpp
8e72c5384b288bc11af60e12686a44e502633e3d 26-Mar-2014 Mark Salyzyn <salyzyn@google.com> logd: Statistics: Add up to 10 chattiest clients

- embellish pid name
- >1% of the logs
- fix PID gone detection (EPERM)
- some ? : cleanup

Change-Id: Iba3b306e1fee43e53931165819a398693910514b
/system/core/logd/LogStatistics.cpp
9101878dd06a74cedeadca3fec3b3db68cba8bf0 08-Apr-2014 Greg Hackmann <ghackmann@google.com> Merge "logd: fix LogStatistics::format freeing wrong pointer"
239605ef64d34ced82c97870e3f3f5c4145be58c 07-Apr-2014 Greg Hackmann <ghackmann@google.com> logd: fix LogStatistics::format freeing wrong pointer

Fixes a leak and use-after-free if a client passes in an
already-allocated target buffer (currently none do)

Change-Id: Ie20c30bd5ba31e1b6db73885bd9d2ebd7e40dc27
Signed-off-by: Greg Hackmann <ghackmann@google.com>
/system/core/logd/LogStatistics.cpp
4ba0387af5acc52e43e4004ccb4c46b8bc700349 07-Apr-2014 Mark Salyzyn <salyzyn@google.com> logd: Add pidToUid helper

Change-Id: I23ebae1957c027bff6cbc2573a227bf0c44c08a2
/system/core/logd/LogStatistics.cpp
9a03863e88da99ba010342c874252089dd771f7f 07-Apr-2014 Mark Salyzyn <salyzyn@google.com> logd: Add pidToName helper

Change-Id: Idd8e804ab65feb8dc432150ae701464de1ad5302
/system/core/logd/LogStatistics.cpp
e457b74ce6ee6d799812dc2ec5e4b8b18bcd3e91 20-Feb-2014 Mark Salyzyn <salyzyn@google.com> logd: Add minimum time bucket statistics

* 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
/system/core/logd/LogStatistics.cpp
dfa7a07f5be656cfafdb4e75916bc9dcd9e592e7 11-Feb-2014 Mark Salyzyn <salyzyn@google.com> logd: liblog: logcat: Add LogWhiteBlackList

- 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
/system/core/logd/LogStatistics.cpp
34facab86b0fe7ec613de92b46b637f864fb0682 06-Feb-2014 Mark Salyzyn <salyzyn@google.com> logd: liblog: logcat: Add Statistics

- 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
/system/core/logd/LogStatistics.cpp