Commit graph

58243 commits

Author SHA1 Message Date
Alistair Delva
f19c48f85f Merge "Add ro.boot.fstab_suffix and modify mount_all to use it" am: 510d2437b4
Change-Id: Ic6737e2aaf9fc1309d4e5bd20e92378037686228
2020-05-28 00:19:05 +00:00
Alistair Delva
510d2437b4 Merge "Add ro.boot.fstab_suffix and modify mount_all to use it" 2020-05-28 00:04:02 +00:00
Treehugger Robot
f5a19271e1 Merge "liblp: delete unused function and fields" am: 37e8b5e587
Change-Id: I9217122c87b32d92664c22287a7ba45d5f204059
2020-05-27 18:47:47 +00:00
Treehugger Robot
37e8b5e587 Merge "liblp: delete unused function and fields" 2020-05-27 18:35:05 +00:00
Christopher Ferris
a40e0504be Merge "Fail explicitly on length overflow." am: d46eb21906
Change-Id: I3722824bf8aad86ced2765a8eda8f6cd54fba805
2020-05-27 03:37:56 +00:00
Christopher Ferris
d46eb21906 Merge "Fail explicitly on length overflow." 2020-05-27 03:17:03 +00:00
Yifan Hong
bcf3cc8cce liblp: delete unused function and fields
Test: builds
Change-Id: Ib7c93cfadacedc4f8d983c490e55fb4672cc9c1d
2020-05-26 23:02:31 +00:00
Christopher Ferris
68604b9c29 Fail explicitly on length overflow.
Instead of aborting when FileMap::create detects an overflow, detect the
overflow directly and fail the call.

Bug: 156997193

Test: Ran unit tests, including new unit test that aborted before.
Change-Id: Ie49975b8949fd12bbde14346ec9bbb774ef88a51
2020-05-26 12:00:07 -07:00
Elliott Hughes
854b9898ae Merge "libcutils: reimplement system property functions with libbase." am: 95e79c63a4
Change-Id: I2151d62faefced4e95ed7bef96be3580f59ac732
2020-05-26 17:40:42 +00:00
Elliott Hughes
95e79c63a4 Merge "libcutils: reimplement system property functions with libbase." 2020-05-26 17:27:56 +00:00
Tom Cherry
473b02289c Merge changes If6e29418,I6d90838e,Ie488f8ac am: f8f95a41f4
Change-Id: I6c6bfd78d879aaac8df26d0f387f280ce038889e
2020-05-26 15:31:59 +00:00
Tom Cherry
f8f95a41f4 Merge changes If6e29418,I6d90838e,Ie488f8ac
* changes:
  logd: create SimpleLogBuffer and implement ChattyLogBuffer in terms of it
  logd: separate Chatty only vs generic LogBufferTests
  logd: move current sequence from LogBufferElement to LogBuffer
2020-05-26 15:19:44 +00:00
Treehugger Robot
075f813c3b Merge "Update TEST_MAPPING." am: aa15ef4d0e
Change-Id: Ib8a1db306ab284880d56c08fe1d4023051591f5b
2020-05-22 02:03:36 +00:00
Treehugger Robot
aa15ef4d0e Merge "Update TEST_MAPPING." 2020-05-22 01:46:29 +00:00
Alistair Delva
a2cc1ebb72 Add ro.boot.fstab_suffix and modify mount_all to use it
Currently the ReadDefaultFstab function, which calls GetFstabPath,
makes some assumptions about what the fstab will be called and where
it is located. This is being used by vold to set up userdata encryption
and for gsid, and is even used in the default boot control HAL, so it
has become quite baked.

The original way for a board to specify things to mount was to use the
"mount_all /path/to/fstab" command in init.rc. However, due to the
above functionality, the path after mount_all is no longer very useful,
as it cannot differ from the inferred path, or userdata encryption and
other features will be broken.

On Cuttlefish, we have an interest in being able to test alternative
userdata configurations (ext4 vs f2fs, encryption on/off, etc.) and
currently the only way to achieve this is to either a) modify the
ro.hardware or ro.hardware.platform properties, which breaks a bunch
of things like default HAL filenames, or regenerate our odm.img or
vendor.img filesystems. We can't simply install another fstab and
point to it with "mount_all".

This change allows the fstab path to be omitted from "mount_all", and
adds another property which overrides the existing checks for
fstab.${ro.hardware} and fstab.${ro.hardware.platform}. Specifying
${ro.boot.fstab_suffix} will cause fstab.${ro.boot.fstab_suffix}
to be checked first.

Bug: 142424832
Test: booted cuttlefish with 'mount_all ${ro.hardware} --late'
Test: booted cuttlefish with 'mount_all --late'
Test: booted cuttlefish with 'mount_all --late' and fstab_suffix=f2fs
Test: partially booted cuttlefish with 'mount_all ${ro.hardware}'
Test: partially booted cuttlefish with 'mount_all'
Change-Id: I3e10f66aecfcd48bdb9ebf1d304b7aae745cbd3c
2020-05-21 16:38:40 -07:00
S Vasudev Prasad
100b08a848 libcutils: reimplement system property functions with libbase.
This makes the system property functions available on the host too, and
ensures a consistent view of system properties between libcutils and
libbase, if you have code running on the host that uses both.

Bug: http://b/151789258
Test: treehugger
Change-Id: Ie524a77d0c392d7b23e9d12becbb1bf53c81eac6
2020-05-21 16:20:16 -07:00
Elliott Hughes
ca3dd7ec34 Update TEST_MAPPING.
libbase and libziparchive both just moved out of system/core/, so I
don't think there's any value to running their tests when system/core/
changes. (I already added new TEST_MAPPING files to the two new projects.)

Test: treehugger
Change-Id: I0dd7acb525d9cca5349c55dc2724eab8d3a06afa
2020-05-21 14:26:34 -07:00
Tom Cherry
8f613464b8 logd: create SimpleLogBuffer and implement ChattyLogBuffer in terms of it
Test: unit tests with SimpleLogBuffer
Change-Id: If6e29418645b5491df9b8aeef8f95bb786aeba93
2020-05-21 14:23:45 -07:00
Tom Cherry
e18346d3d9 logd: separate Chatty only vs generic LogBufferTests
Separate these tests such that future log buffer implementations can
be run against the generic tests.  Use a parameterized fixture to
allow testing any number of log buffers.

Test: these unit tests
Change-Id: I6d90838e8efa019b934d08da25cab0c2405b66cd
2020-05-21 14:10:32 -07:00
Tom Cherry
a3c5ff5d3f logd: move current sequence from LogBufferElement to LogBuffer
This is required for tests that are aware of sequence numbers to pass;
each new LogBuffer instance should start from sequence = 1, which
isn't the case if the current sequence number is a static.

Test: unit tests
Change-Id: Ie488f8ac5e22b946b7e6237d1d5caf14929c0ec3
2020-05-21 14:10:17 -07:00
Tom Cherry
e288260524 Merge changes Ia7953e3c,Id1f29f4d,I38623130 am: f29cd20df5
Change-Id: Ide7fdcfd5b6060aec893991ed68a3ce95b75cf17
2020-05-21 21:03:47 +00:00
Tom Cherry
f29cd20df5 Merge changes Ia7953e3c,Id1f29f4d,I38623130
* changes:
  logd: use a std::list<> of values not pointers
  logd: refactor chatty deduplication logging
  logd: use RAII locks and thread annotations
2020-05-21 20:35:41 +00:00
Treehugger Robot
04c09d39cf Merge "emmc_optimized means stable_inodes" am: eb3be2e28f
Change-Id: Ie8f78b314d14f814df5f200a22ecb941bcefd16e
2020-05-21 20:05:15 +00:00
Treehugger Robot
4c199f5a28 Merge "libsnapshot: delete unused todo" am: 39fe8215e5
Change-Id: Idf419b8be3a8b1db6c33330b1f1ff83886dcb434
2020-05-21 20:05:04 +00:00
Treehugger Robot
eb3be2e28f Merge "emmc_optimized means stable_inodes" 2020-05-21 19:54:37 +00:00
Treehugger Robot
39fe8215e5 Merge "libsnapshot: delete unused todo" 2020-05-21 19:38:48 +00:00
Tom Cherry
1322472ad0 logd: use a std::list<> of values not pointers
This saves 4 or 8 bytes off of each log message for 32 bit or 64 bit
devices respectively.  In practice, this actually saves more, due to
avoiding heap fragmentation.

Averaging over 5 runs of the LogBufferTest.random_messages unit test
(32 bit), this change results in 8k less memory used when 1000 logs
are logged and results in 260k less memory used when 10000 logs are
logged.

Test: check memory usage during LogBufferTest.random_messages
Test: logging unit tests
Change-Id: Ia7953e3c4cb19631ef43bab1deb91bb336bc2520
2020-05-21 11:16:36 -07:00
Tom Cherry
a26f7dffe5 logd: refactor chatty deduplication logging
This code and comment is hard to follow, despite the operation being
simple, so refactor the code to be easier to follow.

Also, use std::unique_ptr instead of raw pointers as appropriate.

Test: logging unit tests
Change-Id: Id1f29f4deeca730d1e3b6856e1581d0b840f883e
2020-05-21 11:14:18 -07:00
Paul Crowley
c2f37683bc emmc_optimized means stable_inodes
If the emmc_optimized filesystem flag is set, then like
inlinecrypt_optimized, we have to ensure that stable_inodes is set
on the filesystem.

Bug: 144046242
Test: Cuttlefish, ext4: set the flag in fstab, check for the
    stable_inodes flag using tunefs -l
Change-Id: Id7f906564457c240ddf6677dd536698881385385
2020-05-21 11:14:05 -07:00
Tom Cherry
0b01ff0f39 logd: use RAII locks and thread annotations
Test: unit tests
Change-Id: I38623130a96f17a47ed79753e24b25efa9e38279
2020-05-21 11:07:04 -07:00
Yifan Hong
3f36212139 libsnapshot: delete unused todo
Too hard to make libsnapshot_fuzzer host supported.
Test: none

Change-Id: I974cea8f836b447e1fa6b676a1d95ebaf491442e
2020-05-21 11:03:01 -07:00
Tom Cherry
a4f37b2e76 Merge "logd: add tests for log deduplication" am: 0a6c83e7d0
Change-Id: I08a38ba52f6cf287fcf8fcc8f47d628ae54cb28f
2020-05-21 16:26:52 +00:00
Tom Cherry
0a6c83e7d0 Merge "logd: add tests for log deduplication" 2020-05-21 16:06:30 +00:00
Treehugger Robot
9640c76e05 Merge "adb: only submit USB writes on the worker thread." am: 4ea509e25d
Change-Id: I63e7eef74c293a008e33c856732ca25bbc03bba1
2020-05-20 23:51:05 +00:00
Treehugger Robot
4ea509e25d Merge "adb: only submit USB writes on the worker thread." 2020-05-20 23:34:37 +00:00
Tom Cherry
b398a7c85e logd: add tests for log deduplication
Fix a subtle bug that liblog event messages have a payload of int32_t,
not uint32_t, so they should only be summed to int32_t max.

Make a bunch of test improvements as well to support these.

Test: these tests
Change-Id: I4069cc546240bfffec5b19f34ebec913799674e8
2020-05-20 14:39:26 -07:00
Josh Gao
9e3e8c40e2 Merge "adb: fix flakiness in PTY shell protocol." am: b27365510d
Change-Id: I41c65bed67ceb644cf9d115bbc70883e16933dd9
2020-05-20 21:25:27 +00:00
Josh Gao
962551000b adb: only submit USB writes on the worker thread.
After USB disconnection, io_submit will block until the endpoint comes
back up. We handle this in the worker thread by sending it a signal to
break it out of io_submit when we notice that USB has gone down, but
opportunistic writes from the main thread can get stuck in this scenario
as well. Submitting the writes only on the worker thread doesn't have a
measurable impact on performance, so avert this scenario by only
submitting writes from the worker thread.

Bug: http://b/157078255
Test: test_device.py
Change-Id: I1118f2e2a70d13f15592eb996e7084033ed5cb9d
2020-05-20 21:03:18 +00:00
Josh Gao
b27365510d Merge "adb: fix flakiness in PTY shell protocol." 2020-05-20 21:01:23 +00:00
Treehugger Robot
6016dd02a4 Merge "adb: fix abb test." am: fc4e54ecb0
Change-Id: Ie4ea4e49688a7d0c6d593e8bc3f1930d6a16e6b1
2020-05-20 16:39:13 +00:00
Treehugger Robot
fc4e54ecb0 Merge "adb: fix abb test." 2020-05-20 16:25:45 +00:00
Baligh Uddin
876e883e0e Merge "Migrate system/core/base to system/libbase." am: 3b55f75706
Change-Id: Ic719e0fe67964336ebd25d94f8bb4e0bc14fc751
2020-05-20 12:38:51 +00:00
Baligh Uddin
3b55f75706 Merge "Migrate system/core/base to system/libbase." 2020-05-20 12:22:54 +00:00
Josh Gao
be41ae5666 adb: fix flakiness in PTY shell protocol.
When a subprocess closes its PTY slave, the master fd will report
POLLHUP when polled. This leads to us prematurely tearing everything
down, without reading out output that's been written to the PTY.

Resolve this by waiting until the fd no longer reports POLLIN.

Bug: http://b/156551485
Bug: http://b/156552734
Test: `adb shell 'X=0; while /data/nativetest64/adbd_test/adbd_test --gtest_filter="ShellServiceTest.*Pty*" >/dev/null 2>&1; do X=$((X+1)); echo $X; done'` for 1000 iterations (failed within 20, previously)
Test: test_device.py
Change-Id: Ie591e0cafb532cd6cebdf6f356dc967565b5a2d9
2020-05-19 20:54:40 -07:00
Rick Yiu
0d69819bf2 Merge "Add choice for changing sched policy when setting thread priority" am: 9ada65c0c6
Change-Id: Icacda86d1ea49588a94609e2e5d534ff3c289889
2020-05-20 03:25:18 +00:00
Josh Gao
8f83498cbd adb: fix abb test.
Don't hardcode cmd's output.

Bug: http://b/157092201
Test: python3 -m unittest test_device.AbbTest
Change-Id: I7145e8d2a31b1c1b459c1e55af3670b95e653eee
2020-05-19 20:12:52 -07:00
Rick Yiu
9ada65c0c6 Merge "Add choice for changing sched policy when setting thread priority" 2020-05-20 03:03:18 +00:00
Christopher Ferris
00586bd861 Merge "Add new reparse benchmarks." am: 1fbb1b8718
Change-Id: Ic38f5d173d5be0de2eff2a22728767beb2872a6f
2020-05-19 23:33:09 +00:00
Christopher Ferris
1fbb1b8718 Merge "Add new reparse benchmarks." 2020-05-19 23:12:27 +00:00
Baligh Uddin
28d0f1a3af Migrate system/core/base to system/libbase.
Add Symlink to ensure hardcoded references do not break build.
BUG: 148941208
test: TH

Change-Id: Ia2b69de1af6e07be2aab3ba4fe1493de80269c40
Merged-In: I1134f1e9e968b9273748e2483bea8d25e5c9e994
2020-05-19 21:32:42 +00:00