Commit graph

43566 commits

Author SHA1 Message Date
Treehugger Robot
556fc786c6 Merge "libmeminfo: Add ReadSysMemInfo variants" 2018-12-12 01:25:51 +00:00
Chih-hung Hsieh
8ae3ca87fd Merge "Fix cert-dcl16-c clang-tidy warnings." 2018-12-11 21:31:15 +00:00
Sandeep Patil
2f0b6ebfbe libmeminfo: Add ReadSysMemInfo variants
The new variant is primarily used in framework. See: go/ag/5780400
for usage. Also add tests, benchmarks and fix several issues found in SysMemInfo
class.

New benchmark results are:
--------------------------------------------------------------
Benchmark                       Time           CPU Iterations
--------------------------------------------------------------
BM_ReadMemInfo_old           7726 ns       7696 ns      90201
BM_ReadMemInfo_new           7554 ns       7525 ns      90358
BM_ZramTotal_old             6446 ns       6406 ns     108361
BM_ZramTotal_new             6529 ns       6488 ns     106545
BM_MemInfoWithZram_old      14485 ns      14412 ns      48492
BM_MemInfoWithZram_new      20572 ns      20459 ns      33438
--------------------------------------------------------------

The reason for BM_MemInfoWithZram_new shows worse numbers is because
the new API also tries to find more than 1 zram device (if it exists).
The old implementation hard coded everything to "/sys/block/zram0/"

Test: libmeminfo_test 1
Bug: 114325007
Bug: 111694435

Change-Id: I246d9e9a54986ee9b2542d1eaac79ecf7310b23a
Signed-off-by: Sandeep Patil <sspatil@google.com>
2018-12-11 10:38:33 -08:00
Chih-Hung Hsieh
5d08f63950 Fix cert-dcl16-c clang-tidy warnings.
Bug: 120614316
Test: make with WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=-*,cert-dcl16-c
Change-Id: I069b2c861cf7c349445c15bf789908377fe7227f
2018-12-11 10:38:27 -08:00
Treehugger Robot
36b5dd845c Merge "Revert "Remove obsolete ueventd.rc rules."" 2018-12-11 17:47:11 +00:00
Treehugger Robot
c400ced93d Merge "Revert "Add Android Runtime APEX lib directories to the system linker configuration."" 2018-12-11 13:41:10 +00:00
Roland Levillain
9b79db5ebf Revert "Add Android Runtime APEX lib directories to the system linker configuration."
This reverts commit 2f56b1fff8.

Reason for revert: Breaks bionic-unit-tests's dlfcn.dladdr_libc
and x86 CtsJniTestCases' JniStaticTest.test_linker_namespaces.

Bug: 113373927
Bug: 120661824
Change-Id: I9b34bcb240a42bf99c6d8b58db4b18a4f6d36961
2018-12-11 10:20:33 +00:00
Andy Hung
3fddf92465 Revert "Remove obsolete ueventd.rc rules."
This reverts commit d3b0b2708b.

Reason for revert: Regression in USB audio handling

Test: USB audio playback on Crosshatch
Bug: 120795549
Change-Id: Ibd05cd9b419f3e7988ce24a45f800d4bfe91ef6a
2018-12-11 04:14:30 +00:00
David Anderson
0059bc76c3 Merge "liblp: Reclaim wasted space from unaligned partitions." 2018-12-11 00:35:42 +00:00
Tom Cherry
e610ad619e Merge "fs_mgr: fix typo" 2018-12-10 21:44:30 +00:00
David Anderson
dccfdca1e1 liblp: Reclaim wasted space from unaligned partitions.
When allocating a partition with a size that is unaligned (to the
optimal alignment), the remaining sectors are wasted since they are
never reallocated. This is because the free list is guaranteed to only
contain optimally-aligned regions. Unfortunately this means when a
partition is resized, we are wasting a small amount of space each time.
On a non-A/B device, this could wind up being significant.

For example, with an alignment of 512KiB, a 4KiB partition at offset 0
will waste 508KiB of space. The next extent to be allocated by any
partition will start at the next 512KiB.

To address this, we round up extents to the optimal alignment. This
means partitions may wind up slightly over-allocated, versus before,
where they would waste space by making it unavailable.

Bug: 120434950
Test: liblp_test gtest
Change-Id: I555209b301058555526cc4309f7049ae81cf877d
2018-12-10 12:53:52 -08:00
Tom Cherry
298fd6d956 fs_mgr: fix typo
Bug: 62292478
Test: boot
Change-Id: I6bbb6190cb92dcd7f71c16494ea2f2b4871b8b0f
2018-12-10 10:58:38 -08:00
Tom Cherry
1fcf7f7d1f Merge "fs_mgr: use std::string in more places" 2018-12-10 17:34:23 +00:00
Tom Cherry
ac1812ddb5 Merge "Update fs_mgr_update_verity_state() for new C++ Fstab" 2018-12-10 17:17:28 +00:00
Roland Levillain
d768a0c13d Merge "Add Android Runtime APEX lib directories to the system linker configuration." 2018-12-10 15:04:29 +00:00
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
Tom Cherry
02eff5cccd Update fs_mgr_update_verity_state() for new C++ Fstab
Bug: 62292478
Test: boot and check verity state
Change-Id: I4912a16ada9a6d72480d7ac905654b764c5d18b6
2018-12-07 14:14:54 -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
Tom Cherry
c3e7bd3b32 fs_mgr: use std::string in more places
This will ease the transition in the future to using an Fstab struct
that uses std::string instead of char*.

Bug: 62292478
Test: boot

Change-Id: I170db74c2eb6dc16bd21fe65d7e7c685ce5c8b11
2018-12-07 12:35:46 -08: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