Commit graph

9 commits

Author SHA1 Message Date
Mark Salyzyn
2ed51d708e liblog: specify clang format
Switch coding style to match

SideEffects: None
Test: compile
Bug: 27405083
Change-Id: Id426d5c5e3b18f2ceec22b31bbc9781aabf6bcca
2017-03-09 09:36:19 -08:00
Mark Salyzyn
5bd8f2d956 liblog: pmsg read permissions for AID_LOGD
Test: gTest liblog-unit-test and logd-unit-tests
Bug: 31456426
Change-Id: I7a2fe8245ecd651883f7851ce71b6c45e373af82
2016-12-19 15:57:01 +00:00
Mark Salyzyn
db8a266aea liblog: __android_log_pmsg_file_write() cleanup
__android_log_pmsg_file_write() will open /dev/pmsg0 if not
already, and will close it if we opened it.

Added atomic access to the android_log_context as insurance.

Fortify and correct pmsg tests.

Test: gTest liblog-unit-tests --gtest_filter=liblog.__android_log_pmsg_file_*
Bug: 31958686
Change-Id: I2cf6f971b6968938f471fda67367efe20dae3004
2016-10-13 21:43:42 +00:00
Mark Salyzyn
305374cf0f logger: validate hdr_size field in logger entry
- check hdr_size to make sure it is in the expected range
  from sizeof entry_v1 to entry (entry_v4).
- alter msg() method to report NULL on invalid hdr_size
- alter all users of msg() method.

Bug: 30947841
Change-Id: I9bc1740d7aa9f37df5be966c18de1fb9de63d5dd
2016-08-23 14:51:50 -07:00
Mark Salyzyn
3d8afe9b01 liblog: pmsg_read add validity checking for prio
Improve pmsg data corruption detection.

Bug: 30085794
Change-Id: I215da4fff07797b8c0a3462f850bafb090adfc68
2016-07-14 07:34:53 -07:00
Rubin Xu
9c2f803e9d Return correct length from pmsgRead()
Bug: 28610769
Change-Id: I38cac786ca43ef8d9530f4e2e5a0bdd4cc3bccef
2016-05-05 16:50:44 +01:00
Mark Salyzyn
78786da116 liblog: O_CLOEXEC flag on opens
Bug: 28455828
Change-Id: Ic00101a6192aab7271cb0c3461e249a77d7f29ed
2016-04-29 07:52:36 -07:00
Mark Salyzyn
864e8e80e4 liblog: add __android_log_pmsg_file_read
- 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
2016-03-22 13:03:53 -07:00
Mark Salyzyn
018a96d03f liblog: split out transports into separate files
Create config_logger, logger and logger_read to house the log
interfaces. Add fake_logger, logd_logger and pmsg_logger to
house the write and read transports. Allows for an easier and
direct path to add new transports to the library.

SideEffects: None, logger benchmark performance unaffected

Bug: 27176738
Bug: 27405083
Change-Id: I01b38637334a5242905c8c89f6ab0a92e2540008
2016-03-22 13:01:15 -07:00