History log of /system/core/logd/LogBuffer.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
0878a7c167c317ae3169ae16f386b52ae1fc0cc7 11-May-2017 Mark Salyzyn <salyzyn@google.com> logd: logcat --clear respect pruneMargin

While a reader is present, consider it a success, and not busy, if a
buffer is pruned down to pruneMargin plus one second of additional
margin of logspan. If not busy, no need to trigger any mitigations
regarding the readers, or to report any errors.

Side Effects are we no longer mitigate the reader when performing
chatty filtration. This is a positive side effect because we were
getting --wrap wakeups that seemed premature.

Add kickMe() and isBusy() methods to ease maintenance and uniformity
of actions.

Test: gTest liblog-unit-tests, logd-unit-tests & logcat-unit-tests
Test: manual: 'logcat -b all -c' repeat in a loop, at various logging
load levels, simultaneously 'logcat -b' all in another session.
Bug: 38046067
Change-Id: I3d0c8a2d416a25c45504eda3bfe70b6f6e09ab27
/system/core/logd/LogBuffer.h
c4e4823b00a94627e922eada1172688818471b0c 04-May-2017 Mark Salyzyn <salyzyn@google.com> logd: validate and fill in socket credentials

- android::pidToUid() additional checking. Make sure if we have to
convert a PID to an UID that the parse of /proc/<pid>/status
requires a trailing space after the number
- android::tidToPid() added, in the same vein as android::pidToUid().
- stats.tidToPid() added
- If no credentials, set PID to 0 and UID to DEFAULT_OVERFLOWUID
- If credentialed PID is 0, use stats.tidToPid()
- If credentialed UID is DEFAULT_OVERFLOWUID, use stats.pidToUid()

Test: remove +passcred from logd.rc for daemon and confirm very few
UID=65534 or PID=0 cases actually show up
Bug: 37985222
Change-Id: I7d20506e70e67beb3043d1537cf9450ab58dc278
/system/core/logd/LogBuffer.h
fafea32468e0d59c1ce2eb845dd07a0b4e746cf0 28-Apr-2017 Chenjie Luo <cjluo@google.com> Modularize logd.

Separates logd body into a static library liblogd and
virtualize LogBuffer::log to be in a new interface class
LogBufferInterface. User could have different implementation.

Bug: 37756450
Test: liblog-unit-tests, logd-unit-tests and logcat-unit-tests
with (b/37791296).
Change-Id: I1504ff0e992744001b5a2e9abd45692d1318a152
/system/core/logd/LogBuffer.h
3c501b50b41086cde59a6811f4aa5cd3e736f5f2 18-Apr-2017 Mark Salyzyn <salyzyn@google.com> logd: reader/writer element locks

Switch to a reader writer lock for the Element List lock. Also setup
for a reader writer lock for the Times list, but continue to use a
mutex where rdlock() and wrlock() are the same implementation for now.

This should improve general reader performance and prevent blocking of
other reader operations or exit by a single hung logd.reader.per
thread. For example, a full length logcat of an empty buffer (eg:
crash log buffer) will hold a lock while the iterator scans the entire
list.

Test: gTest liblog-unit-tests, logd-unit-tests, logcat-unit-tests
Bug: 37378309
Bug: 37483775
Change-Id: If5723ff4a978e17d828a75321e8f0ba91d4a09e0
/system/core/logd/LogBuffer.h
5836379b2114f47c53485b42ab157104c29b2c4e 17-Apr-2017 Mark Salyzyn <salyzyn@google.com> logd: regression in handling watermark boundary.

Deal with a regression introduced in commit
5a34d6ea43d28f3b5d27bf6dd5b9fa31ec033531 (logd: drop mSequence from
LogBufferElement) where log_time was compared against nsec() time
miscalculating the watermark boundary. When dealing with logcat
-t/-T, or any tail reading, add a margin to prune to back off by a
period of 3 seconds (pruneMargin).

Test: gTest liblog-unit-tests logcat-unit-tests and logd-unit-tests
Bug: 37378309
Change-Id: I72ea858e4e7b5fa91741ea84c40d2e7c3c4aa031
/system/core/logd/LogBuffer.h
ae2abf112ca8555dfc09eb1fc4b8bd637e4bc7cc 31-Mar-2017 Mark Salyzyn <salyzyn@google.com> logd: correctly label identical lines

Move lastTid array from local in LogBuffer::flushTo to per-reader
context in LogTimes::mLastTid and pass into LogBuffer::flushTo.

Replace NULL with nullptr in touched files.

Simplify LogTimeEntry::cleanSkip_Locked initialization of skipAhead
to memset, to match mLastTid memset initialization.

Test: gTest liblog-unit-tests, logd-unit-tests & logcat-unit-tests
Test: adb logcat -b all | grep chatty | grep -v identical
Bug: 36488201
Change-Id: I0c3887f220a57f80c0490be4b182657b9563aa3f
/system/core/logd/LogBuffer.h
5a34d6ea43d28f3b5d27bf6dd5b9fa31ec033531 10-Mar-2017 Mark Salyzyn <salyzyn@google.com> logd: drop mSequence from LogBufferElement

Use getRealTime() instead and leverage private liblog log_time
comparison and math functions. This saves 8 bytes off each
element in the logging database.

Test: gTest liblog-unit-tests logd-unit-tests logcat-unit-tests
Bug: 35373582
Change-Id: Ia55ef8b95cbb2a841ccb1dae9a24f314735b076a
/system/core/logd/LogBuffer.h
501c373916e292764400dbae735f44b33378400f 10-Mar-2017 Mark Salyzyn <salyzyn@google.com> logd: specify clang format

Switch _all_ file's coding style to match to ease all future changes.

SideEffects: None
Test: compile
Bug: 35373582
Change-Id: I470cb17f64fa48f14aafc02f574e296bffe3a3f3
/system/core/logd/LogBuffer.h
407537f798c443a2252fd3bbbd1535f7d6fabc53 22-Feb-2017 Mark Salyzyn <salyzyn@google.com> logd: add getEventTag id= command

This is the precursor for "Plan B" recovery when access to
/dev/event-log-tags is blocked to untrusted zones. Also
deals with mitigating issues with long-lived mappings that
do not update /dev/event-log-tags when dynamically changed.

Test: gTest logd-unit-test --gtest_filter=logd.getEventTag_42
Bug: 31456426
Bug: 35326290
Change-Id: I3db2e73763603727a369da3952c5ab4cf709f901
/system/core/logd/LogBuffer.h
61e9ce6709a12cf39a9471476da3d50339efe466 12-Sep-2016 Mark Salyzyn <salyzyn@google.com> logd: add getEventTag command and service

Will register a new event tag by name and format, and return an
event-log-tags format response with the newly allocated tag.
If format is not specified, then nothing will be recorded, but
a pre-existing named entry will be listed. If name and format are
not specified, list all dynamic entries. If name=* list all
event log tag entries.

Stickiness through logd crash will be managed with the tmpfs file
/dev/event-log-tags and through a reboot with add_tag entries in
the pmsg last logcat event log. On debug builds we retain a
/data/misc/logd/event-log-tags file that aids stickiness and that
can be picked up by the bugreport.

If we detect truncation damage to /dev/event-log-tags, or to
/data/misc/logd/event-log-tags, rebuild file with a new first line
signature incorporating the time so mmap'd readers of the file can
detect the possible change in shape and order.

Manual testing:

Make sure nc (netcat) is built for the target platform on the host:
$ m nc

Then the following can be used to issue a request on the platform:
$ echo -n 'getEventTag name=<name> format="<format>"\0EXIT\0' |
> nc -U /dev/socket/logd

Test: gTest logd-unit-test --gtest_filter=getEventTag*
Bug: 31456426
Change-Id: I5dacc5f84a24d52dae09cca5ee1a3a9f9207f06d
/system/core/logd/LogBuffer.h
a2c022257c5bed56fbc47de25c5d909bbe880f7b 13-Dec-2016 Mark Salyzyn <salyzyn@google.com> logd: record multiple duplicate messages as chatty

If a series of messages arrive from a single source with identical
message content payload, then suppress them and generate a chatty
report. The checking is done on a per log id basis.

This alters the assumption that chatty messages are always at the
oldest entries, they now show up in the middle too. To address this
change in behavior we print the first line, a chatty reference
which internally takes little space, then the last line in the series.

This does not conserve processing time in logd, and certainly has no
impact on the long path of formatting and submitting log messages from
from the source, but it may contribute to memory space and signal to
noise savings under heavy spammy loads.

Test: gTest liblog-unit-tests, logd-unit-tests & logcat-unit-tests
Bug: 33535908
Change-Id: I3160c36d4f4e2f8216f528605a1b3993173f4dec
/system/core/logd/LogBuffer.h
0dd4431072cce3c62876b728cb20aa5b77b11a8d 29-Sep-2016 Mark Salyzyn <salyzyn@google.com> logd: logcat: Replace log/log.h with android/log.h

Should use android/log.h instead of log/log.h as a good example
to all others.

Test: Compile
Bug: 26552300
Bug: 31289077
Change-Id: If4c9711eb57267d4707b03d54a932af9de241b13
/system/core/logd/LogBuffer.h
004cd3c55def10a92888295a9bad5fd0a18b725e 28-Sep-2016 Mark Salyzyn <salyzyn@google.com> liblog: logd: logcat: deprecate log/log_read.h

Always used in combination with log/logger.h except in log_time.cpp,
and not used externally. As a result liblog has to support stl, a
small price to pay since goal is to convert liblog to C++ internally.

Test: compile
Bug: 31456426
Bug: 26552300
Bug: 31289077
Change-Id: I72828ec807d0a2c8e40bbdebd7a69f147a7ca5a9
/system/core/logd/LogBuffer.h
034c475931e8e4da54b499c0056121490f029865 12-Jul-2016 Chih-Hung Hsieh <chh@google.com> Fix google-explicit-constructor warnings in system/core.

* Declare explicit conversion constructors.
* Add NOLINT for implicit conversion constructors.
* Fix also some misaligned indendations.

Bug: 28341362
Change-Id: Idf911f35923b408d92285cc1a053f382ba08c63e
Test: build with clang-tidy
/system/core/logd/LogBuffer.h
6a06694a610d103afdf424b0bb69dc8f7f2b8e5a 15-Jul-2016 Mark Salyzyn <salyzyn@google.com> logd: Worst Tag filter enabled for events buffer

- Add drop logistics to TagTable
- replace uid references to a key reference since it
is an UID for most buffers, but a TAG for the
events and security buffer
- template the find worst entry mechanics into LogFindWorst class

Bug: 30118730
Change-Id: Ibea4be2c50d6ff4b39039e371365fed2453f17a2
/system/core/logd/LogBuffer.h
8fa8896d2ed97eb274c62f0e386dabf2e2a82a45 26-Jan-2016 Mark Salyzyn <salyzyn@google.com> logd: security buffer only AID_SYSTEM reader

- limit AID_SYSTEM uid or gid to read security buffer messages
- adjust liblog tests to reflect the reality of this adjustment

To fully test all security buffer paths and modes

$ su 0,0,0 /data/nativetest/liblog-unit-tests/liblog-unit-tests --gtest_filter=liblog.__security*
$ su 1000,1000,1000 /data/nativetest/liblog-unit-tests/liblog-unit-tests --gtest_filter=liblog.__security*
$ su 2000,2000,2000 /data/nativetest/liblog-unit-tests/liblog-unit-tests --gtest_filter=liblog.__security*

ToDo: Integrate the above individually into the gTest Q/A testing

Bug: 26029733
Change-Id: Idcf5492db78fa6934ef6fb43f3ef861052675651
/system/core/logd/LogBuffer.h
507eb9fec2b062e02cac0b76e35fb435cc9bf3d7 11-Jan-2016 Mark Salyzyn <salyzyn@google.com> logd: prune maintain per-id watermark

Without this change LogBuffer::prune and LogBuffer::erase
contributes 16.7% and 1.79% respectively. With this change,
they contributes 3.06 and 2.33% respectively. Pruning is
performed roughly 1 in every 255 log entries, a periodic
tamer latency spike.

Bug: 23685592
Change-Id: I6ae1cf9f3559bca4cf448efe8bcb2b96a1914c54
/system/core/logd/LogBuffer.h
10b82b683405e9ccd0cc162fa44a2ec6a9f26448 29-Dec-2015 Mark Salyzyn <salyzyn@google.com> logd: isMonotonic improvements

Use 1972 as a right delineation. Otherwise use half way point
between the monotonic and realtime. Treat correction factor as
unsigned, ensure that any wrapping to a negative value is
dropped or set to EPOCH. Acknowledge that we can get a more
accurate time track by acquiring the time rather than relying on
healthd timestamp.

Bug: 26331432
Change-Id: I09075fca58676a30cf7d87baf2d4b0f53795abaa
/system/core/logd/LogBuffer.h
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/LogBuffer.h
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/LogBuffer.h
b6bee33182cedea49199eb2252b3f3b442899c6d 08-Sep-2015 Mark Salyzyn <salyzyn@google.com> liblog: logd: support logd.timestamp = monotonic

if ro.logd.timestamp or persist.logd.timestamp are set to the value
monotonic then liblog writer, liblog printing and logd all switch to
recording/printing monotonic time rather than realtime. If reinit
detects a change for presist.logd.timestamp, correct the older entry
timestamps in place.

ToDo: A corner case condition where new log entries in monotonic time
occur before logd reinit detects persist.logd.timestamp, there
will be a few out-of-order entries, but with accurate
timestamps. This problem does not happen for ro.logd.timestamp
as it is set before logd starts.

NB: This offers a nano second time accuracy on all log entries
that may be more suitable for merging with other system
activities, such as systrace, that also use monotonic time. This
feature is for debugging.

Bug: 23668800
Change-Id: Iee6dab7140061b1a6627254921411f61b01aa5c2
/system/core/logd/LogBuffer.h
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/LogBuffer.h
9b3a2784b94d88492906384ab3f3c9863f6b5eea 13-Oct-2015 Mark Salyzyn <salyzyn@google.com> Merge "logd: use coalesce instead of merge (cleanup)"
1c04253af2077de0250e4082cadd4f9bfffc4ea2 13-Oct-2015 Mark Salyzyn <salyzyn@google.com> Merge "logd: object layer format statistics"
aaad42f47c7363d68ddfb9ef8f1b51972c4d429d 30-Sep-2015 Mark Salyzyn <salyzyn@google.com> logd: use coalesce instead of merge (cleanup)

- switch to coalesce instead of merge in naming of functions
and variables. Confusing since we also to merge-sorts and
other activities in the logger.
- define maxPrune rather than using a number in the code path.

Bug: 24511000
/system/core/logd/LogBuffer.h
c5dc970edc202f89ecdd0c2fe988c7e2b8408bef 17-Sep-2015 Mark Salyzyn <salyzyn@google.com> logd: clear return and deal with busy if readers locked

- Propagate to caller the clearing errors, busy blocked by reader.
- For clear, perform retries within logd with a one second lul each,
telling readers to skip, but on final retry to kill all readers if
problem still persists due to block reader (or high volume logspammer).

Bug: 23711431
Change-Id: Ie4c46bc9480a7f49b96a81fae25a95c603270c33
/system/core/logd/LogBuffer.h
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/LogBuffer.h
831aa297307a038705bc771281ffd53266484b4a 04-Sep-2015 Mark Salyzyn <salyzyn@google.com> logd: worst uid record watermark part four

With part deux we caused an apparent regression by not checking for
stale recorded iterators. This checking was on-purpose bypassesed
when leading prune entries were to be deleted without touching the
statistics engine due to an in-place merge.

Part deux had us leaving iterators we were not focussed on untouched
which in turn because they were left behind, had a much higher
likelihood of being deleted without touching the statistics engine.

Perform the check every delete.

Bug: 23789348
Change-Id: Idc6cc23d1f9e3b6cd9a083139a0de59479fbfe08
/system/core/logd/LogBuffer.h
73160acc5cb5236b30327569e6b51dbfe73e4a0f 20-Aug-2015 Mark Salyzyn <salyzyn@google.com> logd: switch asprintf to std::string

Bug: 23350706
Change-Id: I715cdd4563a09de3680081947a3439f0cac623be
/system/core/logd/LogBuffer.h
c892ea3fa80dfd3d35c5a3b8bfdc73e7b85eaede 20-Aug-2015 Mark Salyzyn <salyzyn@google.com> logd: worst uid record watermark

Hold on to last worst uid watermark and bypass a spike to O(n*n*x)
(n=samples, x=number of spammers) wrt chatty trimming.

Bug: 23327476
Change-Id: I9f21ce95e969b67e576417a760f75c4d86acf364
/system/core/logd/LogBuffer.h
94a89c42fe9521f5ac2d382a172c082ca421d6c3 19-Aug-2015 Mark Salyzyn <salyzyn@google.com> logd: log buffer switch to std::list

Bug: 23350706
Bug: 23327476
Change-Id: Ib0530b9dd5842c6d05c84d7a66f2531c97461067
/system/core/logd/LogBuffer.h
ed777e9eece54bf899f1a77a83f8b702970de686 25-Jun-2015 Mark Salyzyn <salyzyn@google.com> logd: serialize accesses to stats helpers

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
/system/core/logd/LogBuffer.h
21fb7e0b753b2251369bfaa1c6f6a09e58e64437 20-Apr-2015 Mark Salyzyn <salyzyn@google.com> logd: improve details on chatty records

- 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
/system/core/logd/LogBuffer.h
202e153f94a0957185ae4b4bed4c5356513e4322 09-Feb-2015 Mark Salyzyn <salyzyn@google.com> logd: propagate ::log status

Add a return value for the ::log() methods, this allows
us to optimize the wakeup for the readers to only occur
when the log message is actually placed.

This is for a future where we may dedupe identical log
messages, filter out log messages, and certainly if we
filter the messages out with an internal logd check of
__android_log_is_loggable().

Change-Id: I763b2a7c29502ab7fa0a5d5022c7b60244fcfde4
/system/core/logd/LogBuffer.h
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/LogBuffer.h
f7c0f75275d0fde2d8b7614f1501f0ad0cd3a01c 03-Mar-2015 Mark Salyzyn <salyzyn@google.com> logd: replace internal CLOCK_MONOTONIC use with sequence numbers

- 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
/system/core/logd/LogBuffer.h
11e55cb9c1e5efe553e36f1b5c04ab21883f66e1 11-Mar-2015 Mark Salyzyn <salyzyn@google.com> logd: add reinit command

- 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
/system/core/logd/LogBuffer.h
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/LogBuffer.h
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/LogBuffer.h
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/LogBuffer.h
1a240b47903c0dc3d7f23b609b6520f17f11b953 12-Jun-2014 Mark Salyzyn <salyzyn@google.com> logd: Allow apps to clear their UID-specific data

Bug: 13501501
Change-Id: Ia72e25fc19430ce63fb359cd9b3f0523d41f5aa8
/system/core/logd/LogBuffer.h
472e04f2b4b1870f8be789a3f16c2abb664b731a 10-Apr-2014 Mark Salyzyn <salyzyn@google.com> Merge "logd: liblog: logcat: enable prune features for user"
4ba0387af5acc52e43e4004ccb4c46b8bc700349 07-Apr-2014 Mark Salyzyn <salyzyn@google.com> logd: Add pidToUid helper

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

Change-Id: Idd8e804ab65feb8dc432150ae701464de1ad5302
/system/core/logd/LogBuffer.h
1c950479393d42d18829d4009dbdb3a7f03acbb7 02-Apr-2014 Mark Salyzyn <salyzyn@google.com> logd: liblog: logcat: enable prune features for user

- Enable whitelist, blacklist and logsize tuneables for user

Change-Id: Id0c283844c71c5263a8cfbebf2e550f7ac415858
/system/core/logd/LogBuffer.h
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/LogBuffer.h
b992d0d7d34bed62fd16151a68d60d58cc8003ef 21-Mar-2014 Mark Salyzyn <salyzyn@google.com> logd: liblog: Thread IDs missing from logcat -v thread

- stuff caller's thread id into the packet.

Bug: 13568206
Change-Id: I02d0cdf9b1d9e839ff8969f591db42dfe6e4cc95
/system/core/logd/LogBuffer.h
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/LogBuffer.h
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/LogBuffer.h
7e2f83c0bcc3ad8a2840a48be14d302ed79d671c 05-Mar-2014 Mark Salyzyn <salyzyn@google.com> logd: liblog: 64-bit issues

- structure packing
- move towards log_time from struct timespec
- extend log_time to cover differences between
log_time and struct timespec

Change-Id: I106ed0b609917306d170044054b5b32645f2a295
/system/core/logd/LogBuffer.h
0175b0747a1f55329109e84c9a1322dcb95e2848 26-Feb-2014 Mark Salyzyn <salyzyn@google.com> logd: initial checkin.

* 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
/system/core/logd/LogBuffer.h