* changes:
liblog: remove endianness functions
liblog: remove unused test #defines and transport code
liblog: remove stderr logger
liblog: add -Wall,-Wextra and do related clean-up.
There are no users of the liblog stderr logger, but 66 users of
android::base::StderrLogger. We'll prefer that format and work to
merge it into liblog.
Test: liblog-unit-tests
Change-Id: Ifad24b27ac0f51379b925f6644caa1f6f3d9ad81
Fix termination of killed process name in proc_get_name function. While at
it also fix the coding style in the function.
Test: lmkd_unit_test
Bug: 141780598
Change-Id: I3f99b3e37b9a9d0750ece94f08f0b50ac839dacb
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
This is just to permit moving under art/. We'll back these out after
the move (assuming it's not too much gratuitous churn).
Bug: 141749154
Test: symlink libraries under art/, m cpplint-art-all
Change-Id: Ibd4882f416072076d4605bc329192f0bc1b196fb
Remove the extra folder of vts_core for vts_core_liblp_test and
vts_libdm_test since we have a better auto-gen option of auto_gen_config.
Bug: 141684102
Test: 1. m -j vts_core_liblp_test
2. m -j vts_libdm_test
3. check out/.../vts_core_liblp_test.config
and
out/.../vts_libdm_test.config
Change-Id: Ibcdf96104205b50b3da522364199330ad0190c70
Some device requires VNDK_USING_CORE_VARIANT list, but it was not
implemented in previous. Adding this library list to the build target so
it can be added to system image.
Bug: 141695559
Test: m -j passed & Tested from Cuttlefish
Change-Id: I52750583050401098ca8dacee9cf84e8c5727e36
Add vts_core_meminfo_test to vts-core suite and transfer to test it
by using base GTest.
Bug: 132702215
Test: atest vts_core_meminfo_test
Change-Id: Ia7924179cde0b79a6787b3533259ea8e90594585
Required because the kernel cannot always get the taskname safely at
the time the process is killed (due to competition for mm->mmap_sem).
Test: manually
Bug: 130017100
Signed-off-by: Jim Blackler <jimblackler@google.com>
Change-Id: I27a2c3340da321570f0832d58fe9e79ca031620b
Add VMA flags into procmem report so that we can distinguish different
sections of an executable or a library.
Bug: 138148041
Test: procmem -h <PID>
Change-Id: I062464aa1f1c508bcc8ef05a6d9cfad9a4318d95
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
We're missing useful crashes, especially on hwasan builds.
Bug: http://b/140580637
Test: run crasher
Change-Id: Ib5d8d3bd3fc4d7fec77d0b10302e5595f97a3515
Call the function now logwrap_fork_execvp() and fix const correctness
issues, so no longer do callers need to const_cast<> their args.
Test: logwrapper still works
Change-Id: Iea34f5cae90a06a37d395bf9a91e01fb38c35fa6
This function is too big. Refactor it a bit.
- Reorder checks / variable initializations a bit.
They are independent of each other, so they can be
safely reordered.
- Put snapshot creation and initialization to their own
functions so that CreateUpdateSnapshots looks shorter.
Test: libsnapshot_test
Change-Id: I135b415d8e046dd91d31326fe7962ae44be4ccf8
This test checks that kernel /dev/log* and logd do not exist and have
content in them simultaneously. The kernel logger was removed years
ago, so that half of the test is no longer relevant. Once that half
is removed, this test is essentially "is logd online and does it have
logs", which is already tested for in other tests, so we remove this
on entirely.
Test: logd unit tests
Change-Id: I71dff742f66fc791b7a661a363d4239363140b3f
Opening child_ptty before fork() means that the parent process will
use child_ptty as the controlling terminal if it doesn't already have
one. This is a problem, because when the parent_ptty closes, SIGHUP
will be sent to the parent process, since its controlling terminal has
closed.
It's better to have the child process start its own session and then
open child_ptty as its controlling terminal. In this case, the child
process will get SIGHUP if the parent process exits, but the parent
process avoids the original issue.
There is a concern that the child_ptty will never be opened and
POLLHUP will never be generated, but there is a work-around in place
with a timeout to handle that extremely rare situation.
Secondly, remove the ignore_int_quit logic. It is described to
totally ignore these signals, similar to `nohup` which should be
preferred. However, it regressed shortly after being introduced in
2013 and serves essentially no purpose currently.
Thirdly, add a forward_signals option that does what we should have
done the whole time with signals: it forwards SIGHUP, SIGQUIT, and
SIGINT to the child process and let that process handle them. This
only needs to be enabled in the `logwrapper` case itself. Other
processes should not need to change any signals. This fixes case 3)
below.
Lastly, add O_CLOEXEC where appropriate.
Test: launch process as `adb shell logwrapper yes`
1) The both processes exit when given SIGINT
2) The process prints when abbreviated is not enabled
3) The process does print when abbreviated is enabled;
this was previously broken
Test: launch process as `adb shell` then `logwrapper yes`
4) The both processes exit when given SIGINT
5) The process prints if abbreviated is enabled or not.
6) Ctrl-c then Ctrl-c again rapidly and observe that the
logwrapper process is terminated by the second Ctrl-c.
Test: simulate a failure in child() before opening child_tty and
observe logwrapper and the child exiting appropriately.
Change-Id: Ia76cd17e16535500170d8f5e2183b3bbbf843df7