History log of /system/core/liblog/tests/liblog_test.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
2fb3f08d51edcfd8e39e0e58b853e75b3a4206a8 23-Aug-2016 Mark Salyzyn <salyzyn@google.com> liblog: add __android_log_close()

Bug: 30963384

(cherry picked from commit df7a4c6bae5f85532d79a93b7d9197a2aab17825)

Change-Id: Iee7cd0db819644299fa086586630e71415643294
/system/core/liblog/tests/liblog_test.cpp
504daa654e95fdf799e9cf604a01cfd7f4ba0bbe 15-Apr-2016 Mark Salyzyn <salyzyn@google.com> liblog: android_log_isloggable failing apct

(cherry pick from commit efe8ecc1d963452f0ed650756a968a7befa71c57)

- periodic failures in apct, dropped second serial test
in refresh_cache, trusting check_cache or global.
- The retry loop to see if is_loggable recovers of 1000
was hiding subsequent tests, drop to 10 retries.
- On the whole, the average performance remains the same.

Bug: 25792367
Change-Id: I4110440ef46671d7a1c128689bde623808bed04f
/system/core/liblog/tests/liblog_test.cpp
476b771bdaebf7aa72d41730557fce82cee7faf3 21-Mar-2016 Mark Salyzyn <salyzyn@google.com> liblog: logprint: deal with malformed log messages

(cherry picked from commit 083c53462aefaee142ddfb40ba0ed8d40e1ecda4)

Try to print as much content as possible should the application
logging only submit content as part of a tag with an empty message.
We search for the first non-printable ascii character in the tag, in
order to split it up for printing.

Applications (such as com.yahoo.mobile.client.android.weather) that
malform their log messages will no longer be punished by truncating
the content, but this should never be considered advocacy for their
bad behavior.

Bug: 27585978
Change-Id: Idb0680e8d6a6ad2bef5150661905acccb5b70afb
/system/core/liblog/tests/liblog_test.cpp
2b8157d9fd2a3dcb7370fe2614e2c47315186519 14-Mar-2016 Mark Salyzyn <salyzyn@google.com> liblog: add __android_log_pmsg_file_read

(cherry pick from commit 864e8e80e4f6b325ddacc25b0bd5d621eff0fb3a)

- This is considered an Android Private function, not exported
for general use.
- goal is to retreive a file's content from a series of log
messages from pmsg, to be retrieved after a reboot for
transfer to a persistent location.
- files are presented in reverse sorted order, first based on
_any_ numerical content, then by alphanumeric order.
- Add a gTest for this function, relies on gTest for
liblog.__android_log_pmsg_file_write from prior to reboot.

Bug: 27176738
Change-Id: If37ef423009bd28b598b233af3bccef3429bdc22
/system/core/liblog/tests/liblog_test.cpp
10bdf61e5ffbd99efec4d4168aee73a93c5e88be 10-Mar-2016 Mark Salyzyn <salyzyn@google.com> liblog: add __android_log_pmsg_file_write

(cherry pick from commit d4b061bde280fce9b5426b5738a02d42ec263c48)

- This is considered an Android Private function, not exported
for general use.
- goal is to record a file's content into a series of log
messages into pmsg, to be retrieved after a reboot for
transfer to a persistent location.
- filename reference is converted to a tag-unique
"<dirbase>:<filebase>".
- buffer and length representing the filename contents are
recorded, along with a sequence number placed into the nsec
time field to ANDROID_LOG_PMSG_FILE_MAX_SEQUENCE.
- Add a gTest for this function.

Bug: 27176738
Change-Id: If93df3ae8bfc1bb75516d4a1fd8dae0301af644b
/system/core/liblog/tests/liblog_test.cpp
53263ffa00b291de92dd4cb399b1cb5218d363f6 11-Mar-2016 Mark Salyzyn <salyzyn@google.com> liblog: test: security buffer is allowed to be denied

(cherry pick from commit 29e70a98feee7eb4591fcfcca064e2ba60364a98)

Bug: 27405083
Change-Id: I7cbc8fda326a2aea3bef5dabee9d3290cc818b24
/system/core/liblog/tests/liblog_test.cpp
a6f2f81d1ec81315f7b8395c17282b5f9d02bf0a 11-Mar-2016 Mark Salyzyn <salyzyn@google.com> liblog: test: do not LOG in signal handler

(cherry pick from commit 50af7f8b1d28d6efd1e61fa7aadaf963c7a2e3ff)

- We actually are logging in a signal handler, the title is bluster
to remind developers. It is not a reliable path though as it can
lock up. Our goal is to minimize the chances of a lockup regardless
in the name of stability only. The test remains to catch regression
in the name of code quality and reliability. Expected to be
>99.999% reliable.
- Add a new _correct_ duplicate test that uses signal to release a
semaphore to a thread that performs the task. This path is expected
to be 100% reliable.

Bug: 27405083
Change-Id: Ibb7cf4b13e34ebfac2db2af8724b7db7a27f81a8
/system/core/liblog/tests/liblog_test.cpp
73207ce139eaf1ac3fe3b96e2e0b254bf268b896 11-Mar-2016 Mark Salyzyn <salyzyn@google.com> liblog: truncate logtags that overflow prefixBuf

(cherry pick from commit 2f83d679dd7910cc76d895eb74ab4fabd1e349b2)

Bug: 27585978
Change-Id: If2f45e8787b05b46491a771702746cfc248b9ccd
/system/core/liblog/tests/liblog_test.cpp
d9aee653d164f6d909122d33c5bf824ba132ef78 25-Feb-2016 Mark Salyzyn <salyzyn@google.com> liblog: test: __android_log_error_write accuracy

(cherry pick from commit 5cecedc6e8d5559213220b4dae993f277801433a)

Add a test to confirm exact expected content using the testframe
setup for the events log handler. Remove dependency on 512 truncation
in liblog->
android_errorWriteWithInfoLog__android_logger_list_read__data_too_large
to something more liberal.

Bug: 27356456
Change-Id: I8a53ad3a16cf16b14856efe5b95417e857c7e09b
/system/core/liblog/tests/liblog_test.cpp
9dd6510dd09f40973b8834c5cad1217ce1c3011d 18-Feb-2016 Mark Salyzyn <salyzyn@google.com> liblog: event log list logging handler

(cherry pick from commit bd1ad049b2494c70f671dbd6a0566f30dc420d1a)

Based off an initial request and effort by williamluh@google.com

- Added the following functions:

* Composing and Writing:

android_log_context create_android_logger(uint32_t tag)

int android_log_write_list_begin(android_log_context ctx)
int android_log_write_list_end(android_log_context ctx)

int android_log_write_int32(android_log_context ctx, int32_t value)
int android_log_write_int64(android_log_context ctx, int64_t value)
int android_log_write_string8(android_log_context ctx, const char *value)
int android_log_write_float32(android_log_context ctx, float value)

int android_log_write_list(android_log_context ctx, log_id_t id)

* Reading and Interpreting:

android_log_context create_android_log_parser(const char *msg, size_t len)

android_log_list_element android_log_read_next(android_log_context ctx)
android_log_list_element android_log_peek_next(android_log_context ctx)

* Destroy context used above:

int android_log_destroy(android_log_context *ctx);

- Added unit gTests

We moved implemented android_log_buffer_to_string() to the test since
it is an alternate for already existing logprint functionality.
Please move into liblog should it be of some common use, otherwise
as is it is a good means of stessing the reading and interpreting
handlers.

Signed-off-by: Mark Salyzyn <salyzyn@google.com>
Bug: 19235719
Change-Id: I4aa1927e8e6a75f0a129d15a27c891cf1ccd4f5c
/system/core/liblog/tests/liblog_test.cpp
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/liblog/tests/liblog_test.cpp
7cc8013e37400f1ca70ec7b2b9a3b53c188d5275 20-Jan-2016 Mark Salyzyn <salyzyn@google.com> liblog: fix android_log_printLogLine empty event string

Allow _one_ empty line to get through before evaluating
further. Add __android_log_bswrite testing for content
and contentless cases; checking for propagation and for
expected printing. As for printing which is fixed here,
security variants cover the same code paths as the events.

Bug: 26646213
Change-Id: I484718aa604e0a00afde4c34a00e87468ea93aa5
/system/core/liblog/tests/liblog_test.cpp
77c166b5dd9b28c2dd64f001821625ab455dc86c 08-Dec-2015 Mark Salyzyn <salyzyn@google.com> liblog: test: instrument is_loggable failures

Bug: 25792367
Change-Id: Ia34f8e7ea0bd7f15bf705afd3a1c631a56d1c479
/system/core/liblog/tests/liblog_test.cpp
86052a5d4f217a73c769c77f7ac0904b65e67942 11-Dec-2015 Mark Salyzyn <salyzyn@google.com> Merge "logd: liblog: logcat: Add LOG_ID_SECURITY"
42ae82742b1e613b3934adb1471da0f2bcebe4b3 04-Dec-2015 Mark Salyzyn <salyzyn@google.com> liblog: test for maximum payload can not survive change

If we adjusted the maximum log payload, Resolve compile
issues resulting from the changes (gTest).

Bug: 25996918
Change-Id: I672b0f4d9d4a1394a5b2e27bf81a5e906bf92a10
/system/core/liblog/tests/liblog_test.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/liblog/tests/liblog_test.cpp
ffbd86ff25583e2bdae0b6f958e46e40ad111b3d 04-Dec-2015 Mark Salyzyn <salyzyn@google.com> liblog: Add __android_log_security()

Return non-zero if ro.device_owner is set and not false
and persist.logd.security is true.

Bug: 26029733
Change-Id: Ie82ae11ae35e9c79017b6e873fefb39d79a1d4fe
/system/core/liblog/tests/liblog_test.cpp
7d8939ec1de99c69116f7c6fe19d3ed87bc82254 01-Dec-2015 Mark Salyzyn <salyzyn@google.com> liblog: test: liblog.android_logger_get_ failure

Change-Id: I8f74eca7857fe4cd6fa979d7bdeeda2b6a3e596b
/system/core/liblog/tests/liblog_test.cpp
964428c0a635c3b588547dfcf6ba166efa381412 13-Aug-2015 William Luh <williamluh@google.com> Add macro to call event logger for errors.

Bug:23180694
Change-Id: I566a290334345f48013029534efef3e08e726e40
/system/core/liblog/tests/liblog_test.cpp
c158456f50817ac506f4eed780978e63dd222fe4 12-Mar-2015 Mark Salyzyn <salyzyn@google.com> liblog: __android_log_is_loggable support global properties

- Add support for "log.tag" and "persist.log.tag" global
logging properties, effectively a runtime default minimum
logging level.
- Add a thread-safe single level cache plus selective logic for the
four properties being checked to help speed up logging decision
on subsequent identical calls.
- Using new __system_property_area_serial() to make for
efficient (<100ns) handling of cache misses. Despite adding
two new properties, we are 8 times faster on subsequent calls
even if the properties do not exist.
- A NULL or blank tag is no longer directed to return default,
it will check the pair of global logging properties first.
- Add liblog.is_loggable gTest
- Fixup liblog.android_logger_get_, allow no content in crash buffer
- Fixup liblog.max_payload, lowered logd priority increases latency

Bug: 19544788
Bug: 21696721
Change-Id: Ideb887755aa3f1fd14a2603bda1fe23cba49642c
/system/core/liblog/tests/liblog_test.cpp
2d3f38a6b8e724749b59d201a01b35fa0951141e 26-Jan-2015 Mark Salyzyn <salyzyn@google.com> liblog: introduce ANDROID_LOG_* flags

Move away from using POSIX open(2) flags and introduce ANDROID_LOG_* flags to
replace them. Add security by preventing random mode flags from getting into
underlying POSIX calls. ANDROID_LOG_* flags overlap POSIX O_* flag definitions.

Change-Id: Ib32bb64c287e8bf150be62242e1ba46bb37839fc
/system/core/liblog/tests/liblog_test.cpp
43232920f398d3673dfc3cd2bd414c361ccb4237 20-May-2014 Ben Cheng <bccheng@google.com> Address additional warnings found by GCC 4.9.

Change-Id: I8aae6c3e1ccc2294f4db455e1b4f3b4c34a00aaf
/system/core/liblog/tests/liblog_test.cpp
a04464adaf5b95ae953f8577632d3cf8aa2c80a3 30-Apr-2014 Mark Salyzyn <salyzyn@google.com> liblog: set -Werror

- Deal with some -Wunused issues
- Cleanup UNUSED to __unused transition

Change-Id: Icd33808d4c974625f4fd0a126a90a2b4c90c8314
/system/core/liblog/tests/liblog_test.cpp
5045f575252ce3d25304ba26cec299395c02152c 30-Apr-2014 Mark Salyzyn <salyzyn@google.com> liblog: logcat: Move library print test into gTest

Change-Id: Icd33808d4c974625f4fd0a126a90a2b4c90c8315
/system/core/liblog/tests/liblog_test.cpp
8444eb81b37991ce0fc4ae1d8d79b01688a02426 24-Apr-2014 Mark Salyzyn <salyzyn@google.com> logd: liblog: ALOG silently drops excessively long messages

Bug: 14280914
Change-Id: Idddd29784625094e54144953c29f64692a88eee9
/system/core/liblog/tests/liblog_test.cpp
1bafa52172d430d134c46e0519d0eb53f4a10d5d 12-Apr-2014 Ben Cheng <bccheng@google.com> Fix signed vs unsigned comparison.

Change-Id: I4011607858f3a82acc04509c9f795f960496ed69
/system/core/liblog/tests/liblog_test.cpp
8196be3032674c10571451ef355f6782d41c2329 19-Mar-2014 Mark Salyzyn <salyzyn@google.com> liblog: test for LOGGER_ENTRY_MAX_PAYLOAD compliance

- Add max_payload test
- Add dual_reader test
- Switch to EXPECT from ASSERT to increase test coverage

Bug: 13514601
Change-Id: I0e1c273e0ec430c0461e424731dbf166f2a3ce1b
/system/core/liblog/tests/liblog_test.cpp
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/liblog/tests/liblog_test.cpp
5d9fe779c8ec2705865a23061834ad8cdbee5b82 06-Feb-2014 Elliott Hughes <enh@google.com> system/core LP64 cleanup.

Fixes -Wint-to-pointer and -Wpointer-to-int warnings, plus various -Wformat
warnings.

Change-Id: I6c5eea6b4273d82d28b8e5d2925f3e5457511b17
/system/core/liblog/tests/liblog_test.cpp
cef098ef5df0d1e98bae269aaae2e3c3fbd1cb1f 09-Jan-2014 Mark Salyzyn <salyzyn@google.com> liblog: Add cpu utilization test

- followup to measure CPU utilization in liblog to
ensure this issue gets caught before a regression
passes into the labs. Threshold for failure is 1%.

(cherry picked from commit edadb2e7196040dd476e86581dc1c8e26449c00d)

BUG: 12457855
Change-Id: I40568a72aeef2f554b19ad55f3dd3c02bc023f24
/system/core/liblog/tests/liblog_test.cpp
819c58a8ca20f94700085b8967f371f5854a5216 22-Nov-2013 Mark Salyzyn <salyzyn@google.com> liblog: Add liblog test suite

(cherry picked from commit 8d1fdb509305e93eb46d45a6dcd34bedd6dc0742)

Change-Id: Ia457d518b4e7ff37e840336ff0c48583709700d4
/system/core/liblog/tests/liblog_test.cpp