Commit graph

44325 commits

Author SHA1 Message Date
Elliott Hughes
01705e4f1d Clean up libcutils/libutils tests.
Move tests in the same directory as the corresponding code, so it's
easier to see what is/isn't tested.

Fix naming of libcutils_tests (plural) to match the singular that's more
common (even though the plural makes more sense to me).

Add these two to system/core/'s TEST_MAPPING.

Remove obsolete AndroidTest.xml.

Fix a flaky (timing-dependent) libcutils test.

Test: ran tests
Change-Id: I7e0a31ff45c8a152562bf66fc97161594249366e
2019-02-11 13:15:56 -08:00
Tom Cherry
ea57928f00 Merge "liblog: remove visibility macros" 2019-02-11 18:43:13 +00:00
Treehugger Robot
38c143e8c0 Merge "meminfo: make dmabuf_dump dependency on debugfs optional" 2019-02-10 14:55:19 +00:00
Treehugger Robot
2d31b4b023 Merge "libmeminfo: make libdmabufinfo and dmabuf_dump vendor available" 2019-02-10 14:54:53 +00:00
Treehugger Robot
ea353cab91 Merge "Eliminate the APEX name in fs_config using wildcard" 2019-02-09 01:32:50 +00:00
Treehugger Robot
03cb8010ef Merge "Revert^2 "Enable APEX stubs for libnativeloader."" 2019-02-09 01:16:32 +00:00
Treehugger Robot
c1fd33546e Merge "bootstat: crash when parsing ro.boot.boottime" 2019-02-08 23:50:42 +00:00
Mark Salyzyn
9560f14755 Merge "fs_mgr: overlayfs: documentation: update kernel patch details" 2019-02-08 20:46:24 +00:00
Mark Salyzyn
7c72116c43 bootstat: crash when parsing ro.boot.boottime
If ro.boot.boottime is malformed or truncated, it will crash
bootstat operations.

Test: compile
Bug: 121161069
Bug: 124114707
Change-Id: Ie2edcffb6d54a8e0c7f2e9a89ae4b29cce246d75
2019-02-08 19:54:41 +00:00
Mark Salyzyn
60d5467bd8 fs_mgr: overlayfs: documentation: update kernel patch details
Confusion has occurred with respect to the kernel patch requirements,
added some clarity.

Corrected some spelling mistakes in other areas.

Test: inspect gitties and run spell
Bug: 118225373
Change-Id: I4ff9497aa5a584b20e9cb2028342aa4e7e4660c3
2019-02-08 11:49:05 -08:00
Tom Cherry
2d9779e87b liblog: remove visibility macros
Visibility is managed through version scripts now.

Bug: 123349183
Test: build
Change-Id: Ia388611a2ec14d0ff9c3896cfe97ccdce17dbb8b
2019-02-08 11:48:19 -08:00
Jiyong Park
defdb18675 Eliminate the APEX name in fs_config using wildcard
Bug: 123743953
Test: Marlin/sailfish boots to the UI
Change-Id: If1669122be78255879ffb8c8c0a7408a34b5e617
2019-02-09 02:59:17 +09:00
Treehugger Robot
2210f80e48 Merge "fs_config supports shell wildcard patterns" 2019-02-08 15:38:43 +00:00
Treehugger Robot
2dcb4160fa Merge "Fix 32-bit dmabuf_dump build" 2019-02-08 09:22:05 +00:00
Nicolas Geoffray
82503887fa Merge "Don't abort the build if a repo doesn't have the test/vts/tools/build/." 2019-02-08 08:48:28 +00:00
Nicolas Geoffray
646c6d902d Don't abort the build if a repo doesn't have the test/vts/tools/build/.
Test: build with master-art manifest
Exempt-From-Owner-Approval: Required for unbreaking ART development.
Change-Id: I6afc0e5444dfa21532a4c802f8c463091cab2b11
2019-02-08 08:47:12 +00:00
Treehugger Robot
9c4fda6cd2 Merge "adb: "support" O_CLOEXEC in adb_open on Windows." 2019-02-08 06:56:47 +00:00
Treehugger Robot
151499e47e Merge "adb: hopefully deflake test_adb.py." 2019-02-08 05:46:16 +00:00
Colin Cross
0a92453a14 Fix 32-bit dmabuf_dump build
Fixes:
system/core/libmeminfo/libdmabufinfo/tools/dmabuf_dump.cpp:109:39: error: format specifies type 'unsigned long' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat]

Test: lunch aosp_arm-eng && m dmabuf_dump
Change-Id: Ie605d9b94f5eff888f6a64801512216253a6babb
2019-02-07 21:35:03 -08:00
Wei Wang
575996837c Merge "bootstat: Update boot reason property earlier" 2019-02-08 02:55:13 +00:00
Wei Wang
4e9c653c93 bootstat: Update boot reason property earlier
bootstat updates boot reason upon boot_complete, however users of the
updated properties e.g. getLastShutdownReason from PowerManager could
be called before boot_complete. This introduces a inconsistency and
racing for those APIs.

In this CL, we change boot reason to be updated at the same time when
zygote starts where persist properties have been loaded already. Also
the initialization of bootloader's boot reason is pulled into post-fs
where all kernel command line arguments have been parsed in init already.

Bug: 122696730
Bug: 119509425
Test: trigger thermal shutdown and see warnings
Test: verify boot reason properties updated correctly post boot
Change-Id: Ia393b98ea072bc0ae6e4110d111393b34be0ee5d
Signed-off-by: Wei Wang <wvw@google.com>
2019-02-08 02:55:06 +00:00
Treehugger Robot
708d45979c Merge "meminfo: add tools/dmabufinfo_dump to dmabufinfo" 2019-02-08 02:53:54 +00:00
Treehugger Robot
a0b17a3d8b Merge "vts test for /proc/<pid>/smaps_rollup" 2019-02-08 02:05:55 +00:00
Josh Gao
aa95aa063f adb: hopefully deflake test_adb.py.
The reconnection test is spuriously failing on test infrastructure for
unclear reasons, which might be due to a race between the connection
attempt and the first command we send. Insert a sleep to hopefully
reduce the flakiness.

Bug: http://b/123247844
Test: ./test_adb.py (but it didn't fail for me in the first place)
Change-Id: Ic36924c16bae424accfec700af4623794fd1f123
2019-02-07 17:53:29 -08:00
Erick Reyes
32afafa67e Merge "meminfo: Fix dmabufinfo total ref accounting" 2019-02-08 01:48:01 +00:00
Treehugger Robot
3dbdf65afc Merge "Freshen libsystem/OWNERS" 2019-02-07 22:33:39 +00:00
Josh Gao
4b019a5f25 adb: "support" O_CLOEXEC in adb_open on Windows.
Previously, we were rejecting the flag and failing with EINVAL. File
handles aren't inherited by default, so just ignore the flag.

Bug: http://b/123753498
Test: adb install --streaming foo.apk
Change-Id: I17401fcdd58024956d47a5c4c0c57b06831d9817
2019-02-07 14:23:39 -08:00
Jiyong Park
a2159c493b fs_config supports shell wildcard patterns
It now supports shell wildcard pattern matching using fnmatch(3).

Bug: 123743953
Test: atest libcutils_test
Change-Id: Ib82ae3bf717cbdba267024e1c9d3da004274b95c
2019-02-08 03:53:52 +09:00
Mark Salyzyn
c6a2d7d5cd Merge "fs_mgr: overlayfs: fs_mgr_overlay_setup true if already mounted" 2019-02-07 18:25:55 +00:00
Jesse Hall
9c8e3c3a93 Freshen libsystem/OWNERS
Test: none
Change-Id: I6ce1f28bdc6553910a4e4dafb125d05d9e11035a
2019-02-07 10:19:01 -08:00
Mark Salyzyn
4e3a5f61a4 Merge "fs_mgr: overlayfs support legacy devices (marlin)" 2019-02-07 18:03:55 +00:00
Jiyong Park
186661d135 Merge "Configure /system/apex/com.android.runtime.[debug|release]/bin/*" 2019-02-07 16:08:24 +00:00
Elliott Hughes
5f5ffc8e19 Merge "MappedFile and FileMap should support zero-length mappings." 2019-02-07 15:45:03 +00:00
Martin Stjernholm
a015ad2779 Revert^2 "Enable APEX stubs for libnativeloader."
This reverts commit 5c8c6a90fd.

Reason for revert: Another try with http://r.android.com/892234 in place.

Test: Flash and boot
Bug: 113373927
Change-Id: I508c217a177e9cdd65d8a405d1315aeeacabe18d
2019-02-07 15:23:49 +00:00
Joel Fernandes
3133b695e0 Merge changes from topic "memfd-support"
* changes:
  init: set the sys.use_memfd property to false
  Add support for memfd
2019-02-07 14:17:13 +00:00
Treehugger Robot
d338c1f8e6 Merge "Add some overview docs for classloader-namespace." 2019-02-07 05:35:46 +00:00
Suren Baghdasaryan
3a22225ac6 Merge "libprocessgroup: Fix file mode parsing that requires octal values" 2019-02-07 04:54:28 +00:00
Erick Reyes
c4cac8f17f meminfo: make dmabuf_dump dependency on debugfs optional
dmabuf_dump had a hard dependency on debugfs to gather the initial list
of buffers for all proceses, make it optional.

Change-Id: I1d271297c0ad6124b321a1ee8aa01d3e88ca9fed
Signed-off-by: Erick Reyes <erickreyes@google.com>
2019-02-06 18:47:38 -08:00
Erick Reyes
2f6792e286 libmeminfo: make libdmabufinfo and dmabuf_dump vendor available
Removed dependency on libc++fs and changed liblog to shared linkage to
cope with build errors derived from the change.

Removed dmabuf_dump unnecessary dependencies and made it soc_specific.

Removed reference to std::filesystem::is_symlink to workaround the
following error when linking with the library:

ld.lld: error: undefined symbol:
std::__1::__fs::filesystem::__symlink_status(std::__1::__fs::filesystem::path
const&, std::__1::error_code*)
>>> referenced by filesystem:1743
(external/libcxx/include/filesystem:1743)
>>>
dmabufinfo.o:(android::dmabufinfo::AppendDmaBufInfo(int,
std::__1::vector<android::dmabufinfo::DmaBuffer,
std::__1::allocator<android::dmabufinfo::DmaBuffer> >*)) in archive

Bug: 63860998

Change-Id: Ieafdc87c64f153625df9e21fc8299292b2447aef
Signed-off-by: Erick Reyes <erickreyes@google.com>
2019-02-06 18:47:31 -08:00
Suren Baghdasaryan
40673c9250 Merge "libprocessgroup: Fix cgroup directory ownership setup" 2019-02-07 01:42:00 +00:00
Joel Fernandes
ae7f052328 init: set the sys.use_memfd property to false
The sys.use_memfd property is set by default to false in Android
to temporarily disable memfd, till vendor and apps are ready for it.
The main issue: either apps or vendor processes can directly make ashmem
IOCTLs on FDs they receive by assuming they are ashmem, without going
through libcutils. Such fds could have very well be originally created with
libcutils hence they could be memfd. Thus the IOCTLs will break.

Set default value of sys.use_memfd property to true once the issue is
resolved, so that the code can then self-detect if kernel support is present
on the device. The property can also set to true from adb shell, for
debugging.

Bug: 113362644

Change-Id: I0f572ef36cac2a58fe308ddb90bbeffbecdaed3b
Signed-off-by: Joel Fernandes <joelaf@google.com>
2019-02-07 00:40:22 +00:00
Joel Fernandes
519440468b Add support for memfd
This patch adds support to make libcutils create and use memfd where
possible, instead of ashmem.

The libcutils library is made dynamic, since apps are still sending over
ashmem FDs to processes and we are working on moving those apps away
from ashmem. The best we can do for that is make the library work, and
force apps in the long run to move away from directly using ashmem.

Due to further complications mentioned in the 'NOTE' section of the
patch, memfd is kept disabled for now, so nothing changes yet. To enable
it, set the sys.use_memfd property (check user_debug build).

Bug: 113362644
Change-Id: I491cb7841b664db5b1c26b3e07a440a14810e182
Signed-off-by: Joel Fernandes <joelaf@google.com>
2019-02-07 00:40:13 +00:00
Tom Cherry
500b6c0e86 Merge "init: allow services to have no capabilities set" 2019-02-06 23:48:36 +00:00
Mark Salyzyn
fab9f08ea5 fs_mgr: overlayfs: fs_mgr_overlay_setup true if already mounted
fs_mgr_overlayfs_setup return false second time around if all
are setup. It should report true if candidate list is all done.

Test: adb-remount-test.sh
Bug: 122602260
Change-Id: Ic9e16489e2c8ac4d3de91fcf8cfceedc23595e94
2019-02-06 15:35:45 -08:00
Mark Salyzyn
6d109ecba3 fs_mgr: overlayfs support legacy devices (marlin)
Expand the tests to deal with the boot environment for marlin.
Recognize that older overlayfs drivers do not report to /sys/module
and the parsing /proc/filesystem is another place to interrogate this.

Suppress adb push and pull noise during testing.  Resolve APEX
failures.  Add some cleanup to test script.

NB: Running test to completion is difficult because marlin's USB
    driver is flakey enough through the multitude of reboots and
    may not reconnect.  The tester will have to notice when a reboot
    is stalling and manually disconnect and reconnect the USB
    connection to trigger discovery and to continue through the
    test sequences.  To make this easier, report when we are
    waiting for the device to make it easier to babysit.

Test: system/core/fs_mgr/tests/adb-remount-test.sh
Bug: 120448575
Bug: 123079041
Change-Id: I5fc5f01b4e4788ac57541cb5235f7ac4e4284d71
2019-02-06 15:35:29 -08:00
Erick Reyes
fd79d4305a meminfo: add tools/dmabufinfo_dump to dmabufinfo
Adding tool to dump the dmabuf information using the dmabufinfo library.

Test: run "dmabuf_dump" and "dmabuf_dump <pid>" on crosshatch
Bug: 63860998

Change-Id: I16fe0a701deb5086ca0e1a8ceecb70dbc17934e6
Signed-off-by: Erick Reyes <erickreyes@google.com>
2019-02-06 15:26:05 -08:00
Erick Reyes
e3518d41d8 meminfo: Fix dmabufinfo total ref accounting
The number of references to a buffer total_refs was not accounting for
a process holding multiple references to the same buffer.

Also, clarify AppendDmaBufInfo functionality in comments

Change-Id: I044a18acad1570492a925d51b9464d5b0e60ca35
Signed-off-by: Erick Reyes <erickreyes@google.com>
2019-02-06 15:26:05 -08:00
Elliott Hughes
eb0ef145fd MappedFile and FileMap should support zero-length mappings.
Bug: http://b/119818070 "app crashes when reading asset of zero length"
Test: ran tests
Change-Id: Idd2ad6f6e72c8e445aff78a460fac96dea41c950
2019-02-06 14:29:35 -08:00
Suren Baghdasaryan
e3ad888011 libprocessgroup: Fix cgroup directory ownership setup
When cgroup directory is created its user and ownership gets set, however
because previous code was storing getpwnam() return value the second
invocation would effectively override the previous ones result. Fix this
by copying necessary results. Also change getpwnam() to getgrnam() when
group name is converted into gid. getpwnam() works because of the way
Android uses these ids, however more generally this is incorrect and
getgrnam() should be used instead.

Bug: 111307099
Test: verified user/group membership of the cgroup directories
Change-Id: I78668bc1a36a74f53d8e9825e2d06e3e09501e7a
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-02-06 14:28:23 -08:00
Martin Stjernholm
b78f6ec7ef Add some overview docs for classloader-namespace.
Courtesy of jiyong@.

Test: n/a
Change-Id: I4ee239c63a5b5f90516b05af25b32ff22b147d53
2019-02-06 21:51:27 +00:00