Commit Graph

40977 Commits

Author SHA1 Message Date
Elliott Hughes 30b408c6f0 Merge changes I1f55c6e1,Ib2adcf0a am: 395131df7b
am: 4a9a08183e

Change-Id: Ib571c60a499dd349358d7019d8004906b2acdaee
2018-04-20 13:31:45 -07:00
Elliott Hughes 4a9a08183e Merge changes I1f55c6e1,Ib2adcf0a
am: 395131df7b

Change-Id: Ib0b871e1982828016cefc71976a0e5421388d004
2018-04-20 13:27:17 -07:00
Josh Gao 5d1c14f41b libdebuggerd: clone registers before we Unwind with them.
Bug: http://b/77296294
Test: manual inspection of tombstone generated by crasher
Change-Id: I4b017701d7d2041db4aefbbb90977e99b844c328
2018-04-20 13:23:20 -07:00
Josh Gao 2f37a15472 libunwindstack: add Regs::Clone.
Add a way to copy a Regs object.

Bug: http://b/77296294
Test: libunwindstack_test
Change-Id: I28aff510aa3e1b677d5ae46dc3bfe7652817ce52
2018-04-20 13:23:20 -07:00
Elliott Hughes 395131df7b Merge changes I1f55c6e1,Ib2adcf0a
* changes:
  Move fastboot over to ParseByteCount.
  Add android::base::ParseByteCount.
2018-04-20 20:15:30 +00:00
Mathew Inwood 796a3db702 Merge "Add support for logging complex events from C++." into pi-dev
am: 564e3581cb

Change-Id: I69736dce42800878f697c01e3253a33385df6a2b
2018-04-20 00:47:14 -07:00
Mathew Inwood 564e3581cb Merge "Add support for logging complex events from C++." into pi-dev 2018-04-20 07:42:03 +00:00
Elliott Hughes 542370dead Move fastboot over to ParseByteCount.
Bug: N/A
Test: `fastboot flashall` and `fastboot -S 100m flashall`
Change-Id: I1f55c6e10be74780bbf8dc30b2d4be3f362ac662
2018-04-19 19:49:44 -07:00
Elliott Hughes 955b6a4792 Add android::base::ParseByteCount.
Bug: N/A
Test: ran tests
Change-Id: Ib2adcf0a5b9494fcf8259b29974303e8516a9ad9
2018-04-19 19:49:16 -07:00
Luis Hector Chavez 0fe9752696 Merge changes I722d2c41,Ic216ddef am: c4ad6b6adc
am: 2c3f1d6c43

Change-Id: Ifb3905acae6e91acde802b118a88cce47fb21077
2018-04-19 19:30:12 -07:00
Luis Hector Chavez 2c3f1d6c43 Merge changes I722d2c41,Ic216ddef
am: c4ad6b6adc

Change-Id: I773f941918a21118eddc09d59cdc667fe22833eb
2018-04-19 19:23:53 -07:00
Treehugger Robot c4ad6b6adc Merge changes I722d2c41,Ic216ddef
* changes:
  Improve test_adb.py
  adb: Distinguish betwen already-connected and connection failure
2018-04-20 02:13:09 +00:00
Josh Gao c3d64d0781 Merge "adb: don't error in handle_host_request if we can't acquire a transport." into pi-dev
am: 51fd5440c1

Change-Id: Ibfde0dd6f850a69d323c589b49778563a1bea534
2018-04-19 16:04:38 -07:00
Josh Gao 51fd5440c1 Merge "adb: don't error in handle_host_request if we can't acquire a transport." into pi-dev 2018-04-19 22:32:27 +00:00
Josh Gao 5b1c964f95 Merge "adb: don't error in handle_host_request if we can't acquire a transport." am: 224d965be0
am: 22bce1788e

Change-Id: Ia6833ef85c666b5fd4682051d9846e45c61cbaeb
2018-04-19 14:59:11 -07:00
Josh Gao 22bce1788e Merge "adb: don't error in handle_host_request if we can't acquire a transport."
am: 224d965be0

Change-Id: If1d8207916095c9fbca83c716f51846f125897b9
2018-04-19 14:52:57 -07:00
Treehugger Robot 224d965be0 Merge "adb: don't error in handle_host_request if we can't acquire a transport." 2018-04-19 21:40:57 +00:00
Josh Gao 48383c806a tombstoned: don't create tombstones for failed dumps.
Instead of creating tombstone FDs in place and passing them out to
crash_dump directly, create them as O_TMPFILEs and link them into place
when crash_dump reports success, to avoid creating empty tombstones
in cases like an aborting thread racing with another thread that
manages to cleanly exit_group before the dump finishes.

Bug: http://b/77729983
Test: debuggerd_test
Test: adb shell 'for x in `seq 0 50`; do crasher; done'
Change-Id: I31ce4fd4a524abf8bde57152450209483d9d0ba9
2018-04-19 14:33:18 -07:00
Tom Cherry 55ef1afe94 [automerger skipped] Merge "Add a dummy entry for the 70220 event tag" into pi-dev
am: c415debdbf  -s ours

Change-Id: I0f095831617c7a72cd4fd4e17df71e997c553b15
2018-04-19 14:08:07 -07:00
Tom Cherry c415debdbf Merge "Add a dummy entry for the 70220 event tag" into pi-dev 2018-04-19 20:51:39 +00:00
Josh Gao 05e5bc1b17 adb: don't error in handle_host_request if we can't acquire a transport.
Host services are attempted after handle_host_request, which means that
failing to find a transport to give to handle_forward_request shouldn't
send an error over to the other end.

Bug: http://b/78294734
Test: `adb track-devices` with multiple devices connected
Change-Id: I46c89cc1894b51d48fea7d4e629b1d57f73e3fd6
(cherry picked from commit 78f133d7d4)
2018-04-19 13:29:59 -07:00
Josh Gao 78f133d7d4 adb: don't error in handle_host_request if we can't acquire a transport.
Host services are attempted after handle_host_request, which means that
failing to find a transport to give to handle_forward_request shouldn't
send an error over to the other end.

Bug: http://b/78294734
Test: `adb track-devices` with multiple devices connected
Change-Id: I46c89cc1894b51d48fea7d4e629b1d57f73e3fd6
2018-04-19 13:09:18 -07:00
Tom Cherry a6fd1b1b59 Merge "Add a dummy entry for the 70220 event tag" am: 3152c540b4
am: 76b17047de

Change-Id: Id433f546af129b048f8db699d55c7ceaa747a0e5
2018-04-19 11:23:33 -07:00
Tom Cherry 76b17047de Merge "Add a dummy entry for the 70220 event tag"
am: 3152c540b4

Change-Id: I1f658a8a09a6a72457069fc109f13040f372dfd9
2018-04-19 11:19:14 -07:00
Tom Cherry f9ec346f30 Add a dummy entry for the 70220 event tag
This will prevent services from reaching out to logd if this tag is
present in the event log.

Bug: 64734187
Test: tree-hugger
Merged-In: If117e1c0cfa678af4190913f0ca87f4e92c54373
Change-Id: If117e1c0cfa678af4190913f0ca87f4e92c54373
(cherry picked from commit dcc4b2bb4a)
2018-04-19 11:03:28 -07:00
Tom Cherry 3152c540b4 Merge "Add a dummy entry for the 70220 event tag" 2018-04-19 18:02:30 +00:00
Luis Hector Chavez 4ce56af101 Merge "init: Use android::base::boot_clock instead of /proc/uptime" am: 8e73e6f242
am: c12004dd23

Change-Id: I3a5a13cefa2baadfb50771664727712f9dd5b803
2018-04-19 10:59:22 -07:00
Luis Hector Chavez c12004dd23 Merge "init: Use android::base::boot_clock instead of /proc/uptime"
am: 8e73e6f242

Change-Id: I32c0ee2092a39af494126b7fbe3f42e0f6c0a2d1
2018-04-19 10:55:15 -07:00
Treehugger Robot 8e73e6f242 Merge "init: Use android::base::boot_clock instead of /proc/uptime" 2018-04-19 17:43:07 +00:00
Paul Crowley 51fbe3b140 Merge "Set property for metadata encryption on first boot" into pi-dev
am: 2df20b6271

Change-Id: I31f90bb0433197dbc3b3ad56a90f7b1d7d3bd4ac
2018-04-19 10:31:12 -07:00
Paul Crowley 2df20b6271 Merge "Set property for metadata encryption on first boot" into pi-dev 2018-04-19 17:17:07 +00:00
Mathew Inwood d0613ac54a Add support for logging complex events from C++.
Also include relevant new metric_logger.proto values.

Test: m
Test: Exercised by ag/3890335 in art
Bug: 77517571
Change-Id: Ia527f2b94c7a6147ad9d537376266e5ffc597b04
2018-04-19 16:58:27 +01:00
Colin Cross 1a4f7c5617 [automerger skipped] Merge "Remove test_suites: ["vts"] from memunreachable_binder_test" into pi-dev
am: dc29476d7e  -s ours

Change-Id: If736fc9117002da520af0cfee155603687ad3379
2018-04-19 08:29:51 -07:00
TreeHugger Robot dc29476d7e Merge "Remove test_suites: ["vts"] from memunreachable_binder_test" into pi-dev 2018-04-19 15:18:22 +00:00
Paul Crowley 6ed4cd9cde Merge "Set property for metadata encryption on first boot" am: def249956c
am: 533870c48f

Change-Id: Ia1e25e29fdb3196a8c6dafd41271c253bd24ce59
2018-04-18 17:32:09 -07:00
Paul Crowley 533870c48f Merge "Set property for metadata encryption on first boot"
am: def249956c

Change-Id: I233286b4275d82be930683ca86147273f3b8c5dd
2018-04-18 17:28:35 -07:00
Treehugger Robot def249956c Merge "Set property for metadata encryption on first boot" 2018-04-19 00:17:42 +00:00
Tim Murray 3188458f36 cutils: add restricted cpuset
am: 658ae90f69

Change-Id: I94d05991e95f79282b0ad980a97edb75d2e908f7
2018-04-18 17:00:21 -07:00
Tim Murray 658ae90f69 cutils: add restricted cpuset
Bug 78197570
Test: CTS
Exempt-From-Owner-Approval: owner OOO, build cop says it's fine

Change-Id: I6df972950b75a839caa463ae282ad000b959e8ae
2018-04-18 16:42:12 -07:00
Colin Cross 2f569b75a4 Remove test_suites: ["vts"] from memunreachable_binder_test
memunreachable_binder_test is pulled in by
test/vts/tools/build/tasks/list/vts_test_bin_package_list.mk, it
doesn't need to be listed in test_suites.

Fixes warnings:
build/make/core/base_rules.mk:620: warning: overriding commands for target `out/host/linux-x86/vts/android-vts/testcases/memunreachable_binder_test'
build/make/core/base_rules.mk:620: warning: ignoring old commands for target `out/host/linux-x86/vts/android-vts/testcases/memunreachable_binder_test'

Bug: 78229249
Test: vts-tradefed run commandAndExit vts -m VtsKernelBinderTest
Change-Id: Ifd282b2f5bb652295fa34ad247919eb85ea7abc8
Merged-In: Ifd282b2f5bb652295fa34ad247919eb85ea7abc8
(cherry picked from commit f013b62152)
2018-04-18 16:35:05 -07:00
Tom Cherry dcc4b2bb4a Add a dummy entry for the 70220 event tag
This will prevent services from reaching out to logd if this tag is
present in the event log.

Bug: 64734187
Test: tree-hugger
Change-Id: If117e1c0cfa678af4190913f0ca87f4e92c54373
2018-04-18 16:25:56 -07:00
Jeff Vander Stoep 6d36fdc4da Merge "init.rc: create /data/system/dropbox" am: c629131c26
am: b0918bfa47

Change-Id: Ibe80b9d6e4f3fe6b4555c919fccfc4b0d72aba63
2018-04-18 15:05:27 -07:00
Jeff Vander Stoep b0918bfa47 Merge "init.rc: create /data/system/dropbox"
am: c629131c26

Change-Id: I5ee32c5b8c66a3a4f8079456efcf8c711b025ccc
2018-04-18 15:02:21 -07:00
Treehugger Robot c629131c26 Merge "init.rc: create /data/system/dropbox" 2018-04-18 21:48:39 +00:00
Paul Crowley e383334457 Set property for metadata encryption on first boot
Bug: 77335096
Test: device boots twice with and without metadata encryption
Change-Id: Iaed78288cb37865ba23833721b73b11414e7e862
2018-04-18 14:42:45 -07:00
Paul Crowley 5872cbdf02 Set property for metadata encryption on first boot
Bug: 77335096
Test: device boots twice with and without metadata encryption
Change-Id: Iaed78288cb37865ba23833721b73b11414e7e862
2018-04-18 14:40:54 -07:00
Mark Salyzyn afd66f2fd3 llkd: bootstat: propagate detailed livelock canonical boot reason
Report kernel_panic,sysrq,livelock,<state> reboot reason via last
dmesg (pstore console).  Add ro.llk.killtest property, which will
allow reliable ABA platforms to drop kill test and go directly
to kernel panic.  This should also allow some manual unit testing
of the canonical boot reason report.

New canonical boot reasons from llkd are:
- kernel_panic,sysrq,livelock,alarm llkd itself locked up (Hail Mary)
- kernel_panic,sysrq,livelock,driver uninterrruptible D state
- kernel_panic,sysrq,livelock,zombie uninterrruptible Z state

Manual test assumptions:
- llkd is built by the platform and landed on system partition
- unit test is built and landed in /data/nativetest (could
  land in /data/nativetest64, adjust test correspondingly)
- llkd not enabled, ro.llk.enable and ro.llk.killtest
  are not set by platform allowing test to adjust all the
  configuration properties and start llkd.
- or, llkd is enabled, ro.llk.enable is true, and killtest is
  disabled, ro.llk.killtest is false, setup by the platform.
  This breaks the go/apct generic operations of the unit test
  for llk.zombie and llk.driver as kernel panic results
  requiring manual intervention otherwise.  If test moves to
  go/apct, then we will be forced to bypass these tests under
  this condition (but allow them to run if ro.llk.killtest
  is "off" so specific testing above/below can be run).

for i in driver zombie; do
        adb shell su root setprop ro.llk.killtest off
        adb shell /data/nativetest/llkd_unit_test/llkd_unit_test --gtest_filter=llkd.${i}
        adb wait-for-device
        adb shell su root setprop ro.llk.killtest off
        sleep 60
        adb shell getprop sys.boot.reason
        adb shell /data/nativetest/llkd_unit_test/llkd_unit_test --gtest_filter=llkd.${i}
done

Test: llkd_unit_test (see test assumptions)
Bug: 33808187
Bug: 72838192
Change-Id: I2b24875376ddfdbc282ba3da5c5b3567de85dbc0
2018-04-18 14:02:16 -07:00
Mark Salyzyn d035dbbecf llkd: default enabled for userdebug
If LLK_ENABLE_DEFAULT is false, then check "ro.llk.enable" for "eng",
also the default value if not set, and then check if userdebug build
to establish a default of true for enable.  Same for
ro.khungtask.enable.

Test: llkd_unit_test report eng status on "userdebug" or "user" builds
Bug: 33808187
Bug: 72838192
Change-Id: I2adb23c7629dccaa2856c50bccbf4e363703c82c
2018-04-18 14:02:05 -07:00
Mark Salyzyn f089e1403b llkd: add live-lock daemon
Introduce a standalone live-lock daemon (llkd), to catch kernel
or native user space deadlocks and take mitigating actions.  Will
also configure [khungtaskd] to fortify the actions.

If a thread is in D or Z state with no forward progress for longer
than ro.llk.timeout_ms, or ro.llk.[D|Z].timeout_ms, kill the process
or parent process respectively.  If another scan shows the same
process continues to exist, then have a confirmed live-lock condition
and need to panic.  Panic the kernel in a manner to provide the
greatest bugreporting details as to the condition.  Add a alarm self
watchdog should llkd ever get locked up that is double the expected
time to flow through the mainloop.  Sampling is every
ro.llk_sample_ms.

Default will not monitor init, or [kthreadd] and all that [kthreadd]
spawns.  This reduces the effectiveness of llkd by limiting its
coverage.  If in the future, if value in covering kthreadd spawned
threads, the requirement will be to code drivers so that they do not
remain in a persistent 'D' state, or that they have mechanisms to
recover the thread should it be killed externally.  Then the
blacklists can be adjusted accordingly if these conditions are met.

An accompanying gTest set have been added, and will setup a persistent
D or Z process, with and without forward progress, but not in a
live-lock state because that would require a buggy kernel, or a module
or kernel modification to stimulate.

Android Properties llkd respond to (*_ms parms are in milliseconds):
- ro.config.low_ram default false, if true do not sysrq t (dump
  all threads).
- ro.llk.enable default false, allow live-lock daemon to be enabled.
- ro.khungtask.enable default false, allow [khungtaskd] to be enabled.
- ro.llk.mlockall default true, allow mlock'd live-lock daemon.
- ro.khungtask.timeout default 12 minutes.
- ro.llk.timeout_ms default 10 minutes, D or Z maximum timelimit,
  double this value and it sets the alarm watchdog for llkd.
- ro.llk.D.timeout_ms default ro.llk.timeout_ms, D maximum timelimit.
- ro.llk.Z.timeout_ms default ro.llk.timeout_ms, Z maximum timelimit.
- ro.llk.check_ms default 2 minutes sampling interval
  (ro.llk.timeout_ms / 5) for threads in D or Z state.
- ro.llk.blacklist.process default 0,1,2 (kernel, init and
  [kthreadd]), and process names (/comm or /cmdline) init,[kthreadd],
  lmkd,lmkd.llkd,llkd,[khungtaskd],watchdogd,[watchdogd],
  [watchdogd/0] ...
- ro.llk.blacklist.parent default 0,2 (kernel and [kthreadd]) and
  "[kthreadd]".  A comma separated lists of process ids, /comm names
  or /cmdline names.
- ro.llk.blacklist.uid default <empty>, comma separated list of
  uid numbers or names from getpwuid/getpwnam.

Test: llkd_unit_test
Bug: 33808187
Bug: 72838192
Change-Id: I32e8aa78aef10834e093265d0f3ed5b4199807c6
2018-04-18 14:01:56 -07:00
Tri Vo e57b1dd18d [automerger skipped] Merge "Add /mnt/vendor rw mount point for vendor partitions." am: 4640149fd5
am: 9c0825051a  -s ours

Change-Id: I83df823844623d1d8c20fc3db91ebac18f40f81f
2018-04-18 12:48:43 -07:00