Commit graph

59955 commits

Author SHA1 Message Date
Jiyong Park
d95ae9b3ac Merge changes I8fd2a3c9,Id08058f3 am: 49c52979ba
Change-Id: Iff9e33fcb05ac9365e7db95577ba2d1c891ba89b
2020-04-10 01:29:14 +00:00
Jiyong Park
49c52979ba Merge changes I8fd2a3c9,Id08058f3
* changes:
  Set apex_available property
  Set apex_available property
2020-04-10 01:14:55 +00:00
Xin Li
60d3db1163 DO NOT MERGE - Empty merge qt-qpr1-dev-plus-aosp into stag-aosp-master
Bug: 151763422
Change-Id: Iad12e5e7410a59ee7a3ee29c5b995ab6a1af2786
2020-04-09 17:51:26 -07:00
Tom Cherry
d3ecc66b9c liblog: support extended logger_entry headers
logger_entry has a hdr_size field meant for backwards compatibility,
however there are a few checks that expect it to be a specific size.
More problematically, it has a variable length array element, msg[0]
at the end, that would be incorrect if the header size was not kept
static.

This change fixes up those issues to facilitate future additions.

Bug: 119867234
Test: logging works with extended size headers, logging unit tests
Test: newly added unit tests with extended size header
Change-Id: I14b2b0855d219d11f374b53a5aa8e05cd6a65eef
2020-04-09 15:48:44 -07:00
Steven Moreland
3dd472c0d1 Merge "Note selinux trans error happens in permissive." am: 90540ad53a am: 3e773903f1
Change-Id: I1f41710707c95abe57e02cb71380638914d12ab0
2020-04-09 22:31:05 +00:00
Yifan Hong
f2125f552c Merge "BatteryMonitor: report current_now in uA" am: 559270448d am: 9821156b1e
Change-Id: I44ae71767a23d91b626b3443b90a9b136cc2ac17
2020-04-09 22:30:56 +00:00
Steven Moreland
3e773903f1 Merge "Note selinux trans error happens in permissive." am: 90540ad53a
Change-Id: Ic65240b0aa41e76b694453b8617f5678dd29cf7a
2020-04-09 22:10:40 +00:00
Yifan Hong
9821156b1e Merge "BatteryMonitor: report current_now in uA" am: 559270448d
Change-Id: I105b2ae709c0b88d5bf07621b2faaff191c6c671
2020-04-09 22:10:33 +00:00
Steven Moreland
90540ad53a Merge "Note selinux trans error happens in permissive." 2020-04-09 21:52:08 +00:00
Yifan Hong
7cc7a54abc BatteryMonitor: report current_now in uA
/sys/class/power_supply/*/current_now should return uA and the HAL
expects uA too.

Test: VtsHalHealthV2_0TargetTest
Bug: 136717180
Change-Id: I675be1ae645413b9494af4a5d49955aad5bd4f2e
(cherry picked from commit e5bd5f914f)
Merged-In: I675be1ae645413b9494af4a5d49955aad5bd4f2e
2020-04-09 14:41:51 -07:00
Yifan Hong
559270448d Merge "BatteryMonitor: report current_now in uA" 2020-04-09 21:40:01 +00:00
Steven Moreland
9e987cbb1a Note selinux trans error happens in permissive.
There was an email thread about this recently, and I've been asked many
times.

For instance, if this error wasn't attributed, denials a service is
hitting would be attributed to init, and that's a recipe for disaster.
Secondarily, thinking about SELinux whenever you write a new service is
good.

Bug: N/A
Test: N/A
Change-Id: Ib9d2c5d8947375a0d4c33ecf3d075caef6b41f70
2020-04-09 12:48:46 -07:00
Tom Cherry
af1f43f63f Merge changes If1a62a90,Ibce79cf1,Ia2bbf01a,I1763be56,I56762747, ... am: 56cd920ff8 am: 31ef800126
Change-Id: I5badea45255d35b25938393da674689f09764a67
2020-04-09 17:59:05 +00:00
Tom Cherry
2562f1adec Merge changes If1a62a90,Ibce79cf1,Ia2bbf01a,I1763be56,I56762747, ... am: 56cd920ff8 am: 31ef800126
Change-Id: I72972ba97b63d6fc2d591dbf0b40e60de3bdef6d
2020-04-09 17:58:50 +00:00
Tom Cherry
31ef800126 Merge changes If1a62a90,Ibce79cf1,Ia2bbf01a,I1763be56,I56762747, ... am: 56cd920ff8
Change-Id: I5fc95f3f0029848e38f19d4b49215432c9a58bfe
2020-04-09 17:46:28 +00:00
Tom Cherry
56cd920ff8 Merge changes If1a62a90,Ibce79cf1,Ia2bbf01a,I1763be56,I56762747, ...
* changes:
  logd: don't send logs before the start time on the first flushTo()
  Revert "logd: drop mSequence from LogBufferElement"
  Revert "logd: regression in handling watermark boundary."
  Revert "logd: logcat --clear respect pruneMargin"
  logd: wait for timeout via CLOCK_MONOTONIC
  Revert "logd: wakeup wrap timeout if realtime changes drastically"
  logd: do not attempt to sort log messages by time
2020-04-09 17:24:12 +00:00
Tom Cherry
65ab7fed70 logd: don't send logs before the start time on the first flushTo()
Logs in logd's buffer are not in time order.

If a client connects and requests logs from a given timestamp, we
start at the beginning of the buffer and find the first entry that has
happened since that timestamp and use its sequence number to flush
logs from.  This ensures that we get all logs accumulated in the
buffer since that time stamp and not just the most recent.

However there may be other logs in the buffer that happened before the
timestamp and have likely been already served to the client, therefore
we do not flush those.

We only do this for the first flush, since once we have flushed all of
the logs in the buffer, if another log comes in with a timestamp
earlier than the requested timestamp, it must be out of order and not
seen yet, since it is new even to logd.

Note! This is still broken.  There is a race that logs before the
timestamp may come in out of order since the last time the client
disconnected and before it reconnects.  The *only* solution to this
problem is that clients need to request logs after a given sequence
number.  That will be done as a separate liblog API change, while
these changes put in the ground work to make that possible.

Note 2: the security log implementation, which is one of the most
important users of this, already captures logs from seconds before the
last previous log to work around issues with timestamps.  That
workaround mitigates the above issue.

Test: logs work with logcat -t
Change-Id: If1a62a90c082d98c4cf2eb5c92ae3b7e89850cf2
2020-04-09 17:23:52 +00:00
Tom Cherry
10d086e26e Revert "logd: drop mSequence from LogBufferElement"
This reverts commit 5a34d6ea43.

There is a long standing bug that logd will leak memory during its
prune process if the time on the device changes significantly forwards
then backwards.  This is due to using the timestamp of each log
message to determine what log messages are yet to be processed by a
reader thread.

Various attempts have been made to rectify this, but the only solution
that safely fixes this issue is to go back to using sequence numbers
on the log messages.

Bug: 64675203
Bug: 77971811
Bug: 149340579
Bug: 150923384
Test: logcat output looks sane
Change-Id: Ibce79cf184eb29a4914f3e42a8cb2868d04dc165
2020-04-09 17:23:45 +00:00
Tom Cherry
7514558b81 Revert "logd: regression in handling watermark boundary."
This reverts commit 5836379b21.

Bug: 149340579
Test: logcat output looks sane
Change-Id: Ia2bbf01a20fec59b989d206a089d8e65062816ef
2020-04-09 17:23:34 +00:00
Tom Cherry
5e2665500f Revert "logd: logcat --clear respect pruneMargin"
This reverts commit 0878a7c167.

This is a partial revert of the above commit.  It simply removes
pruneMargin from these calculations since it is going away.

Bug: 149340579
Test: --clear works well
Change-Id: I1763be56fae7052058a800fad3b295c73cdcadf6
2020-04-09 17:22:25 +00:00
Steven Moreland
b52538c90d Merge "init_kill_services_test: reboot device first." am: 1ec8c39c3f am: c05df66c4b
Change-Id: I62b39628b126ebf859164100a1d77d3de582d4f1
2020-04-09 00:45:43 +00:00
Steven Moreland
493ae7be30 Merge "init_kill_services_test: reboot device first." am: 1ec8c39c3f am: c05df66c4b
Change-Id: I07eccb159827626f349904815f0be6ee4ea827b1
2020-04-09 00:45:42 +00:00
Steven Moreland
c05df66c4b Merge "init_kill_services_test: reboot device first." am: 1ec8c39c3f
Change-Id: I528b5453fcc2e83401f6ceccdc4cc0d848f186e1
2020-04-09 00:32:08 +00:00
Steven Moreland
1ec8c39c3f Merge "init_kill_services_test: reboot device first." 2020-04-09 00:23:20 +00:00
Yifan Hong
e5bd5f914f BatteryMonitor: report current_now in uA
/sys/class/power_supply/*/current_now should return uA and the HAL
expects uA too.

Test: VtsHalHealthV2_0TargetTest
Bug: 136717180
Change-Id: I675be1ae645413b9494af4a5d49955aad5bd4f2e
2020-04-08 16:24:17 -07:00
Yurii Zubrytskyi
8d8f637ee5 [zip] Stop calculating crc if it's not checked
Crc calculation shows up in the profiler in 2-5% range, and is
never currently validated. Let's disable it for good.
For a well-compressible test data the difference is even nicer:

Benchmark                       Time          CPU        Iteration
------------------------------------------------------------------
ziparchive-benchmarks:
before:
  #ExtractEntry/2            1943244 ns    1926758 ns          375
  #ExtractEntry/16           1877295 ns    1867049 ns          375
  #ExtractEntry/1024         1888772 ns    1879976 ns          373
after:
  #ExtractEntry/2             817003 ns     812870 ns          874
  #ExtractEntry/16            814029 ns     809813 ns          875
  #ExtractEntry/1024          804904 ns     800972 ns          879

Bug: 153392568
Test: atest, manual
Change-Id: I917abecab01301f1d09a5bf3b542d24b3875e359
2020-04-08 13:55:54 -07:00
Steve Muckle
37a006b0a3 [automerger skipped] first_stage_init: load modules in modules.load.recovery in recovery am: ae317c716b -s ours
am skip reason: Change-Id I7636bb5958ed10ae9a66015f04f168129618272f with SHA-1 4c59323dc6 is in history

Change-Id: Id9766ff43a02a7619cfc928a41e73e00814d8652
2020-04-08 20:31:18 +00:00
Steven Moreland
32876f356d init_kill_services_test: reboot device first.
This test is killing critical device services, and if it runs
repeatedly or some of the critical services have already died, it'll
force the device to reboot again and potentially consider the test a
failure.

This forces the test to reboot first, so that it is in a fresh state and
we can avoid this type of flake on the device.

Bug: 153444614
Test: atest init_kill_services_test
Change-Id: Ia81a319af1d209f58e70f824bb8eb7f11973637c
2020-04-08 20:23:18 +00:00
Christopher Ferris
f4682f2867 Merge "Avoid re-mapping dex file that's in local memory." am: e1948bf744 am: 6a7ec53c1c
Change-Id: I1337a2142d6549501d22c2c79a7f973b603ec4c2
2020-04-08 19:52:40 +00:00
Christopher Ferris
6f87bcc11a Merge "Avoid re-mapping dex file that's in local memory." am: e1948bf744 am: 6a7ec53c1c
Change-Id: I61d0ef39bb3771daaa14f015e76b7df6a472e0c3
2020-04-08 19:52:38 +00:00
Christopher Ferris
6a7ec53c1c Merge "Avoid re-mapping dex file that's in local memory." am: e1948bf744
Change-Id: If820cea99e828eabd136f4fb3d7f90d731ca9d22
2020-04-08 19:42:14 +00:00
Christopher Ferris
e1948bf744 Merge "Avoid re-mapping dex file that's in local memory." 2020-04-08 19:27:25 +00:00
Tom Cherry
c9fa42c0b8 logd: wait for timeout via CLOCK_MONOTONIC
There are well known issues with CLOCK_REALTIME jumping drastically.

Test: --wrap works successfully
Change-Id: I5676274783ac9aa9374d2b9254e0109d883cc5a8
2020-04-08 12:20:06 -07:00
Tom Cherry
cda0ee3db0 Revert "logd: wakeup wrap timeout if realtime changes drastically"
This reverts commit 5e001776f4.

The next commit will use CLOCK_MONOTONIC for the timeout, so changes
to CLOCK_REALTIME will no longer be an issue.

Test: logcat output looks sane
Change-Id: I84e5b2db3c25ea6a7024557dba7fa6cc8c9237e5
2020-04-08 12:14:08 -07:00
Treehugger Robot
95242dd29f Merge "first_stage_init: load modules in modules.load.recovery in recovery" am: 51abcc5633 am: 7b491d86fc
Change-Id: I1a51b5cda4ebb31a26bafddabbd1df36d439da35
2020-04-08 18:12:08 +00:00
Treehugger Robot
fec2f24cac Merge "first_stage_init: load modules in modules.load.recovery in recovery" am: 51abcc5633 am: 7b491d86fc
Change-Id: I48a5f64f4d2dd206dc4be0acb7a416fff060cf6f
2020-04-08 18:11:54 +00:00
Treehugger Robot
7b491d86fc Merge "first_stage_init: load modules in modules.load.recovery in recovery" am: 51abcc5633
Change-Id: I03ef7c7dc63936a415f305215f6a510092fe8bf9
2020-04-08 17:56:00 +00:00
Steve Muckle
ae317c716b first_stage_init: load modules in modules.load.recovery in recovery
In recovery mode, load modules from modules.load.recovery if it
exists. Otherwise load from modules.load as usual.

Bug: 150825361
Change-Id: I7636bb5958ed10ae9a66015f04f168129618272f
Merged-In: I7636bb5958ed10ae9a66015f04f168129618272f
2020-04-08 10:49:13 -07:00
Treehugger Robot
51abcc5633 Merge "first_stage_init: load modules in modules.load.recovery in recovery" 2020-04-08 17:41:09 +00:00
Tom Cherry
65abf3953e logd: do not attempt to sort log messages by time
Sorting does not work in all cases:
* It only sorts messages up to 5 seconds backwards in time
* CLOCK_REALTIME, which is used as the time that is sorted, can jump
  drastically
* Buffers are not sorted if there is a reader holding a region lock

Removing sorting entirely will give more consistent behavior from
logd.

Test: logcat still seems sane
Change-Id: I0923ab2fb377cda941c1e4972689df46f395ac99
2020-04-08 10:31:29 -07:00
Jiyong Park
937b4bf173 Set apex_available property
The marked library(ies) were available to the APEXes via the
hand-written whitelist in build/soong/apex/apex.go. Trying to remove the
whitelist by adding apex_available property to the Android.bp of the
libraries.

Bug: 150999716
Test: m
Change-Id: I8fd2a3c9b69454c6018c72f5198898bc90dc4d0d
2020-04-08 23:49:40 +09:00
Jiyong Park
e3d371e319 Set apex_available property
The marked library(ies) were available to the APEXes via the
hand-written whitelist in build/soong/apex/apex.go. Trying to remove the
whitelist by adding apex_available property to the Android.bp of the
libraries.

Bug: 150999716
Test: m
Change-Id: Id08058f3105463558c6c82298344a33af0efb2d3
2020-04-08 22:37:42 +09:00
Treehugger Robot
652daee3d4 Merge "Allow ExtractToMemory to accept an empty buffer for empty entries" am: 51de894ce4 am: 84e138b654
Change-Id: I09bb5e5a435a61ca5080ac98a1aabf21e5f1b652
2020-04-08 04:37:14 +00:00
Treehugger Robot
2564b28681 Merge "Allow ExtractToMemory to accept an empty buffer for empty entries" am: 51de894ce4 am: 84e138b654
Change-Id: I397a1ebdf8cd0a803e0ac92aba1ac7ffd2d58c87
2020-04-08 04:37:14 +00:00
Treehugger Robot
84e138b654 Merge "Allow ExtractToMemory to accept an empty buffer for empty entries" am: 51de894ce4
Change-Id: Ia3c9342b48af52d90770b1a6e763daca8b20150d
2020-04-08 04:24:30 +00:00
Treehugger Robot
51de894ce4 Merge "Allow ExtractToMemory to accept an empty buffer for empty entries" 2020-04-08 04:06:41 +00:00
Sim Sun
273d3f08aa Avoid re-mapping dex file that's in local memory.
If the Dex file we're trying to examine is already within the unwinder's
address space, we don't need to load it from disk or copy it across
processes.

This avoids using up virtual address space to map in dex files, and
also should be a bit faster to read since it won't go out to the file.

Patch by Chris Sarbora

Test: Ran new unit tests.
Test: Ran 137-cfi art test.
Change-Id: I949457856f051cca11b9020e9da3a41bbf6e5c8e
2020-04-07 18:07:38 -07:00
Tej Singh
049122c1e8 Merge "Link libc++ statically" into rvc-dev am: 282afacd3a
Change-Id: Ib8aa129e77d414341d3d73486f55bed8cf5d97c7
2020-04-08 00:52:20 +00:00
Tej Singh
282afacd3a Merge "Link libc++ statically" into rvc-dev 2020-04-08 00:37:49 +00:00
TreeHugger Robot
f7d2f12e1b [automerger skipped] Merge "Abolish DmTargetDefaultKey::IsLegacy" into rvc-dev am: 1dc77eaa61 -s ours
am skip reason: Change-Id I810bb7e085b9b8648858de1a02165162d1fd163e with SHA-1 539b98fb58 is in history

Change-Id: I512f03b8378164b52b0d126e92df33909ecd7abc
2020-04-08 00:24:33 +00:00