Commit graph

13 commits

Author SHA1 Message Date
Tom Cherry
121292dd81 liblog: use libbase_headers for TEMP_FAILURE_RETRY
Test: build
Change-Id: Id3b57ff0327d4632e91960e5e70f3aa21992ed15
2020-01-14 09:56:25 -08:00
Tom Cherry
b47aa2a592 liblog: remove more unused code
Cleanup the headers; we really don't want to encourage any more
cutils/list.h usage...

Remove __android_log_uid() since the only remaining users are built
for device, so they can just use getuid() directly.

Test: build
Change-Id: I62be2c1e43d83807deaa9342afcc72459947cf15
2020-01-08 17:11:09 -08:00
Tom Cherry
21bb36c66a liblog: remove the last of the transport structs
Test: build, liblog unit tests
Change-Id: I292662fc64e3163b570c5daeaa8f912fb6ca74e8
2020-01-08 17:11:06 -08:00
Tom Cherry
06e0fced63 liblog: have writers handle their own state
Remove the transport available and open functions since the writers
are able to manage their own state.  Remove the initialization dance
with write_to_log, since it is unneeded once this is removed as well.

Remove the global lock around the close() functions as correct locking
has been added to the writers in a previous change.

Test: logging works, liblog-unit-tests
Change-Id: If7fa11e773763d0b5fcb2e696ad1c88ff4a4cfdf
2019-12-12 16:19:08 -08:00
Tom Cherry
2a6811b4d1 liblog: use a rwlock for writer initialization
The current system of using atomics isn't thread safe and may result
in doubly closing FDs or closing actively used FDs.  The safest way to
do this is to use a rwlock, which should not have a much higher
overhead than the atomics do, as a vast majority of the time, there
will not be writers.

This moves us further away from using the transport interface, which
will be removed.  Each writer should be self contained, without a
separate open or available function.

Also, keep the pmsg fd open if it is opened by
__android_log_pmsg_file_write().  This fd was closed due to issues
with zygote, but it looks like it is only called by recovery now, so
there is no reason to close this fd at the end of that function.

Test: logging works, liblog-unit-tests
Change-Id: I345c9a5d18c55b11a280c8362df854784abf46fd
2019-12-12 16:19:08 -08:00
Tom Cherry
173e4ba26a Merge "liblog: remove more endianness functions" 2019-10-02 14:03:04 +00:00
Tom Cherry
d1ad89534a liblog: remove more endianness functions
And fix a mistake from the earlier CL.

Bug: 141962035
Test: liblog-unit-tests
Change-Id: Id41c47e760f79c0e8bdea54f3644752e2bf7494e
2019-10-02 03:28:49 +00:00
Tom Cherry
2beabe5c26 liblog: remove config_write.cpp/.h
Now that we only have one transport in a given build configuration,
there is no need to have these lists.

Test: liblog-unit-tests
Change-Id: I3fdcdc33c1224a9522080ea06f36f14c83d946ac
2019-10-01 13:05:58 -07:00
Tom Cherry
4c63e04f2a liblog: remove endianness functions
Android is little endian.

Test: liblog unit tests
Change-Id: Ieea7af39013a97f9f0d138a6d1ada3524d94e710
2019-09-30 14:39:37 -07:00
Tom Cherry
d00b3affda liblog: Remove stdbool.h from .cpp files
We're C++ now, so we don't need stdbool.h

Test: build
Change-Id: I2c65f0d3edddaf77256bd0bc3d60378bcfaef180
2019-08-07 14:30:41 -07:00
Tom Cherry
2d9779e87b liblog: remove visibility macros
Visibility is managed through version scripts now.

Bug: 123349183
Test: build
Change-Id: Ia388611a2ec14d0ff9c3896cfe97ccdce17dbb8b
2019-02-08 11:48:19 -08:00
Tom Cherry
6f6ef39b48 Remove liblog/uio.c and <log/uio.h>
readv() isn't used by anyone, writev() has one easily replaced user.
uio.h can be left as a private header for windows compatibility with
struct iovec.

Test: build
Change-Id: I33d4c6bdee6fd818271f78ae06abdd2aa09430f2
2019-01-16 14:26:36 -08:00
Tom Cherry
71ba16488b liblog: convert to C++
Bug: 119867234
Test: liblog, logcat, logd unit tests

Change-Id: I2a33b6fc37f9860c0041e3573bfb59ea389f623c
2019-01-15 15:57:33 -08:00
Renamed from liblog/pmsg_writer.c (Browse further)