Commit graph

58942 commits

Author SHA1 Message Date
TreeHugger Robot
427e663b96 Merge "first_stage_init: add support to skip module load failures" into rvc-d1-dev 2020-05-01 23:27:42 +00:00
Suren Baghdasaryan
78b82bec83 task_profiles.json: add a new task profile used by camera HAL am: 0b4313fede
Change-Id: I008253a87cc8a7b77c41c94745cc9ee1c65229bf
2020-05-01 22:43:22 +00:00
Suren Baghdasaryan
90910f5489 init: Add task_profiles init command am: 21ae541691
Change-Id: I5a175d44ad5c88dcf245374d9a12ed424b1b7d3e
2020-05-01 22:43:20 +00:00
Suren Baghdasaryan
0b4313fede task_profiles.json: add a new task profile used by camera HAL
Add new CameraServicePerformance task profile used by camera HAL.

Bug: 155419956
Test: confirm profile applies correctly
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I21cf942eca279a5ad4c1ff75c735560954f4ebc1
Merged-In: I21cf942eca279a5ad4c1ff75c735560954f4ebc1
2020-05-01 22:21:09 +00:00
Suren Baghdasaryan
21ae541691 init: Add task_profiles init command
Introduce new command to allow setting task profiles from inside .rc
script. This is to replace usage of writepid when a service is trying
to join a cgroup. Usage example from a .rc file:

service surfaceflinger /system/bin/surfaceflinger
    task_profiles HighPerformance

Bug: 155419956
Test: change .rc file and confirm task profile is applied
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I0add9c3b363a7cb1ea89778780896cae1c8a303c
Merged-In: I0add9c3b363a7cb1ea89778780896cae1c8a303c
2020-05-01 22:20:57 +00:00
Will McVicker
6c5f82642b first_stage_init: add support to skip module load failures
Extend androidboot.first_stage_console cmdline property to enable
skipping module load failures without stopping at a serial console. This
is useful for GKI development.

Set androidboot.first_stage_console=2 for this behavior.

Bug: 155296582
Test: verify behavior for values 0, 1, and 2
Change-Id: I068c631a22c848e45a421b297b1acae1b3deb3c1
2020-05-01 13:48:33 -07:00
TreeHugger Robot
b7da236617 Merge "liblog: require root for multi_connect_dgram_socket test" into rvc-dev am: 67a92651a2
Change-Id: I1273e42167586a73eb4cebf5e863ffa0cd519204
2020-05-01 19:34:32 +00:00
TreeHugger Robot
67a92651a2 Merge "liblog: require root for multi_connect_dgram_socket test" into rvc-dev 2020-05-01 19:15:43 +00:00
David Anderson
1a7bb7d724 Merge "libfiemap: Ignore userdata requirements in fiemap_writer_test when running a DSU." into rvc-dev am: 0d246eb96a
Change-Id: Ia271ae0ede6597ef12d7727cd35d035d0f2517c8
2020-05-01 18:01:35 +00:00
David Anderson
0d246eb96a Merge "libfiemap: Ignore userdata requirements in fiemap_writer_test when running a DSU." into rvc-dev 2020-05-01 17:46:02 +00:00
Tom Cherry
3ac8ba1820 liblog: require root for multi_connect_dgram_socket test
Bug: 65062446
Test: multi_connect_dgram_socket is skipped for non-root
Test: multi_connect_dgram_socket passes for root
Merged-In: I610bed5987580e0c5a01952efc2e32e7d8cdf9b4
Change-Id: I610bed5987580e0c5a01952efc2e32e7d8cdf9b4
(cherry picked from commit 710825ce47)
2020-05-01 10:27:21 -07:00
TreeHugger Robot
5aeb69cd47 Merge "rootdir: init.rc: mount tracefs" into rvc-dev am: 84f253e40a
Change-Id: I2257cce38aeedab4acc21b8d140ffb083e6e826c
2020-05-01 14:55:32 +00:00
TreeHugger Robot
84f253e40a Merge "rootdir: init.rc: mount tracefs" into rvc-dev 2020-05-01 14:44:13 +00:00
Alessio Balsini
0006be8a6c snapshot_test: Fix overflow in statvfs arithmetics am: 2612f9b116
Change-Id: Ifcb544bd30ee55d9d23b54b1e2a8c5f94f8ebb14
2020-05-01 13:06:49 +00:00
Alessio Balsini
2612f9b116 snapshot_test: Fix overflow in statvfs arithmetics
Operations on (unsigned long) f_bsize and f_bfree are correctly handled
on 64 bit architectures, but when switching to 32 bit, the
multiplication between the two could result in an overflow, causing the
test to crash.
Fix by using a uint64_t operand, hinting the compiler to handle the
whole multiplication with 64 bit operands.

Bug: 154355449
Bug: 148889015
Test: vts_libsnapshot_test (32 bit)
Signed-off-by: Alessio Balsini <balsini@google.com>
Change-Id: Ief5c03ff7954c4a3e8597ef6e7df467f59428877
Merged-In: Ief5c03ff7954c4a3e8597ef6e7df467f59428877
2020-05-01 12:21:08 +01:00
Nikita Ioffe
3143c5c28a Merge "Add reason why userspace reboot shutdown sequence failed" into rvc-dev am: eb3f92f1ba
Change-Id: I6d8a9d0776bea7ef92174845cda1f9b5e8d1c315
2020-05-01 10:58:18 +00:00
Nikita Ioffe
dc3985f52b Merge "Reject services that are both critical and oneshot" into rvc-dev am: d172618e38
Change-Id: I6a17d256b26c28b0cb88d85f6c3c72e36db313fb
2020-05-01 10:57:43 +00:00
Nikita Ioffe
eb3f92f1ba Merge "Add reason why userspace reboot shutdown sequence failed" into rvc-dev 2020-05-01 10:42:49 +00:00
Nikita Ioffe
d172618e38 Merge "Reject services that are both critical and oneshot" into rvc-dev 2020-05-01 10:42:41 +00:00
yongcheol.lee
221de15b07 Restore fastboot delete-logical-partition command for VTS am: 65e8e3803e
Change-Id: Ia2af9b5c733538b1e2a82a286514657b4bb47b80
2020-04-30 23:35:31 +00:00
yongcheol.lee
65e8e3803e Restore fastboot delete-logical-partition command for VTS
1. delete-logical-partition was deleted
	- After merge "Don't require bootloader fastboot for VTS compliance." commit, delete-logical-partition sequence was deleted in LogicalPartitionCompliance test. "create-logical-partition failed" is occurred when run vts fastbootverification module. So restore this sequence.


Test: run vts -m VtsFastbootVerification
Bug: 153913610

Signed-off-by: Yongcheol LEE <yongcheol09.lee@lge.com>
Change-Id: I00366b281eafa5677b0941419a86f2702fb3484b
Merged-In: I00366b281eafa5677b0941419a86f2702fb3484b
2020-04-30 21:52:07 +00:00
Nikita Ioffe
a4e83ad3d7 Add reason why userspace reboot shutdown sequence failed
Test: atest CtsUserspaceRebootHostSideTestCases
Bug: 154772075
Change-Id: I7e4674c474189b0185c020e3e066aea5678d7428
2020-04-30 22:37:15 +01:00
Nikita Ioffe
6a3c94b3aa Reject services that are both critical and oneshot
Test: atest CtsInitTestCases
Test: builds
Test: device boots
Bug: 155275196
Change-Id: I1bb9099371bd1a3f339396ef343c49b054fcef66
2020-04-30 19:52:43 +01:00
TreeHugger Robot
45339b236d Merge "logd: disable flaky logd.timeout test" into rvc-dev am: 090eb40355
Change-Id: I5fdaeb0060d71343d0f78832ea001ec076c755aa
2020-04-30 17:09:57 +00:00
TreeHugger Robot
090eb40355 Merge "logd: disable flaky logd.timeout test" into rvc-dev 2020-04-30 16:46:38 +00:00
Tom Cherry
98a2724fbc logd: disable flaky logd.timeout test
This test is repeatedly seen to be flaky.  Disable it until we can run
tests against a dedicated logd instance.

Bug: 155146087
Test: logd-unit-tests
Merged-In: I0cd953955f613e40d17df73f70543d7d2f0925b6
Change-Id: I0cd953955f613e40d17df73f70543d7d2f0925b6
(cherry picked from commit 25a4d708e2)
2020-04-30 08:39:09 -07:00
Elliott Hughes
9d63c3f8c5 Avoid zero-initializing our most-used buffers. am: 08929cc389
Change-Id: I0674d4880ae0596a9ebf4e448d72eaacaf0ca99e
2020-04-30 15:25:56 +00:00
Kyle Lin
106d6fe775 rootdir: init.rc: mount tracefs
Bug: 153849221
Test: build and try to capture the trace by perfetto and systrace
Change-Id: Ie8a13e12038bd66afcd264079a2c5f25daaa20ee
Merged-In: Ie8a13e12038bd66afcd264079a2c5f25daaa20ee
(cherry picked from commit 9d19a05422)
2020-04-30 22:04:37 +08:00
Elliott Hughes
08929cc389 Avoid zero-initializing our most-used buffers.
The StringPrintf one is heavily used and brings the overhead versus
fmtlib down to 1.5x rather than 2x. I don't have a convenient benchmark
for the other two.

Test: libbase tests & benchmarks
Bug: http://b/155324241
Change-Id: I9e704a360846d5520c53f668e7c315b0c0ea55f8
(cherry picked from commit 8c253d4d42)
2020-04-29 16:49:13 -07:00
Jeffrey Huang
c57b3a654c Merge "Add test for AStatsSocket_close()" into rvc-dev am: 053ade4320
Change-Id: I562ba4b9bffb459b204839452e4f07eff5031256
2020-04-29 18:58:39 +00:00
Jeffrey Huang
053ade4320 Merge "Add test for AStatsSocket_close()" into rvc-dev 2020-04-29 18:46:26 +00:00
Tom Cherry
178a714b88 Merge "liblog: remove Rwlocks for logd_socket and pmsg_fd" into rvc-dev am: 03ead14288
Change-Id: I77df9c4c1f4d5bbf34f4e96d42ebb9343ef446c5
2020-04-29 17:48:38 +00:00
Tom Cherry
18603dab4e init: fix restarting of subcontext am: e70c28bdad
Change-Id: I50ca8c3852473b666909603e9b3471fd237f00b5
2020-04-29 17:48:23 +00:00
Tom Cherry
03ead14288 Merge "liblog: remove Rwlocks for logd_socket and pmsg_fd" into rvc-dev 2020-04-29 17:46:59 +00:00
Tom Cherry
e70c28bdad init: fix restarting of subcontext
When the subcontext code was redone to allow only one subcontext
(vendor_init), the code for restarting it and for terminating it
during shutdown was not updated, resulting in it not working.

Bug: 155203339
Test: kill subcontext init and notice it restart
Test: subcontext init stops during shutdown
Merged-In: Ib77f59d1e7be0ffcfd3f31c8450dc022c20bb322
Change-Id: Ib77f59d1e7be0ffcfd3f31c8450dc022c20bb322
(cherry picked from commit e3e77d382f)
2020-04-29 08:41:21 -07:00
Tom Cherry
61910f123f liblog: remove Rwlocks for logd_socket and pmsg_fd
These historically used atomics to manage their lifetime.  They were
unfortunately unsafe and later replace with a RwLock.  A lock is
also problematic as it is too heavy weight for the typical use case
and implies that logging is neither async nor fork safe.

This change returns us to using atomics with two key changes:
1) compare_exchange_strong() is used instead of atomic_exchange().
   The latter has a race condition where a separate thread could have
   read the atomic value into a register, while the thread performing
   the atomic_exchange closes that FD.  The new code only changes the
   FD in the atomic if it is uninitialized.
2) Using the fact that DGRAM sockets can have connect() called on them
   multiple times, it uses a single logd_socket for the duration of
   the program.

These sockets are thread/async/fork safely created and accessed.

The one caveat is __android_log_close(), which is intended only to be
used by zygote when it is single threaded and is therefore not thread
safe.  It will close this socket and reset the underlying variable,
such that the next log message will go through the above
initialization.

Bug: 65062446
Test: logging works, logging unit tests
Test: new unit test
Merged-In: Ia4dbf7479dbe50683d124558ab2f83bff53b8f5f
Change-Id: Ia4dbf7479dbe50683d124558ab2f83bff53b8f5f
(cherry picked from commit 7acfba274c)
2020-04-29 08:39:26 -07:00
Tom Cherry
711bf7d7d4 Merge "base: reimagine line splitting in logger.cpp" into rvc-dev am: 806c0206b8
Change-Id: I145322010f5de413eba5aa9086cffae0a5f0e96a
2020-04-29 15:24:52 +00:00
Tom Cherry
806c0206b8 Merge "base: reimagine line splitting in logger.cpp" into rvc-dev 2020-04-29 15:05:36 +00:00
TreeHugger Robot
00ff629944 Merge "libbase/liblog: set min_sdk_version" into rvc-dev am: 8d24215d33
Change-Id: Ibb1a65c661643887b7fd6a971a63f0ee33c0d10b
2020-04-29 05:54:41 +00:00
TreeHugger Robot
8d24215d33 Merge "libbase/liblog: set min_sdk_version" into rvc-dev 2020-04-29 05:45:30 +00:00
TreeHugger Robot
30dbf609ab Merge "Moves some shared_libs to static_libs for vts_libsnapshot_test." into rvc-dev am: 1e8f30f919
Change-Id: I72bf111417defab141970cb158024da0425dae8e
2020-04-28 23:24:24 +00:00
TreeHugger Robot
1e8f30f919 Merge "Moves some shared_libs to static_libs for vts_libsnapshot_test." into rvc-dev 2020-04-28 23:14:33 +00:00
David Anderson
6e8ae6d2b2 libfiemap: Ignore userdata requirements in fiemap_writer_test when running a DSU.
The test is guaranteed to fail because userdata is itself a fiemap-backed device.

Bug: 154447105
Test: fiemap_writer_test on DSU
Change-Id: Ied35da0eb7aba3daca7ed430f006bf1e90e21dca
Merged-In: Ied35da0eb7aba3daca7ed430f006bf1e90e21dca
2020-04-28 15:28:39 -07:00
Jeffrey Huang
6cc1d41527 Add test for AStatsSocket_close()
Bug: 154871176
Test: atest libstatssocket_test
Change-Id: If8aa26a9a9a75382b6f8779c23974a7008bd387a
2020-04-28 15:22:28 -07:00
Dan Shi
3fa82b49e3 Merge "Add vts_processgroup_validate_test to vts suite" into rvc-dev am: 3174b3ae99
Change-Id: I8005d3825726160b880a74c2ed8f189a2d07570a
2020-04-28 17:16:57 +00:00
Dan Shi
3174b3ae99 Merge "Add vts_processgroup_validate_test to vts suite" into rvc-dev 2020-04-28 16:56:06 +00:00
TreeHugger Robot
f2d94267e9 Merge "llkd: Print thread group before panic the kernel" into rvc-dev am: 00e15d9e45
Change-Id: I98cea1047cdc140490835bcdd68f6551cd1893e1
2020-04-28 15:30:21 +00:00
TreeHugger Robot
00e15d9e45 Merge "llkd: Print thread group before panic the kernel" into rvc-dev 2020-04-28 15:21:10 +00:00
Jooyung Han
0ed04aef4c libbase/liblog: set min_sdk_version
Modules contributing mainline modules (APK/APEX) should set
min_sdk_version as well as apex_available.

For now setting min_sdk_version doesn't change build outputs.
But build-time checks will be added soon.

Bug: 152655956
Test: m
Merged-In: If4ff1fbc31e5be3f5611a4713ae4032aba4ee5f2
Change-Id: If4ff1fbc31e5be3f5611a4713ae4032aba4ee5f2
(cherry picked from commit 3851f7e836)
2020-04-28 10:56:08 +09:00
Tom Cherry
953c0deadb base: reimagine line splitting in logger.cpp
Previously, we would split messages by line and call the logger
function for each line.  We would hold a lock during this, to ensure
that multiple threads would not interleave their messages.

There are a few problems with this approach:
1) Using a lock is not efficient and is not fork safe
2) With APEX, there is one lock per instance of libbase, so we must
   move the lock to a location where all instances can access it, or
   perform the line splitting in a way that does not require the lock.

To solve these issues, we reimagine line splitting.
1) We move the lock out of the LogMessage::~LogMessage() and make it
   the logger's responsibility to split lines, giving the logger the
   option to lock or not.
2) We do not need any locks at all for StderrLogger.
   Instead, we generate a single string that contains all of the lines
   with their appropriate log header.  A single write() call is used
   to output this at once.
3) Logd handles log messages with newlines correctly, however it only
   accepts up to a maximum size of log message.  Therefore we
   separate the incoming log message into chunks, delimited by new
   lines, up to that maximum size, and send each of those to logd.
   Note that this is the strategy used in
   android.util.Log.printlns().
   This should solve a majority of use cases, since the maximum size
   that logd accepts is nearly 4K, while remaining lock free.
   If interleaving messages absolutely must be avoided, a lock can
   still be used given 1) above.

Bug: 65062446
Bug: 153824050
Test: logging, particularly multi-line stack traces, show correctly
Test: existing and new unit tests
Change-Id: Id0cb5669bee7f912da1e17f7010f0ee4c93be1e3
(cherry picked from commit 36d31c530d)
2020-04-27 16:25:27 -07:00