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>
Adds procmeminfo API to get the vector of swap_offsets
if SWAP is enabled on the device.
Bug: 114325007
Bug: 111694435
Test: libmeminfo_test 1
Change-Id: If0b52d042749a5bcb2c87aa2cb1595190d4769b1
Signed-off-by: Sandeep Patil <sspatil@google.com>
If we have multiple keys available for authentication (ADB_VENDOR_KEYS
+ the one in ~/.android), we will still have keys in our list of
avilable keys after we've successfully connected. A subsequent
reconnection will start authorizing using the list of keys after the
key that actually worked, resulting in that session being unauthorized
until another reconnection happens. Clear the key list before
reconnecting to fix this. (We could do this after successfully
connecting, but we need to do this before reconnecting anyway, because
our connection could have died during authorization.)
Bug: http://b/117267347
Test: `adb connect foo; adb -s foo reconnect device` with ADB_VENDOR_KEYS
Change-Id: Ieb7dcc28e333c89ae0d75f97e89bcd1b571cb299
When allocating "b" partitions on a non-retrofit A/B device, prioritize
regions occuring in the second half of the super partition. To make this
effective, the region covering the midpoint sector is split into two
additional regions.
This will allow OTAs to avoid unecessary fragmentation, since each
slot's partitions will be grouped together, leaving a large chunk of
contiguous space available when the OTA deletes the target slot. Since
updates are not allowed to consume more than half of the super
partition, this should guarantee one extent per partition. Note that, if
this restriction is not in place (for example, a developer flashes a
massive "system_b"), then an additional extent will be allocated due to
the region that was split.
Bug: 120433288
Test: liblp_test gtest
Change-Id: I1797e59e14c8b0d4d0e6855a1d984e8159b21df2
It was discovered that we were building some objects inconsistently due
to an optimization in cc_library to only build objects once and use them
for both the static and shared libraries. But static libraries didn't
get system_shared_libs set automatically, and we didn't notice that we
would have built the objects differently.
So static libraries now get the default system_shared_libs, we allow
adjusting that for static vs shared in a cc_library, and we disable the
optimization if the linked libraries are configured differently between
static and shared in a single cc_library.
This triggers dependency cycles for static libraries that libc/libdl
use, so fix those cycles here.
Test: treehugger
Change-Id: I6ec2ea45292b602d5c506560de8b8d6ae725be6f
Found a device with a 3/4MB erase block, give a wider margin so that
flashing a single partition is unlikely to be blocked by scratch.
Add documentation to tell developers to flashall to clear scratch.
Test: adb-remount-test.sh
Bug: 109821005
Change-Id: Ic219283f4c42e457b98991bcd1752253e182eff3
Increase size of the NETLINK_KOBJECT_UEVENT socket receive buffer to
16M. Also, use SO_RCVBUFFORCE to override any limits set by
/proc/sys/net/core/rmem_max.
We had a couple of instances, where we lost critical uevent messages due
to receive buffer overflows.
Bug: 119933843
Change-Id: I6aab183aa0194e173f9175b47c6beb0835cf6675
Create a C++ Fstab struct with the intention to eventually deprecate
the legacy C 'fstab' struct. This also contains functions for
converting between the two fstab variants to ease in the transition.
Bug: 62292478
Test: boot
Change-Id: I6fb51c6a99e65192708792719df01960cf6b432a
init add support for picking up partitions if specified by
fs_mgr_overlayfs_required_devices() as /dev/block/by-name/<partition>
Test: adb-remount-test.sh
Bug: 119885423
Change-Id: I6a4c3d9b5c2b406178f0acf0a86c52ab17209537
When the update-super command is issued, we want overlayfs overrides
to disappear without a doubt, which includes non-A/B utilizing
/cache/overlay/ tree. Call fs_mgr_overlayfs_teardown() on successful
return.
Test: adb-remount-test.sh
Bug: 120034852
Change-Id: Ia5cdb797f7e8350b5591a51fc8ae5f323901aee4
Disable overrides if we are booting up in recovery or fastbootd.
Check for existence of /system/bin/recovery.
Test: adb-remount-test.sh
Bug: 120034852
Change-Id: I946eb605300226d31356ecac209d6367f4e13526
For specific teardown operations, if we mount scratch with the
intention of it being temporary to strike out content for a specific
partition, umount it. Otherwise it could interfer with fastboot.
Test: adb-remount-test.sh
Bug: 120034852
Change-Id: Ieff3f6ea0bcda5eb540e9acf6cab8a56d1453b3e
Mount flags prefixed with MS_ are intended for the 'flags' entry of
fstab_rec, not fs_mgr_flags.
Coincidentally, this probably has always worked since this maps to the
'wait' flag, which is almost always set for system in the first place.
Test: build
Change-Id: Id4862bc087aa98e1f0e17145dc3ed74b5d867596
We don't need to call fsck, if magic is not matched at all.
Bug: 111895882
Change-Id: Ie728b02ff2fc7d4a20fc011f66643583ea708f9d
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
I accidentally changed some _mode enums from unsigned int to off64_t
along with the rest changes. They probably shouldn't have been
unsigned anyway though, so let's make them plain 'int' while we fix
the original typo.
Test: boot
Change-Id: I0c6c51a1a8170056b99087d249539eb79026cffe
Test script assumes overlayfs takeup after disable-verity, although
that can happen if verity is already disabled, it is not the case
for devices that just had it disabled. Move takeup and first stage
init tests downwards to where the condition is guaranteed.
Differentiate the test for devices that support or have verity, and
those that do not.
Fortify test to also use /data mount to check init first stage limit.
Test: adb-remount-test.sh
Bug: 109821005
Change-Id: I5241d6c97bf374614e50aa0aa18a1b9d118be093
This reverts commit 1272e7a592.
Reason for revert: All notice fix changes have been merged and running peacefully for a sustained period. Now this can be reverted for good.
Change-Id: I74e4e291a504fcb9a14ae50e916e494c7359db34
'off64_t' is the correct way to specify a size of a file system, so we
update the various fs_mgr fstab attributes accordingly.
Test: boot
Change-Id: I07ebe687b7c215a8d07ce49d6d32e81b798d1cd3