summaryrefslogtreecommitdiffstats
path: root/liblog
Commit message (Collapse)AuthorAgeFilesLines
* liblog: Add functions to reset log contextSuren Baghdasaryan2018-08-014-11/+73
| | | | | | | | Add android_log_parser_reset and android_log_reset to reset reader/writer log context. This allows to generate multiple log messages of the same format without context reallocation. Change-Id: Icb0f15855378aa4e66fc671ffefd15d9df6fee1e
* Suppress gnu-zero-variadic-macro-arguments warning.Chih-Hung Hsieh2018-07-261-13/+13
| | | | | | Bug: 111614304 Test: make with WITH_TIDY=1 Change-Id: I2a52073202f42d1912363ae864f2f7f892589cea
* Declare __fake_use_va_args as a variadic function.Chih-Hung Hsieh2018-07-251-1/+2
| | | | | | | | | | | * New clang compiler requires variadic function to have at least one named parameter type. * Use ##__VA_ARGS__ to work with empty __VA_ARGS__. * Fix one ALOG_ASSERT parameter bug in lmkd/lmkd.c. Bug: 111614304 Test: make with WITH_TIDY=1 Change-Id: I90f35aa88527a6897954f69a35b256a157a725c5
* Declare __FAKE_USE_VA_ARGS as a variadic function.Chih-Hung Hsieh2018-07-231-2/+3
| | | | | | | | | | This avoids 2 static analysis warnings: * assigned but unused variables in __VA_ARGS__ * unused expression result in __VA_ARGS__ Bug: 111614304 Test: make with WITH_TIDY=1 Change-Id: I4faae8787f6cc76de7ff4b6d08d25d0cb47324ea
* Use __VA_ARGS__ when in clang static analyzer.Chih-Hung Hsieh2018-07-181-14/+26
| | | | | | | | | Clang static analyzer can optimize out if (false) ... and report unused variables in __VA_ARGS__. Bug: 111614304 Test: make with WITH_TIDY=1 Change-Id: I214ced736230fda847031fd4eee23015fd988ffc
* [logd] Modernize codebase by replacing NULL with nullptrYi Kong2018-07-131-1/+1
| | | | | | | | Fixes -Wzero-as-null-pointer-constant warning. Test: m Bug: 68236239 Change-Id: I15ccb9cfc9967dae4320d9690f5097bc2f7d5bfe
* Modernize codebase by replacing NULL with nullptrYi Kong2018-07-131-1/+1
| | | | | | | | Fixes -Wzero-as-null-pointer-constant warning for binder. Test: m Bug: 68236239 Change-Id: I8184bd6aa4ebff1bd8c88dad16886e98df853b03
* Merge changes from topic "mingw-clang"Treehugger Robot2018-06-261-24/+0
|\ | | | | | | | | | | | | * changes: Do not customize __format__ for Windows/MinGW to gnu_printf Adapt to switch to Clang for Windows host builds Update cflags for building Windows modules with Clang
| * Do not customize __format__ for Windows/MinGW to gnu_printfPirama Arumuga Nainar2018-06-251-24/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Bug: http://b/69933090 Bug: http://b/69933068 MinGW uses gnu_printf to force C99 printf analysis with GCC, but clang does not support gnu_printf. So just use the default that's used for other platforms. This also mirrors upstream commit https://sourceforge.net/p/mingw-w64/mingw-w64/ci/015e637b4b24d9915162ab877ed539ad0e657951/. Test: m native-host-cross with Clang. Change-Id: I3deb266d70e25296c4ae1d58637afbabc3d949c1
* | Remove pstore case ibc.__pstore_append from CTSchenhg2018-06-211-0/+4
|/ | | | | BUG: 110118705 Change-Id: I946c645af0cfb3f3b0e9344c51940da226fd08ce
* logd: remove failing test.Elliott Hughes2018-06-191-107/+0
| | | | | | Bug: N/A Test: ran tests manually Change-Id: I3ebb97d757077acaab1b51809a1c2be90ceb1ad9
* liblog: expect content only if ro.logd.kernel is enabledMark Salyzyn2018-06-051-1/+5
| | | | | | | | | On svelte devices, CTS test liblog#android_logger_get_ fails on the missing kernel buffer because it is not enabled to save space. Test: gTest liblog_unit_tests Bug: 109669791 Change-Id: Iaf46fe9713d3462a56885515a67db640544345ab
* Work around b/24465209, do not pack relocation table.Chih-Hung Hsieh2018-05-241-1/+1
| | | | | | | | | | Global flag --pack-dyn-relocs=android is used with clang lld. For b/24465209, we need to override that with pack_relocations:false. Bug: 24465209 Bug: 80093890 Test: build with USE_CLANG_LLD=true and run dlext.compat_elf_hash_and_relocation_tables Change-Id: I4edcdf49e184fa45ea2b6b6417654d81bcd09e1d
* Merge "Work around b/24465209, do not use clang lld"Chih-hung Hsieh2018-05-231-0/+1
|\
| * Work around b/24465209, do not use clang lldChih-Hung Hsieh2018-05-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | See longer explanation in b/80093890. Clang lld does not generate expected DT_REL and DT_RELA tags with --hash-style=both and --pack-dyn-relocs=android. I am not sure about the extent of b/24465209, so I would rather not to use lld for these .so files for now. Bug: 80093890 Bug: 24465209 Test: build with USE_CLANG_LLD=true and run dlext.compat_elf_hash_and_relocation_tables Change-Id: I645dbe25c5b9975605e3af5e717ed36c276f14d4
* | Merge "Simplify code"Treehugger Robot2018-05-221-2/+4
|\ \ | |/ |/|
| * Simplify codeGeorge Burgess IV2018-05-151-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The static analyzer is concerned about the strcpys below this, since it apparently doesn't try to model snprintf's potential behaviors. (In particular, it was concerned that suffixLen might be >= sizeof(suffixBuf)). While that's clearly suboptimal, this code can also be simplified to make it more obvious what's happening and to appease the analyzer. No functionality change is intended. Bug: None Test: Ran the analyzer. It's no longer angry about strcpy overflows. Change-Id: I4aa812144c90f6d3e833bbcb23c0694476a0e53e
* | Mark as recovery_available: trueJiyong Park2018-05-141-1/+2
|/ | | | | | | | | | | | Libraries that are direct or indirect dependencies of modules installed to recovery partition (e.g. toybox) are marked as recovery_available: true. This allows a recovery variant of the lib is created when it is depended by other recovery or recovery_available modules. Bug: 67916654 Bug: 64960723 Test: m -j Change-Id: Ie59155c08890e96ce1893fa3687afcf763d7aea3
* Add missing @addtogroup tags.Dan Albert2018-04-131-0/+7
| | | | | | | | | | These NDK docs weren't in any groups, so they don't show up in the new site. Test: https://irina-dot-devsite.googleplex.com/ndk/reference/group/logging Test: https://irina-dot-devsite.googleplex.com/ndk/reference/group/sync Bug: http://b/77236573 Change-Id: I300f96585dec94359ecf96fbf39c6dc3ec4579e5
* liblog: save errno through log writingMark Salyzyn2018-03-071-4/+15
| | | | | | Test: compile Bug: 74258013 Change-Id: I5163527826855bc506ed324aaba47f8695aaf668
* Expose __android_log_buf_print and __android_log_buf_write to NDKTom Cherry2018-02-202-2/+32
| | | | | | | | These are needed to build libbase with the NDK. Bug: 73658597 Test: tree hugger Change-Id: Icf4a82c5c08975731c180be155743ac63f4bfd50
* Make log_event_list.h available to vendor code.Pavel Grafov2018-02-132-0/+84
| | | | | | | | | | This is required in order to be able to log audit events from wpa_supplicant. Only log writing functions from log_event_list.h are made available. Test: manually Bug: 70886042 Change-Id: I097d4ad1de573662658678e6a9f1fc8f17820542
* Doxygen format <android/log.h>.Elliott Hughes2018-01-261-21/+44
| | | | | | Bug: N/A Test: ran doxygen manually. Change-Id: I164de255dbbc6c0312e656ddd886dcac231c893a
* Fixing app compat issue b/72143978Ian Pedowitz2018-01-181-0/+4
| | | | | | | | | | | Revert "Remove obsolete workaround." This reverts commit 1f3ac7583feaf591ee23fcc69d56d29613020b4f. Bug: 72143978 Bug: 24465209 Test: Tested failing case on sailfish, reverted back all CL's since Test: 3471433 for b/24465209 and apps open
* liblog: clock_gettime, clock_getres and time benchmarksMark Salyzyn2018-01-161-0/+60
| | | | | | | | | | | | | | | | | | | Add local BM_time_clock_gettime_*, BM_time_clock_getres_* and BM_time_time benchmarks. Relates to the bionic benchmarks of the same names, except adds CLOCK_MONOTONIC_RAW. Added here for developer convenience whenever updates to the liblog or logd code base need integration testing. ToDo: add liblog gTests that analyse the benchmark data to confirm that the specified integrated device has vdso access to all the pertinent clock sources. Add liblog local benchmarks and tests to measure the device clock drift of each possible liblog clock source to help evaluate device configuration. Test: liblog_benchmarks --benchmark_filter=BM_time* Bug: 63737556 Bug: 69423514 Change-Id: Ibafe0880d976ef2b3885765f71e0ba6c99d56f2a
* liblog: benchmarks use google-benchmark libraryMark Salyzyn2018-01-164-556/+133
| | | | | | | | | | | Remove our circa 2014 snapshot of the google benchmarking library, and use the now very stable google-benchmark suite. Some porting effort, and deal with some benchmarking saddle points that take too long to sort out. Focus on minimal API changes, _odd_ new behaviors, and style. Test: liblog_benchmarks, ensure results in about the same range Bug: 69423514 Change-Id: I2add1df9cb664333bcf983b57121ae151b26935b
* Improve ALOGV compatiblity with clang-tidyKrzysztof Wesolowski2018-01-111-2/+4
| | | | | | | | | | | Currently used clang tidy does not filter the warnings caused by macros, even if macros come from filtered headers. This change allows projects using ALOGV to use readability-implicit-bool-conversion without spreading //NOLINT everywhere. Bug: 71533509 Change-Id: Id1b193d1e56d13f00171e04f600292877c5f6cb3
* Remove obsolete workaround.Elliott Hughes2018-01-091-4/+0
| | | | | | Bug: http://b/24465209 Test: manually ran the app. Change-Id: I573d2480c70632b100096ba6b2029bfc335595d6
* Use override_export_include_dirs.Steven Moreland2018-01-051-1/+1
| | | | | | Bug: 62878521 Test: soong build system finds renamed attribute Change-Id: I51e42f4378db366b8711cd373fb835fecda88416
* Add suite component to test modulesJulien Desprez2017-12-181-0/+1
| | | | | | Test: build Bug: 65303193 Change-Id: I620c7034b9bdfa056dbde97c28bc5abc3375cc42
* Merge "Add OWNERS."Elliott Hughes2017-12-071-0/+1
|\
| * Add OWNERS.Elliott Hughes2017-12-071-0/+1
| | | | | | | | | | | | Bug: N/A Test: N/A Change-Id: Ie785058c0f5eb9b4086c98ccba6e63e3ed411b65
* | Merge "make log.tag.stats_log work for stats buffer."Yao Chen2017-12-041-1/+1
|\ \ | | | | | | | | | | | | | | | am: 1e2ed53ffc Change-Id: I5b81edb2c221eb8a7c5ab64316d788879d727c58
| * \ Merge "make log.tag.stats_log work for stats buffer."Treehugger Robot2017-12-041-1/+1
| |\ \
| | * | make log.tag.stats_log work for stats buffer.Yao Chen2017-12-041-1/+1
| | |/ | | | | | | | | | | | | | | | | | | Test: adb shell setprop log.tag.stats_log S And saw the stats logs are silent. Change-Id: I7a9313f5f12029f9b8a8f070de1e1db659675525
* | | Merge "std::string_view is no longer experimental."Elliott Hughes2017-12-011-5/+4
|\| | | | | | | | | | | | | | | | | am: c8022a3efc Change-Id: I75fa251cb6a959e7dfd32524b8d0ffcf839c3dc4
| * | std::string_view is no longer experimental.Elliott Hughes2017-11-301-5/+4
| |/ | | | | | | | | | | Bug: N/A Test: builds Change-Id: I8f022fdc3ebaebd8aa250414569485a752f98da7
* | Merge changes from topic "stats_log"yaochen2017-11-155-5/+24
|\| | | | | | | | | | | am: 68f2c85354 Change-Id: I2dce867c04ea61a05b32063f321414f459cbe26c
| * Create stats buffer in logd.Stefan Lafon2017-11-145-5/+24
| | | | | | | | | | | | | | Bug: 69323063 Test: ran unit tests. Change-Id: Icfb827ab4674172c26b4bbfe1a9b3bffc03dc24b (cherry picked from commit 1b1b6f50c78d88e3256a5e13559d92fbb6d1c8fe)
* | Merge commit 'a63ccea6abc7ea02e2d98e41c80793ca97237bd3' fromXin Li2017-11-142-10/+32
|\ \ | |/ |/| | | | | | | | | oc-mr1-dev-plus-aosp into stage-aosp-master Change-Id: Ia33311cd1fd26dfaea59a69317b306fb91203c40 Merged-In: I03d06b10807e8a313c9654c2e1db36bfb59e3f99
| * Merge "Make liblog headers compile stand-alone." am: fe3551e9dc am: b637860732Jayant Chowdhary2017-10-031-0/+2
| |\ | | | | | | | | | | | | | | | am: 7b9c789d23 Change-Id: Ie4227d04492fdb6d571eca3f7637e650180b4716
| * \ Merge "Remove default libraries" am: 8b7feee38f am: a0113de2f3Dan Willemsen2017-09-301-3/+0
| |\ \ | | | | | | | | | | | | | | | | | | | | am: 55181f7cdd Change-Id: I2fa1d556537ee4f3b2e67cd35aa3ce090b3684a6
| * \ \ Remove pstore related unit tests from CTSYoshitaka Seto2017-09-212-9/+31
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | am: 5dec8e22c3 Change-Id: Ifba13f9d714e58eaa3358a48246c71f90687629e
| | * | | Remove pstore related unit tests from CTSYoshitaka Seto2017-09-212-9/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pstore test cases should not belong to CTS. The test cases should be a part of GTS if really required. Test: manual Bug: 66431569 Bug: 63969981 Bug: 63913130 Signed-off-by: Srinavasa Nagaraju <Srinavasa.Nagaraju@sony.com> Signed-off-by: Yoshitaka Seto <yoshitaka.seto@sony.com> Signed-off-by: Mark Salyzyn <salyzyn@google.com> Tested-by: Srinavasa Nagaraju <Srinavasa.Nagaraju@sony.com> Change-Id: Icd326403711ad268ce28a3863045fc9b2f211461
| * | | | Merge changes from topic "hide_log_time" into oc-mr1-devJiyong Park2017-09-072-4/+54
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | am: cd00582000 Change-Id: I28004046f32523b4445cce9036c7170fc3a52f37
| | * | | Hide implementation details of log_time structJiyong Park2017-09-062-4/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the future, the sizes of tv_sec and tv_nsec (or even the size of log_time struct itself) can change due to the 32-bit overflow expected to happen in the year 2138. In order to hide such implementation details to the clients of liblog, the two macros LOG_TIME_SEC and LOG_TIME_NSEC are introduced. Furthermore, vendors are provided with a simplified version of log_time.h without C++ APIs. In doing so, log_time.h no longer includes time.h. This breaks several modules that implicitly relied on the hidden dependency, which should be fixed. Bug: 37629934 Test: build with BOARD_VNDK_VERSION=current Change-Id: I01b36078c1d8f3f44824be20ae769ba1465b6feb
| | * | | Reading from logd in WRAP mode is expected to take a long time,Alan Stokes2017-08-253-3/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | don't abort it after 30s. Adds a new CTS test to verify the behaviour. Bug: 64143705 Test: New and existing CTS tests pass. Manual testing with logcat. (cherry picked from commit 64acdf77d6f89a72be9192b35e0fc34242c23e34) Change-Id: Ic2ec131a3aee293ee865c46e62566ddd82ec2507
| * | | | Merge "Suppress false-positive static analyzer warnings" am: 0c89aaec1f am: ↵Ting-Yuan Huang2017-09-062-0/+2
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2ee27bfd0d am: d3ffb4344e Change-Id: Ica8a4b2e224e278308e9dca377751e462be4ae6d
| * \ \ \ \ Merge "Small liblog test fixes & readability improvements." am: 332370d14d ↵Alan Stokes2017-08-251-2/+2
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | am: 511cc67633 am: 32636f0f4c Change-Id: I5dd5e1b7267ff3f96aa264eede616dfb30b68884
| * \ \ \ \ \ Merge "Reading from logd in WRAP mode is expected to take a long time, don't ↵Alan Stokes2017-08-253-3/+135
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | abort it after 30s." am: 974ab46561 am: 9181fe6427 am: 50289204e5 Change-Id: I88069714a32ec83f318a1a1dded0b0d8553be07f