Commit graph

53818 commits

Author SHA1 Message Date
Tom Cherry
4e49f412c7 Merge "liblog: remove obsolete comment"
am: f5bad500f3

Change-Id: I63c3af0651d7160c862c8a22e20e3d571f41f6cd
2019-10-15 08:15:31 -07:00
Tom Cherry
f8a393f65c Merge "liblog: use RunLogTests() for more tests"
am: 7f79bc53cb

Change-Id: I11debdc1a8ad0dca27fea5a0a2e51a095676146b
2019-10-15 08:14:55 -07:00
Tom Cherry
f5bad500f3 Merge "liblog: remove obsolete comment" 2019-10-15 14:48:05 +00:00
Tom Cherry
7f79bc53cb Merge "liblog: use RunLogTests() for more tests" 2019-10-15 14:43:23 +00:00
Jiyong Park
07348eb619 Merge "Don't preload libneuralnetworks.so"
am: af15eff03b

Change-Id: Idade938fe6fb696b5a59c28ea25e630043dcac9f
2019-10-15 05:49:18 -07:00
Treehugger Robot
af15eff03b Merge "Don't preload libneuralnetworks.so" 2019-10-15 12:35:47 +00:00
Alessio Balsini
a6e3d497ae Utility class for COW size calculation
The Linux kernel's dm-snapshot relies on a COW device to keep trace of
all the modified sectors.
The COW device has a precise structure, which allows to compute its
space requirement in advance, as a function of:
- sector size;
- chunk size;
- list of modifications applied to the snapshot device.

Create a class that implements the COW device space occupancy given this
information.

Bug: 140835698
Test: libsnapshot_test
Change-Id: I50e3815741ee689d14fc3611532ff9d3b3e0e879
Signed-off-by: Alessio Balsini <balsini@google.com>
2019-10-15 13:06:48 +01:00
Jooyung Han
abe56ba48d Merge "Use com.android.vndk.current variant for vndk list"
am: 9e52397825

Change-Id: I48b450dd17f9454cf12a68c0c217ee13daaed3ca
2019-10-15 02:44:11 -07:00
Jooyung Han
9e52397825 Merge "Use com.android.vndk.current variant for vndk list" 2019-10-15 09:21:19 +00:00
Alessio Balsini
81b5c744e8 Merge changes I1cae6530,I7ffaa260
am: e34d239023

Change-Id: I820f359622aba7cb871928116acab57bdee53c47
2019-10-14 22:10:18 -07:00
Treehugger Robot
e34d239023 Merge changes I1cae6530,I7ffaa260
* changes:
  Publish chunk size in utility.h
  Remove magic numbers from test and use storage literals
2019-10-15 04:55:19 +00:00
Wei Wang
ee2f260223 sched_policy: add get_cpuset/sched_policy_profile_name
Expose API to return name of task profile for cpuset/sched policy so
that libprocessgroup clients using SetTaskProfiles directly don't have
to maintain the mapping. This reduces the risk of inconsistency and saves
memory.

Bug: 139521784
Test: atest libcutils_test:SchedPolicy
Change-Id: I414312a038613913fb6a827bdcefceb3dec21264
2019-10-14 20:03:06 -07:00
Yifan Hong
6bc5b47ac6 liblp: MetadataBuilder::NewForUpdate takes always_keep_source_slot arg
When applying a downgrade package on a Virtual A/B device
(to a non-Virtual A/B build), source slot partitions must
be kept in the metadata.

Test: liblp_test
Bug: 138258570
Change-Id: I87afe68bcfa768bdc015f5966b593758b856c741
2019-10-14 19:32:17 -07:00
Tom Cherry
c734eae375 liblog: remove unneeded checks and includes from headers
Test: build
Change-Id: Ifa3cffe60120fcc30a37239ceb2db46202a03471
2019-10-14 16:11:12 -07:00
Yifan Hong
1353e70278 [REFACTOR] healthd: BatteryMonitor::update split into 3 funcs
split bool update() into three functions:

void update()
void logValues()
bool isChargerOnline

... so that it doesn't depend on healthd_board_battery_update and
healthd_mode_ops, which are deprecated.

Test: health 2.0 VTS test
Bug: 142260281
Change-Id: I65908a04bae00654213efb4b5569ced0a7e76076
2019-10-14 14:07:13 -07:00
Tom Cherry
4e58c84854 liblog: remove obsolete comment
The log_time struct satisfies all of the requirements for an
implicitly created copy constructor to be present, so not defining one
here does not have any real effect.

We don't want to delete the copy constructor for the rationale given
either; modern C++ favors passing small types by value instead of by
reference as the compiler has more opportunity for optimization in
that case.  That's especially true here, where the size of this struct
is the size of a pointer on 64 bit systems.

Test: the copy constructor exists for log_time
Change-Id: Id314ca7729f4b1ca02adb6c7f0ae759b22be2a5c
2019-10-14 13:23:29 -07:00
Tom Cherry
c6a427205d liblog: use RunLogTests() for more tests
Continuing the speed up / clean up from the last change.

Enable a subtest that was previously disabled as well.  It passes 100s
of cycles now on CF.

Test: liblog-unit-tests
Change-Id: Ifff6f400c3736a1a857a3fdaf22d7ef1794abf9b
2019-10-14 13:11:26 -07:00
Alessio Balsini
9e95202e4d Publish chunk size in utility.h
The chunk size of the snapshot should be kept consistent among different
files.
Move it to libsnapshot/utility.h to improve its visibility.

Change-Id: I1cae6530a07c88f3a0091ca7d8bb2eb590a6710f
Bug: 140835698
Test: m
Signed-off-by: Alessio Balsini <balsini@google.com>
2019-10-14 21:07:07 +01:00
Alessio Balsini
3f6334e623 Remove magic numbers from test and use storage literals
Use constant expressions and storage literals to simplify readability.

Change-Id: I7ffaa260a2cd77dc0e24980f115f9e8df72708e6
Bug: 140835698
Test: libsnapshot_test
Signed-off-by: Alessio Balsini <balsini@google.com>
2019-10-14 21:07:02 +01:00
Tom Cherry
46fb1a5c23 Merge "init: trigger shutdown directly from builtins"
am: a5a107fb6d

Change-Id: I5ddb1a1db2f52b931fe851aacd36bf465b9affd6
2019-10-14 07:03:28 -07:00
Tom Cherry
a5a107fb6d Merge "init: trigger shutdown directly from builtins" 2019-10-14 13:48:52 +00:00
Jooyung Han
82f94d61cb Use com.android.vndk.current variant for vndk list
New linkerconfig reads some txt files which list various kinds of
vndk libraries. For example, vndksp.libraries.txt file has the list of
VNDKSP type libraries. The exact file names are retrieved from .vendor
variants.

With VNDK APEX, .vendor variants are not installed but
.com.android.vndk.current variants are packaged into VNDK APEX.

This CL changes the variant type from .vendor to
.com.android.vndk.current so that *.libraries.txt files can list the
installed files correctly.

Bug: 141451661
Test: m && device boot
Change-Id: Ibbc27b1ae6a44cc2337a0b14918caa27107a4c8e
2019-10-13 22:03:50 +09:00
Christopher Ferris
0c7c492e60 Merge "Replace MOCK_METHODN with MOCK_METHOD macro."
am: 3902531b86

Change-Id: Ic24d31f2407d13ce27741d4fd13632e00029fbd1
2019-10-11 18:00:55 -07:00
Christopher Ferris
3902531b86 Merge "Replace MOCK_METHODN with MOCK_METHOD macro." 2019-10-12 00:43:05 +00:00
Christopher Ferris
baf058bbf7 Replace MOCK_METHODN with MOCK_METHOD macro.
Test: Builds and unit tests pass.
Change-Id: I64e0034359c213f37c098d1c97be260bd955ca0f
2019-10-11 14:30:18 -07:00
Tom Cherry
28b46d9038 Merge "liblog: don't sleep in the middle of tests"
am: 212b8247ab

Change-Id: I9aa10100c3edd0f18307780e6b466223e5b82756
2019-10-11 14:08:40 -07:00
Tom Cherry
212b8247ab Merge "liblog: don't sleep in the middle of tests" 2019-10-11 21:00:02 +00:00
Tom Cherry
0dbfea7b07 init: trigger shutdown directly from builtins
Especially now that property_service is a thread, there may be some
delay between when init sets sys.powerctl and when the main thread of
init receives this and triggers shutdown.  It's possible that
outstanding init commands are run during this gap and that is not
desirable.

Instead, have builtins call TriggerShutdown() directly, so we can be
sure that the next action that init runs will be to shutdown the
device.

Test: reboot works
Test: reboot into recovery due to bad /data works
Change-Id: I26fb9f4f57f46c7451b8b58187138cfedd6fd9eb
2019-10-11 13:45:42 -07:00
Nikita Ioffe
0ed7feab32 Merge "Only allow alphanumerical characters, '-' and '_' in event trigger names"
am: 536e8ded6b

Change-Id: I2b2ebbb7c4bb4a66467de305e6e60b4df46c8dbc
2019-10-11 13:25:43 -07:00
Treehugger Robot
536e8ded6b Merge "Only allow alphanumerical characters, '-' and '_' in event trigger names" 2019-10-11 20:11:49 +00:00
Nick Desaulniers
861f7157de Merge changes I8804f7dd,I3cbca589
am: 0e9a0f9831

Change-Id: I70744367cbef05811348835593d1ff5bce1f21d1
2019-10-11 12:57:38 -07:00
Treehugger Robot
0e9a0f9831 Merge changes I8804f7dd,I3cbca589
* changes:
  [fs_mgr] fix -Wreorder-init-list
  [debuggerd] fix -Wreorder-init-list
2019-10-11 19:52:37 +00:00
Christopher Ferris
e7892efe38 Merge "Add method to get usage stats for a single map."
am: d1cb35bdef

Change-Id: I484fe41e49eafaeb9c9cea53507cfabd692b7f1d
2019-10-11 11:35:10 -07:00
Christopher Ferris
d1cb35bdef Merge "Add method to get usage stats for a single map." 2019-10-11 18:16:01 +00:00
Tom Cherry
dbc4815dbf liblog: don't sleep in the middle of tests
A lot of liblog tests follow this pattern:
1) Write a log message
2) Sleep ~1 second
3) Use the non_blocking log reader to dump all log messages
4) Test those log messages

This causes running back to back tests to be very slow and still
allows for some amount of flakiness if the system is very loaded.

This change replaces that pattern with the following:
1) Write a log message
2) Set an alarm for 2 seconds as a test timeout
3) Read logs with the blocking reader until finding the expected log
   messages
4) Test those log messages
5) Use the non_blocking reader to dump all log messages
6) Re-test those log messages, to ensure no duplicates, etc, which
   isn't done in step 3).

Despite dumping the logs twice, the tests are orders of magnitude
faster in the good case, and should be less prone to flakes.

Test: liblog-unit-tests
Change-Id: Iedf473316576b8007746fe3560815bde1813787a
2019-10-11 10:56:11 -07:00
Nick Desaulniers
8e048440e5 [fs_mgr] fix -Wreorder-init-list
C++20 will require members in a designated initializer to be in order
unlike C99.

Bug: 139945549
Test: mm
Change-Id: I8804f7dd5cba1035ac7a2979a47b661d722f664a
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
2019-10-11 10:54:53 -07:00
Nikita Ioffe
aaab596687 Only allow alphanumerical characters, '-' and '_' in event trigger names
This should help in preventing silly typos like "on foo:"

Test: atest CtsInitTestCases
Test: builds
Bug: 135984674
Change-Id: I6e4e18970e957d25dea9f557f0d31a759fbe6150
2019-10-11 17:44:54 +01:00
Alessio Balsini
1cabfe44b7 Merge "Fuzzer for libdm's dm-linear devices creation"
am: d4a1cd2cdd

Change-Id: Ib1f19b49053ea0de14603118555b1f66a3d5b710
2019-10-11 09:33:34 -07:00
Treehugger Robot
d4a1cd2cdd Merge "Fuzzer for libdm's dm-linear devices creation" 2019-10-11 15:38:23 +00:00
Greg Kaiser
27ee4c8d08 Merge "lmkd: Remove unnecessary conditional"
am: 6b0e789a21

Change-Id: Iaa24b3f79aa09fa3957c91b55a28c170196afd50
2019-10-11 07:46:38 -07:00
Treehugger Robot
6b0e789a21 Merge "lmkd: Remove unnecessary conditional" 2019-10-11 14:30:00 +00:00
Nikita Ioffe
0ee759cc4c Merge "userspace reboot: stop post-data services and wait for them to be killed"
am: 4592237300

Change-Id: I0f9e4a03f883c8cf301f3f918c921e91c9612f03
2019-10-11 03:39:10 -07:00
Alessio Balsini
66568bf4b0 Merge "Move TempDevice to test_util.h"
am: 30820a384c

Change-Id: Ie6fdce86c133bf54f8bce79593d8fbe3d9ead914
2019-10-11 03:38:40 -07:00
Nikita Ioffe
4592237300 Merge "userspace reboot: stop post-data services and wait for them to be killed" 2019-10-11 10:29:50 +00:00
Treehugger Robot
30820a384c Merge "Move TempDevice to test_util.h" 2019-10-11 10:18:43 +00:00
Orion Hodson
0110459633 Merge "Move libnative{bridge,loader} to art/"
am: 5a1489ce4e

Change-Id: Ie9794335a461f286f69bd8a60a9ddf72142728f0
2019-10-11 03:04:27 -07:00
Florian Mayer
d91c9eae3f Merge "Remove useless goto."
am: b8ba80ebd2

Change-Id: I6a47e60d3b68180a14afcd1ec80d2f71fb1abfd2
2019-10-11 03:03:56 -07:00
Treehugger Robot
5a1489ce4e Merge "Move libnative{bridge,loader} to art/" 2019-10-11 09:57:05 +00:00
Florian Mayer
b8ba80ebd2 Merge "Remove useless goto." 2019-10-11 09:41:36 +00:00
Jiyong Park
98b1c69253 Don't preload libneuralnetworks.so
The lib isn't used by most of the apps. Don't waste memory by preloading
it to all apps.

Bug: 142482121
Test: `lsof -p $(pidof zygote64) | grep libneuralnetwork` shows nothing
Change-Id: I4a6e3df838fa3b7a46271e548e9fdc87bea948ae
2019-10-11 10:31:12 +09:00