Add FALLTHROUGH_INTENDED for clang compiler.
Bug: 112564944
Test: build with global -Wimplicit-fallthrough.
Change-Id: I40f8bbf94e207c9dd90921e9b762ba51abab5777
With replaced AOSP system.img, adb can be root by other test.
The fail is caused by the reason that logdw is still active after
__android_log_close().
This test has a potential bug.
proc/net/unix may contain '\0', then "grep" command will treat this file
as a bianry file.
Using "grep -a" instead of "grep" could be a safer way to get the right
results from bianry file.
bug: 112250722
Test: Build CTS
Test: Pixel 2 XL PPP5.180610.010 passed the following tests
Test: run cts-on-gsi -m CtsLiblogTestCases --skip-preconditions
Change-Id: I9bfca1522e90ebb68e6cecbdb63e3b67248e47c4
Signed-off-by: Xinghua Yang <xinghua.yang@mediatek.com>
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
* 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
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
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
* 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
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
015e637b4b/.
Test: m native-host-cross with Clang.
Change-Id: I3deb266d70e25296c4ae1d58637afbabc3d949c1
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
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
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
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
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
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
Revert "Remove obsolete workaround."
This reverts commit 1f3ac7583f.
Bug: 72143978
Bug: 24465209
Test: Tested failing case on sailfish, reverted back all CL's since
Test: 3471433 for b/24465209 and apps open
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
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
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