* 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
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>
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>
/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
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
The existing APIs will truncate the byte array in case of '\0' in between.
Test: test_drive with atom 103
Change-Id: I104d35b330c6b52e2fdce1f5d4305dca08228f1b
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
* 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()
Let libsysutils able to be statically linked by libnetd_resolv to
minimize the dependence on system ABI.
Test: m libsysutils
Change-Id: Ideb322dbc8d594a8a37d64f8140bc37090a4e238
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
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
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
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
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>
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
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
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