Commit graph

38841 commits

Author SHA1 Message Date
Yabin Cui
3464bc4b43 Merge "libprocinfo: fix mac build." 2018-05-15 19:58:06 +00:00
Yabin Cui
edac5e3b25 libprocinfo: fix mac build.
Bug: none
Test: build.
Change-Id: Ic25d873d9d74edc8320b75d077536055f176c0dd
2018-05-15 12:51:57 -07:00
David Anderson
3e946da535 Merge "init/fs_mgr: prototype first-stage dm-linear support" 2018-05-15 18:57:08 +00:00
Yabin Cui
0f837fe8ca Merge "libprocinfo: add functions reading process map file." 2018-05-15 18:01:56 +00:00
Treehugger Robot
da6ab73420 Merge "adb: fix double close in jdwp_service." 2018-05-15 01:52:29 +00:00
Treehugger Robot
32fcdf8de2 Merge "Make memunreachable_test more robust against false negative leaks" 2018-05-15 01:03:01 +00:00
Jiyong Park
612210c75b Mark as recovery_available: true
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
2018-05-15 09:47:04 +09:00
Josh Gao
b7a9956cbc adb: fix double close in jdwp_service.
Bug: http://b/78793027
Test: treehugger
Change-Id: Ie66d12e70bdaf09148e3d672e3c7c3da9e8ab2fe
2018-05-14 17:13:47 -07:00
Colin Cross
ca71f170b7 Make memunreachable_test more robust against false negative leaks
For some reason, the memunreachable tests are rock solid on the
devices covered by APCT, but catch a ton of false-negatives on
hikey960, which show up as failures that look like:
system/core/libmemunreachable/tests/MemUnreachable_test.cpp:200: Failure
Expected equality of these values:
  1U
    Which is: 1
  info.leaks.size()
    Which is: 0

These happen when a stray copy of a pointer is lying around that
points to the memory it is expected to leak.  The stray pointers
can be on the stack or in the jemalloc thread cache of freed
allocations, which is always considered active memory.

Add some extra cleanups to get rid of old pointers.
1.  Clear the tcache when destructing UnreachableMemoryInfo
2.  Clear the stack and tcache before and after each test
3.  Make MemunreachbleTest.twice match MemunreachableTest.stack

Also fix MemunreachableTest.notdumpable, which was only passing
when run as root, which was bypassing what the test was trying
to cover.  Make the test pass when run as non-root, and skip
when the test is running as root.

Bug: 79701104
Test: memunreachable_test
Test: memunreachable_test as root
Change-Id: Ia6c6df11e76405d08118afcc19c1fe80a6684c56
2018-05-14 15:24:28 -07:00
Treehugger Robot
313aa7172f Merge "adb: better error messages on deduplicated filesystems." 2018-05-14 21:10:34 +00:00
Yabin Cui
3841accba8 libprocinfo: add functions reading process map file.
Add test and benchmark.
Also switch libbacktrace, libunwindstack, libmemunreachable
to use libprocinfo for map file reading.
The benchmark shows using libprocinfo speeds up map file reading
in libbacktrace and libunwindstack 18% - 36% on walleye.

Bug: http://b/79118393
Test: run procinfo_test.
Test: run libunwindstack_test.
Test: run libbacktrace_test.
Test: run memunreachable_test.

Change-Id: Icf281c352f4103fc8d4ba6732c5c07b943330ca1
2018-05-14 14:00:18 -07:00
Chih-hung Hsieh
4578d132c7 Merge "Expect optional (offset ...) in frame dump." 2018-05-14 20:51:42 +00:00
David Anderson
62e5b20b50 init/fs_mgr: prototype first-stage dm-linear support
This adds an API to fs_mgr for reading dm-linear tables out of device trees
and issuing device-mapper ioctls. The device tree code will be
implemented separately. The dm-linear structures in fs_mgr are organized
assuming we may want to pull them from sources other than DT (for
example, text files, binary blobs, or something hardcoded for testing).

File systems which are mounted from these logical partitions have
specific fstab requirements. The block device must be a partition name,
and if Verified Boot is used, that name must match the vbmeta partition name.
Second, the entry must have the "logical" fs_mgr flag. Example fstab
entry:

    vendor  /vendor  ext4  ro  wait,logical

Example fstab entry in device tree:

    vendor {
        compatible = "android,fstab";
        dev = "vendor";
        type = "ext4";
        mnt_flags = "ro";
        fs_mgr_flags = "wait,slotselect,avb,logical";
    };

Bug: 78914864
Test: N/A
Change-Id: I4d8878ea8858f26310119616cadc3ee0dd08566c
2018-05-14 12:43:42 -07:00
Chih-Hung Hsieh
3249b3a8dd Expect optional (offset ...) in frame dump.
* New lld could create files that map to non-zero
  offset at run time.

Test: debuggerd_test
Bug: 79590156
Change-Id: I12db0ebef489ba8a1e648a29d214f8d3c3703996
2018-05-14 11:07:54 -07:00
Mark Salyzyn
c8dd6b74e6 Merge "init: keychord inotify add IN_ONLYDIR" 2018-05-14 16:08:14 +00:00
Mark Salyzyn
f187715954 init: keychord inotify add IN_ONLYDIR
some minor cleanup.

Test: manual, boot, check registered chord works
Bug: 64114943
Change-Id: If809075445cfd5b6de0d4debc42cdc9559ddc7c4
2018-05-14 07:18:51 -07:00
David Anderson
a962ec0c73 adb: better error messages on deduplicated filesystems.
If BOARD_EXT4_SHARE_DUP_BLOCKS is true, "adb remount" will error saying
the filesystem is read-only. Instead, it will now list affected
partitions and explain why they can't be remounted.

Bug: 64109868
Test: adb remount with deduplicated system image
Change-Id: Ida737a6be8e9fe9ea26300897d82b1a149e72f6d
2018-05-11 13:20:31 -07:00
Sen Jiang
3607fe672a Merge "Match LZMA SDK 18.05 API." 2018-05-11 18:58:58 +00:00
Mark Salyzyn
7ea8047185 Merge "init: Add inotify for /dev/input/" 2018-05-10 19:44:44 +00:00
Mark Salyzyn
44692de855 init: Add inotify for /dev/input/
Since event sources can come and go asynchronously because of delayed
driver instantiation due to initialization or firmware upload, USB
attched devices, kernel module loads, or test automation sources like
monkey, add in inotify on /dev/input/ to support these possibilities.

Test: manual, boot, check registered chord works
Bug: 64114943
Change-Id: Ie598bb6f5bf94b2034ab33cf3be7fa15d3467141
2018-05-10 08:45:24 -07:00
Treehugger Robot
86dade8f6f Merge "Remove unused using statement / host stub" 2018-05-10 00:07:50 +00:00
Tom Cherry
2fa178a01e Remove unused using statement / host stub
GetIntProperty() isn't used after
Ied46e9346b4ca7931aa4dcf1c9dbc11de0e12d93, so it can be removed.

Test: build
Change-Id: I5736f553db1a615d51b8fe3cbf9b4aee89451076
2018-05-09 15:25:39 -07:00
Josh Gao
c97cea0d20 Merge "adb: add authorizing, connecting states to transport." 2018-05-09 20:43:31 +00:00
Steven Moreland
4880d44d2a Merge changes from topic "interface_builtins"
* changes:
  init: ServiceList FindInterface
  builtins: interface_{start, stop, restart}
2018-05-09 19:34:22 +00:00
android-build-prod (mdb)
53248e47f4 Merge "Documented adb install --instant" 2018-05-09 18:23:11 +00:00
Mark Salyzyn
98caf20a65 Merge changes from topic "b/64114943"
* changes:
  init: switch from /dev/keychord to /dev/input/
  init: use std::function for epoll handling
2018-05-09 16:49:57 +00:00
Felipe Leme
807be77c25 Documented adb install --instant
Test: m -j32 adb && ./out/host/linux-x86/bin/adb help 2>&1 | grep instant
Bug: 79422318

Change-Id: I2830a9e3cf81becac1a6334670d8dc487fe72322
2018-05-09 09:33:38 -07:00
David Brazdil
b5679cdace Merge changes from topic "hiddenapi-cherrypick"
* changes:
  Add support for logging complex events from C++.
  Add event log tag for hidden API access logging.
2018-05-09 08:10:19 +00:00
Dan Willemsen
0515943d7d Merge "Remove unused tags property from Android.bp files" 2018-05-09 05:59:03 +00:00
Logan Chien
bb783998ce Merge "libctuils: Exclude qtaguid.cpp from VNDK-SP variant" 2018-05-09 01:56:00 +00:00
Dan Willemsen
3e41f92cf5 Remove unused tags property from Android.bp files
The tags property is (and has always been) unused by Soong. The property has
been defined as a list of strings, and the `androidmk` converted any
LOCAL_MODULE_TAGS entries over to it, but we've never done anything with it.

In preparation for removing the definition from Soong, I'm removing it from all
Android.bp files in the tree.

Since this has never done anything, this is a no-op, but if you really did want
the Android.mk behavior, the proper way to define a module to be installed in
userdebug / eng builds is to use PRODUCT_PACKAGES_DEBUG or PRODUCT_PACKAGES_ENG
in the appropriate product makefile.

Change-Id: Id519b2c0ec352e45c470a1734dfc633bbe39937e
Exempt-From-Owner-Approval: global no-op build change
Test: remove `tags` from Soong, see errors go away.
2018-05-08 17:15:23 -07:00
android-build-prod (mdb)
e7020dc8e4 Merge "Remove more bogus <stdbool.h> #includes from C++." 2018-05-08 21:33:10 +00:00
Steven Moreland
6227e345e7 init: ServiceList FindInterface
FindService can't be used w/ interfaces due
to the fact that multiple interfaces can be
added to any given interface.

Bug: 79418581
Test: boot device, manually use ctl commands
Change-Id: I7c152630462c9b7509473bc190f5b30460fcc2bc
2018-05-08 14:26:44 -07:00
Steven Moreland
612d7a47bd builtins: interface_{start, stop, restart}
e.x.:
interface_start android.hardware.nfc@1.0/default
onrestart interface_restart android.hardware.nfc@1.0/default

Fixes: 79418581
Test: add this to a service, and killing that service, light is restarted
    onrestart interface_restart android.hardware.light@2.0::ILight/default
Change-Id: Ia7ac9380f01038752325cfbe030df1dd4a5665e2
2018-05-08 14:26:22 -07:00
Mark Salyzyn
353bf1f945 init: switch from /dev/keychord to /dev/input/
Replace deprecated /dev/keychord driver with /dev/input/ interface.
Will restrict which nodes are active and relevant, and try to mask
out any unreferenced inputs with EVIOCSMASK if available.

Test: manual, boot, check registered chord works
Bug: 64114943
Change-Id: I2bbf84a6e472d720f02282e10d56795b75ac62d1
2018-05-08 13:19:12 -07:00
Tom Cherry
8ae7375f02 init: use std::function for epoll handling
Also allow unregistering of epoll handlers.

Bug: 64114943
Test: boot
Change-Id: I2abe6a56fd451839931d607dddb91669a7d02ff1
2018-05-08 13:19:12 -07:00
android-build-prod (mdb)
b004620f80 Merge "Make fastboot host builds match adb." 2018-05-08 20:06:18 +00:00
Elliott Hughes
23b98f492b Remove more bogus <stdbool.h> #includes from C++.
Bug: N/A
Test: builds
Change-Id: I794cd28667c6c65b38940d8f443315ad116b7ac3
2018-05-08 13:00:06 -07:00
Elliott Hughes
645b50e75d Make fastboot host builds match adb.
Bug: http://b/79131183
Test: builds
Change-Id: I572362e8d1c52ebbfb78f84fd2af5428711317d7
2018-05-08 11:30:07 -07:00
Logan Chien
25b742c627 libctuils: Exclude qtaguid.cpp from VNDK-SP variant
This commit excludes `qtaguid.cpp` from the VNDK-SP variant of
`libcutils.so` because the interface of `libnetd_client.so` may vary
between AOSP releases.

Besides, these functions don't work in vendor processes either because
VNDK-SP libraries are loaded in an isolated `vndk` linker namespace,
which cannot access `/system/lib[64]/libnetd_client.so` directly.  This
change makes it easier to spot the issue at build time and saves several
bytes.

Test: Build aosp_walleye-userdebug and
/system/lib[64]/vndk-sp-$VER/libctuils.so no longer exports qtaguid_*
functions.

Bug: 79329469
Change-Id: Idf6b60f6e58371ea320193641669d1e4412d62b8
2018-05-08 17:41:21 +08:00
Mathew Inwood
07787e6059 Add support for logging complex events from C++.
Also include relevant new metric_logger.proto values.

Test: m
Test: Exercised by ag/3890335 in art
Bug: 77517571
Merged-In: Ia527f2b94c7a6147ad9d537376266e5ffc597b04
Change-Id: Ia527f2b94c7a6147ad9d537376266e5ffc597b04
(cherry picked from commit d0613ac54a)
2018-05-08 10:27:09 +01:00
Mathew Inwood
e07d90dd9d Add event log tag for hidden API access logging.
This new event is logged by ART when hidden API accesses are detected.

Test: m
Test: $ adb lolcat -b events
Bug: 64382372
Bug: 77517571
Merged-In: I5ebb1424d83686dade0d34b118944b0c4c0c7bb1
Change-Id: I5ebb1424d83686dade0d34b118944b0c4c0c7bb1
(cherry picked from commit 8ec1c7ea7c)
2018-05-08 10:26:36 +01:00
Logan Chien
751f2fa535 Merge "init: Use sepolicy version instead" 2018-05-08 01:43:07 +00:00
android-build-prod (mdb)
a6a266af00 Merge "fs_mgr: target-agnostic device-mapper helpers" 2018-05-07 20:59:40 +00:00
android-build-prod (mdb)
035a1c7a0b Merge "bootstat: test reboot rescueparty" 2018-05-07 18:45:10 +00:00
Mark Salyzyn
cd7e122285 bootstat: test reboot rescueparty
This test fails on most devices, gives us a report of devices that
do not propagate the boot reason via the bootloader.  This should
become a bootloader required test.

Test: boot_reason_test.sh optional_rescueparty
Change-Id: Ibdc7b23b025e5d89d659ff08083b2e071343923c
2018-05-07 10:10:18 -07:00
Josh Gao
704494b070 adb: add authorizing, connecting states to transport.
Add two states: connecting and authorizing, to disambiguate the offline
and unauthorized states, respectively.

Previously, devices would transition as follows:

  offline -> unauthorized -> offline -> online
  offline -> unauthorized (when actually unauthorized)

With this patch:

  connecting -> authorizing -> online
  connecting -> authorizing -> unauthorized (when actually unauthorized)

This allows test automation and the like to distinguish between offline
devices, unauthorized devices, and working devices without having to
do retry loops with arbitrary sleeps on their end.

Bug: http://b/79257434
Test: adb_test
Test: adbd_test
Test: manually plugging in a device with `while true; do adb shell echo foo; done`
Change-Id: I036d9b593b51a27a59ac3fc57da966fd52658567
2018-05-04 18:05:18 -07:00
android-build-prod (mdb)
48cf760bea Merge "Remove the 'optional' tag from demangle_fuzzer" 2018-05-04 22:25:53 +00:00
Jeffrey Vander Stoep
24e87383f1 Merge "Logd: include app package name in selinux metadata" 2018-05-04 21:09:19 +00:00
Zach Riggle
d2a594c773 Remove the 'optional' tag from demangle_fuzzer
This causes it to not actually be added to the tests zip, and it
is never available on-device unless *manually* built and pushed.

Test: mmma system/core/demangle
Change-Id: I7fd7f52726b9b981573063c32f25ccab933486a0
2018-05-04 15:59:07 -05:00