Commit graph

43548 commits

Author SHA1 Message Date
David Anderson
b81bc9ec00 Merge "fastboot: Wait for reboot-fastboot to complete before signaling success." 2018-12-08 06:19:52 +00:00
Treehugger Robot
581402bab9 Merge "Add OWNERS file" 2018-12-08 06:05:09 +00:00
Treehugger Robot
16aeee42b1 Merge "procmem2: Finish implementing all options" 2018-12-08 05:16:33 +00:00
Treehugger Robot
40f96aff36 Merge "Revert "Use apex/com.android.resolv/lib64/libned_resolv.so by default"" 2018-12-08 04:36:35 +00:00
Sandeep Patil
d346349d50 Merge changes from topic "procrank-ready"
* changes:
  Add procrank2
  libmeminfo: defer maps reading only when required for procmeminfo
  libmeminfo: Add support to reset workingset without procmeminfo objects
  libmeminfo: Add support to fiter accounting based on page flags
  libmeminfo: Add support to read zram memory consumption
  libmeminfo: Add support for counting swap pages
2018-12-08 01:44:13 +00:00
David Anderson
11d6d278cd fastboot: Wait for reboot-fastboot to complete before signaling success.
Bug: N/A
Test: manual test
Change-Id: I07495c1befcf63607c9996d6da6b4df05c060641
2018-12-07 16:39:55 -08:00
Andreas Gampe
d831773ec6 Revert "Use apex/com.android.resolv/lib64/libned_resolv.so by default"
This reverts commit eb4384c2a0.

Reason for revert: Breaks tests

Bug: 119527674
Bug: 120661824
Change-Id: I2f452f25e7b4e070e766b84cdefdf1800244b150
Test: N/A
2018-12-07 21:46:06 +00:00
Treehugger Robot
bcc2d60826 Merge "Removes ASEC-related install flags" 2018-12-07 18:11:09 +00:00
Tri Vo
dc978cc15b Merge "Remove obsolete ueventd.rc rules." 2018-12-07 17:53:00 +00:00
Sandeep Patil
44a4c0fdae Add OWNERS file
Change-Id: Id8421b9d7fb391615232a8a8e75ad8a68e20dfbc
Signed-off-by: Sandeep Patil <sspatil@google.com>
2018-12-07 09:29:03 -08:00
Sandeep Patil
99ed4a0b4e procmem2: Finish implementing all options
In the same time replace iomanipulators with
::android::base::StringPrintf which makes the output much more readable
and the overall program simpler.

Bug: 114325007
Bug: 111694435
Test: procmem 1
Test: procmem -W 1
Test: procmem -u 1
Test: procmem -p 1
Test: procmem -w 1
Test: procmem -w -u 1
Test: procmem -w -p 1

Change-Id: Ibf7ef59b24dfcb851c78a3b2fad672d96a708b98
Signed-off-by: Sandeep Patil <sspatil@google.com>
2018-12-07 09:16:35 -08:00
Sandeep Patil
a14119d069 Add procrank2
Implement procrank using new libmeminfo APIs. procrank2 is functionally
equivalent to procrank except for the part where the old procrank would
print processes under each oomadj level if called with 'procrank -c -o'.

The output format of 'procrank2' is identical to that of 'procrank'.
'procrank2' also gives significant performance boost over 'procrank' but
does cost a more memory as the library is written to 99% use case where
callers almost always want to read the memory usage of hte process.

Bug: 114325007
Bug: 111694435
Test:
     # adb push /google/data/ro/users/ss/sspatil/test-memutils.sh /data/local/tmp/
     # adb push procmem2 /data/local/tmp && adb push procrank2 /data/local/tmp
     # adb root && adb shell
     $ cd /data/local/tmp/
     $ chmod +x test-memutils.sh
     $ ./test-memutils.sh 2>&1 | tee test.log
Test:
  procrank:
    0m00.43s real     0m00.11s user     0m00.32s system
  procrank2:
    0m00.42s real     0m00.05s user     0m00.36s system

Change-Id: I37b71a4625248e333ba01801c0d8d7ef348e4cfa
Signed-off-by: Sandeep Patil <sspatil@google.com>
2018-12-07 09:15:16 -08:00
Treehugger Robot
ddf03be20a Merge "fs_config: add product and product_services to the scanning." 2018-12-07 16:52:04 +00:00
Tom Cherry
a64e9e843d Merge "ueventd: allow configuring SO_RCVBUF(FORCE) for the ueventd socket" 2018-12-07 16:27:20 +00:00
Patrick Baumann
24439442a8 Removes ASEC-related install flags
Bug: 109941548
Test: install still works
Change-Id: Ibaf87e678217a1ce140b4024d16ceb8d27fadec0
2018-12-07 16:15:31 +00:00
Treehugger Robot
73d03dc804 Merge "Fix adb not correctly reading return code from DeployAgent" 2018-12-07 08:58:35 +00:00
Treehugger Robot
87e10ba280 Merge "Use apex/com.android.resolv/lib64/libned_resolv.so by default" 2018-12-07 06:58:51 +00:00
yaochen
0db6f49cad Merge "Add a function to pass byte array to the log context." 2018-12-07 03:11:02 +00:00
Tri Vo
d3b0b2708b Remove obsolete ueventd.rc rules.
/dev/* nodes referenced in the removed rules are not present on Pixel
devices, i.e. android platform doesn't depend on these nodes. If a
device relies on one of these rules, the rule should be added to the
device-specific ueventd.rc.

Bug: 110962171
Test: boot walleye
Test: init_tests
Change-Id: I3262475d4ff22386e8da0436efaf98b208e4fa1c
2018-12-06 16:07:20 -08:00
Mark Salyzyn
757658c78d fs_config: add product and product_services to the scanning.
Test: compile
Bug: 119310326
Change-Id: I67ba155e4a03731d402cdfcf06ca80ad0c4ab2ed
2018-12-06 22:14:14 +00:00
Tom Cherry
e29101077c ueventd: allow configuring SO_RCVBUF(FORCE) for the ueventd socket
Some configurations won't allow ueventd to have CAP_NET_ADMIN, so the
new default size of 16M is not possible for those.  Those
configurations also won't need such a large buffer size, so this
change allows devices to customize the SO_RCVBUF(FORCE) size for the
uevent socket.

This is done by adding the line 'uevent_socket_rcvbuf_size <size>' to
your device's ueventd.rc file.  <size> is specified as a byte count,
for example '16M' is 16MiB.

The last parsed uevent_socket_rcvbuf_size line is the one that is
used.

Bug: 120485624
Test: boot sailfish
Test: ueventd unit tests
Change-Id: If8123b92ca8a9b089ad50318caada2f21bc94707
2018-12-06 13:35:52 -08:00
Yao Chen
6bd71aef37 Add a function to pass byte array to the log context.
The existing APIs will truncate the byte array in case of '\0' in between.

Test: test_drive with atom 103
Change-Id: I104d35b330c6b52e2fdce1f5d4305dca08228f1b
2018-12-06 13:03:12 -08:00
Treehugger Robot
e813ad4b4f Merge "Add missing includes." 2018-12-06 20:22:17 +00:00
Florian Mayer
3f1f2e07ab Add missing includes.
Test: Builds.
Change-Id: Ia8b79154902503cdd774dc3b4523466123b4324c
2018-12-06 10:09:20 -08:00
Henry Daitx
f21edf3edd Fix adb not correctly reading return code from DeployAgent
Certain error conditions were getting lost because adb was wrongly
reading DeployAgent's return code as always 0.

Test: mm -j 72
Test: adb install -r --fastdeploy --force-agent --local-agent /mnt/raid/boat-attack-apk/boat-attack-swappy.apk

Bug: 120197330
Change-Id: If835fd6ca2051be8e5ff6c957e08b1e458053989
2018-12-06 15:46:38 +00:00
Mark Salyzyn
215d1d510e Merge changes I368d3a56,Idb769991,Ia158b6ed
* changes:
  fs_mgr: overlay: use alternate for backing storage
  fs_mgr: overlay: split out fs_mgr_overlayfs_create_scratch()
  fs_mgr: overlay: split out fs_mgr_overlayfs_make_scratch()
2018-12-06 15:26:47 +00:00
Florian Mayer
a5913bdd07 Merge "Read .note.gnu.build-id." 2018-12-06 10:57:26 +00:00
Mike Yu
675a70be41 Merge "libsysutils can be linked statically" 2018-12-06 08:52:46 +00:00
Treehugger Robot
f2233fd67a Merge "Update shell documentation for the current state of master." 2018-12-06 03:49:24 +00:00
Mike Yu
c987859c70 libsysutils can be linked statically
Let libsysutils able to be statically linked by libnetd_resolv to
minimize the dependence on system ABI.

Test: m libsysutils
Change-Id: Ideb322dbc8d594a8a37d64f8140bc37090a4e238
2018-12-06 12:32:49 +09:00
Tom Cherry
05735591f8 Merge "init: disable asan" 2018-12-06 03:14:58 +00:00
Tom Cherry
50f5246352 Merge "Fix /init -> /system/bin/init symlink creation race" 2018-12-06 03:14:15 +00:00
Treehugger Robot
323ca1ea6b Merge "fs_mgr: Add fs_mgr_overlayfs_is_setup()" 2018-12-06 01:01:06 +00:00
Andreas Gampe
72050f715f Merge "Base: Explicitly set abort message on FATAL" 2018-12-06 00:14:17 +00:00
Tom Cherry
c12e205ec5 Fix /init -> /system/bin/init symlink creation race
A symlink for TARGET_ROOT_OUT as a post install command of a package
that is also installed to TARGET_ROOT_OUT.  We hijack init.rc which
satisfies this requirement for this symlink.

Bug: 120402274
Bug: 120460755
Bug: 120509320
Bug: 120554662
Test: symlink is created
Test: make bootimage && ls -la $OUT/root/init
Change-Id: I6f1ac06ef152c36d7d7db4618d49a008338da39b
2018-12-05 23:42:07 +00:00
Mark Salyzyn
f269312466 fs_mgr: overlay: use alternate for backing storage
When we have multiple physical super partitions, it is prudent to
take the alternate super physical partition in its raw entirety
rather than to construct a logical partition out of the current
super partition's limited remaining space.

SideEffect: alternate boot partitions destroyed for the sake of debug
Test: adb-remount-test.sh (including manually disabled to check
      both code paths).
Bug: 119885423
Change-Id: I368d3a5619f69de3b0d1fcad73c4b42d25d0d969
2018-12-05 14:01:59 -08:00
Mark Salyzyn
13a6605070 fs_mgr: overlay: split out fs_mgr_overlayfs_create_scratch()
Reduce some complexity in fs_mgr_overlayfs_setup_scratch()

Test: adb-remount-test.sh
Bug: 119885423
Change-Id: Idb769991f6342739c75654b1d42ab8f8633cbadf
2018-12-05 13:59:33 -08:00
Mark Salyzyn
d14eb57377 fs_mgr: overlay: split out fs_mgr_overlayfs_make_scratch()
Reduce some complexity in fs_mgr_overlayfs_setup_scratch()

Test: adb-remount-test.sh
Bug: 119885423
Change-Id: Ia158b6ed140a017fc2f5afb838482e0f8cba1222
2018-12-05 13:59:23 -08:00
Tom Cherry
f8315f073f init: disable asan
Asan requires /proc to be mounted, which means it fundamentally cannot
be used with first stage init.  Given that second stage init now
contains the logic for first stage init, asan must be disabled on all
of init until this can be resolved.

Bug: 120424438
Bug: 120561310
Test: Asan builds boot
Change-Id: I24d1a0c8ecb5eb3f77435e6e36432c7b4cb97c6a
2018-12-05 13:52:42 -08:00
Elliott Hughes
b9c064e140 Update shell documentation for the current state of master.
Test: N/A
Change-Id: I6efdd73ef44f376820f471dcfcd8005aa1e79cb0
2018-12-05 13:08:32 -08:00
Andreas Gampe
2819c0b831 Base: Explicitly set abort message on FATAL
Currently bionic only stores the first invocation of
android_set_abort_message, libbase splits the logging invocations
into discrete lines, and liblog automatically calls bionic when
fatal severity is used. This leads to only the first line of
LOG(FATAL) being stored for tombstoned.

Eagerly set the abort message directly before logging when the
severity is FATAL. This ensures the complete message will be
available.

Bug: 120506942
Test: m
Test: manual
Change-Id: I104d6960a2b1f66f21f5ada383fb4ab0f35e96a9
2018-12-05 12:59:15 -08:00
Tom Cherry
e1e71b9b98 Merge "init: allow first stage mount to read an fstab" 2018-12-05 20:32:08 +00:00
David Anderson
dbbbb17c1d Merge "fastboot: Check if super_empty.img exists before reading it." 2018-12-05 19:35:56 +00:00
Sandeep Patil
c6497eb1dc libmeminfo: defer maps reading only when required for procmeminfo
This restores the original behavior. The main reason it should be this
way is to make the class generic for all things memory under
/proc/<pid>/. For example, with the current behavior, a program that
only needs to read /proc/<pid>/smaps_rollup will end up wasting time and
memory by parsing /proc/<pid>/maps when the object is being constructed.
Same goes for a program that only wants to reset the working set.

The 'ProcMemInfo' object still retains the property that it can only be
used once to read maps and the object must be destroyed + recreated to
update the stats.

Bug: 114325007
Bug: 111694435
Test: libmeminfo_test 1
Test:
 # adb push /google/data/ro/users/ss/sspatil/test-memutils.sh /data/local/tmp/
 # adb push procmem2 /data/local/tmp && adb push procrank2 /data/local/tmp
 # adb root && adb shell
 $ cd /data/local/tmp/
 $ chmod +x test-memutils.sh
 $ ./test-memutils.sh 2>&1 | tee test.log

Change-Id: I856d3b78a0088cff02cbd010b29ffbe0e35f5ee2
Signed-off-by: Sandeep Patil <sspatil@google.com>
2018-12-05 09:31:10 -08:00
Sandeep Patil
f129199350 libmeminfo: Add support to reset workingset without procmeminfo objects
Bug: 114325007
Bug: 111694435
Test: libmeminfo_test 1

Change-Id: I816809cda13983e47294a956347a27085397cbcf
Signed-off-by: Sandeep Patil <sspatil@google.com>
2018-12-05 09:13:20 -08:00
Florian Mayer
da459e56f7 Read .note.gnu.build-id.
This will be used by heapprofd to allow us to correlate build ids with
memory leaks in libraries and binaries.

Test: m
Test: host libunwindstack_test
Test: run unwind_info against my phone's libc.so (32/64) and compare
      to readelf Build ID output.

Bug: 120186412

Change-Id: I3cefd6cce9a8733509bf35b7175eb0f967783477
2018-12-05 14:13:30 +00:00
chenbruce
eb4384c2a0 Use apex/com.android.resolv/lib64/libned_resolv.so by default
netd will use apex/com.android.resolv/lib64/libned_resolv.so to replace
system/lib64/libned_resolv.so.
note:Without disabling selinux, we setenv LD_LIBRARY_PATH in netd.rc but
netd couldn't use libnetd_resolv.so under com.android.resolv/lib64 because
LD_LIBRARY_PATH is ignored when AT_SECURE is on. Directly add path to the
libnetd_resolv apex to /system/etc/ld.config.txt for temporarily.

Bug: 119527674
Test: make; flash; lsof -p $(pidof netd)
Change-Id: I011d2da625151bf43c10497bb84c15f3d8e6ad33
2018-12-05 17:25:24 +08:00
David Anderson
0047580398 fastboot: Check if super_empty.img exists before reading it.
On non-DAP devices, fastboot flash <partition> will spam error messages
about not being able to read super_empty.img. We should check that
super_empty.img exists before trying to read it.

Bug: 120429424
Test: fastboot flash system on non-DAP device
Change-Id: I6c4eec19cb3ef8d24595a75e072e1d75baaa8cdd
2018-12-04 17:12:58 -08:00
Tom Cherry
5ae47e10c8 Merge "fs_mgr: use more unique_fd" 2018-12-05 00:32:36 +00:00
Alistair Strachan
5d55580fe1 Merge "Handle renamed "super" device correctly" 2018-12-05 00:06:41 +00:00