The atrace buffer does not need to be zero-initialized every time.
Test: memset calls from atrace_{begin,end}_body are gone
bug 155788214
Change-Id: I8082b6a9e6d6328f4aee3a22137977e9fae21933
am skip reason: Change-Id Icd184c6fe06a688bd79ef6514bb49dffb706a9a1 with SHA-1 f2d4dc6b8f is in history
Change-Id: If0882fdd3f0862588a7280d54e7488bf3eaac227
am skip reason: Change-Id Icd184c6fe06a688bd79ef6514bb49dffb706a9a1 with SHA-1 f2d4dc6b8f is in history
Change-Id: I48c5542ba3cf6788f4c8f9a1012c9f4ed512d353
am skip reason: Change-Id Icd184c6fe06a688bd79ef6514bb49dffb706a9a1 with SHA-1 cc3588afcb is in history
Change-Id: I0db1201a4a89c5b8d8524252b2d1fb92e0584e2f
am skip reason: Change-Id Icd184c6fe06a688bd79ef6514bb49dffb706a9a1 with SHA-1 f2d4dc6b8f is in history
Change-Id: Ic4e6ca198da33dab422bab6547e8b370f7215437
am skip reason: Change-Id Icd184c6fe06a688bd79ef6514bb49dffb706a9a1 with SHA-1 cc3588afcb is in history
Change-Id: I026cd9148bccc3344bab8cf55c9551a91a3f6cf8
am skip reason: Change-Id Icd184c6fe06a688bd79ef6514bb49dffb706a9a1 with SHA-1 cc3588afcb is in history
Change-Id: Ibcf4aefd7d0eb59a20eab4e9bee337f989c9fe9f
This code has evolved to the point that it LogReader::notifyNewLog()
executes FlushCommand on every socket. FlushCommand then iterates
over all log reader threads in LogTimes and flushes triggers them to
flush logs if they match the client. This can be simplified to simply
looping over all of the reads in LogTimes.
Code readability was the primary motivation here, but note that 64% of
LogReader::notifyNewLog() was spent looping over the sockets, and an
additional 78% of FlushCommand::runSocketCommand() was spent
repeatedly locking and unlocking the LogTimes lock.
Overall, this reduces the cost of LogReader::notifyNewLog() in
LogListener::onDataAvailable() from 5.91% to 2.93%. This is the
critical path for handling incoming log messages, so it's a
non-trivial savings.
Test: logging unit tests
Test: unprivileged clients still cannot view privileged logs
Change-Id: Ic7620978a6c23e5e2cb179ff0c42b7cea52fc011
I added mOldest recently before mentally committing to have new code
follow the Google C++ style guide.
Test: build
Change-Id: I6d5bab5833e14ac3808862598a2a60989d805e18
logd needs a pointer to PruneList, but it should not own it and it
should not have initPrune() or formatPrune() functions.
Test: logging unit tests
Change-Id: Id1668c26d07eb5d1e4cf267f5748c20a79f711ae
It doesn't look like there are any users, since there is a much better
mechanism, `logd --reinit` that exists for this behavior. The
settings app and init.rc use that mechanism and they are the two major
clients that force logd to reinitialize.
This saves us from creating a thread and marginally cleans up
main.cpp.
Test: log reinitialization works
Change-Id: Icdb56b6f59adbba82812231a4f3a6ffd1a7955fc
LogBuffer needs a pointer to LogTags, but it should not own the
instance. It should not provide accessors into LogTags either.
Also, clean up CommandListener a bit.
Test: logging unit tests
Change-Id: Ic0c86a2bac0c4dd80262278588b9fdc2326dbe5b