Commit Graph

30122 Commits

Author SHA1 Message Date
Josh Gao aa3c3fc3be Merge changes Id51dcb18,I2517dcb9
am: 4db472b779

Change-Id: I86c616c6840133a38f8af6b8b9e61b58435bcc32
2017-06-07 20:08:54 +00:00
Treehugger Robot 4db472b779 Merge changes Id51dcb18,I2517dcb9
* changes:
  adb: libusb: switch from polling for accessibility to a sleep.
  adb: improve race between device_connected and device_disconnected.
2017-06-07 20:01:18 +00:00
Josh Gao 5b8b10e078 adb: libusb: switch from polling for accessibility to a sleep.
For unclear reasons, it seems that for some people, devices are
becoming accessible, inaccessible, and then inaccessible again.
Switch to a sleep for now.

Bug: http://b/62200735
Test: manual
Change-Id: Id51dcb188c3534a57c35cbfd30a181c99115a23c
2017-06-07 11:08:00 -07:00
Josh Gao 7dd382ded9 adb: improve race between device_connected and device_disconnected.
If a device is unplugged while it's being processed, we can be inside
register_usb_transport still when we call unregister_usb_transport,
leading to bad things happening. Move the call of
register_usb_transport into the scope guarded by usb_handles_mutex.

Bug: http://b/62200735
Test: manual
Change-Id: I2517dcb9d30d9a08cebbb5f715ae3fd30c510109
2017-06-07 11:06:53 -07:00
Josh Gao 9d7880fe96 Merge changes I6c6bf61b,I3fb0b3a8
am: 3160a25010

Change-Id: Ida24fdd74569b2c57bdb0d3cdcfa486faf3cf3f2
2017-06-06 02:45:33 +00:00
Treehugger Robot 3160a25010 Merge changes I6c6bf61b,I3fb0b3a8
* changes:
  adb: libusb: don't try to delete a usb_handle twice.
  adb: don't hold queue lock while performing callbacks.
2017-06-06 02:39:40 +00:00
Josh Gao 60b8c26520 adb: libusb: don't try to delete a usb_handle twice.
Previously, we would attempt to delete a usb_handle in both
device_disconnected and usb_close. If the one in device_disconnected
happened to happen first, usb_close would abort when it failed to find
the handle it was supposed to own.

Bug: http://b/62020217
Test: unplugging device on darwin
Change-Id: I6c6bf61bf89a4d9a23458c00b457080d3d6cc744
2017-06-05 15:11:53 -07:00
Josh Gao 664a618c06 adb: don't hold queue lock while performing callbacks.
Fix yet another source of deadlocks.

Bug: http://b/62020217
Test: unplugged device on darwin
Change-Id: I3fb0b3a84c56aed7d0da8ddba36e2d01fdb682ee
2017-06-05 14:54:45 -07:00
Mark Salyzyn 16d6ed1845 Merge "liblog: add bool to android_log_event_list"
am: d105aa8496

Change-Id: I3b376d3d5c89fd16c4e5eac5afdb74981f372ee1
2017-06-05 17:39:47 +00:00
Treehugger Robot d105aa8496 Merge "liblog: add bool to android_log_event_list" 2017-06-05 17:31:36 +00:00
Mark Salyzyn e09e9a503e liblog: add bool to android_log_event_list
Test: compile
Bug: 62241642
Change-Id: I977702456417ceec21be96ff8463a5ed047560ec
2017-06-05 07:50:13 -07:00
Christopher Ferris 7f717dfc83 Merge "Use demangle for function names."
am: daa6602a86

Change-Id: I045673de2c9ac70cdbe65ef56e0ee7b057d88e93
2017-06-02 22:16:45 +00:00
Christopher Ferris daa6602a86 Merge "Use demangle for function names." 2017-06-02 22:10:02 +00:00
Tom Cherry ed75c00f72 Merge "ueventd: parallelize uevent handling"
am: 70431b1f22

Change-Id: Iddec3d673b1f18bc4b8520aafa01c22e0bcbabbf
2017-06-02 21:55:42 +00:00
Tom Cherry 70431b1f22 Merge "ueventd: parallelize uevent handling" 2017-06-02 21:47:57 +00:00
Tom Cherry c583305ed7 ueventd: parallelize uevent handling
fork() subprocesses to handle uevents in parallel.

This reduces coldboot time on bullhead from ~446ms to ~230ms.
This reduces coldboot time on sailfish from ~690ms to ~360ms.
This reduces coldboot time on ryu from ~187ms to ~122ms.

Bug: 33785894

Test: boot bullhead x40, observe no major differences in /dev and /sys
Test: boot sailfish x40, observe no major differences in /dev and /sys
Test: boot ryu x40, observe no major differences in /dev and /sys
Test: boottime tests on bullhead and sailfish
Test: init unit tests

Change-Id: Ie2f63e000b8af78d187477d31fe109f20304d749
2017-06-02 21:45:56 +00:00
Christopher Ferris 7d0aea91c9 Use demangle for function names.
Bug: 62141808

Test: Ran unit tests, ran debuggerd -b on android processes.
Change-Id: I40f341bcb2b35dd0a020d245d6b6f2ed2df65481
2017-06-02 10:10:24 -07:00
Christopher Ferris a11394356c Merge "Fix handling of _ZLXX."
am: 9b537f24bd

Change-Id: I19aaab318b88fcb2289eaa7bc1fe636072c5bc39
2017-06-02 15:09:38 +00:00
Christopher Ferris d34b599ec8 Merge "Change RegsTmpl to RegsImpl."
am: 2065a741cd

Change-Id: Ib4050f99b4f452ed26aa41be0ca137656f610a7f
2017-06-02 15:09:14 +00:00
Christopher Ferris 9b537f24bd Merge "Fix handling of _ZLXX." 2017-06-02 15:06:08 +00:00
Christopher Ferris 2065a741cd Merge "Change RegsTmpl to RegsImpl." 2017-06-02 15:05:29 +00:00
Christopher Ferris 7b8e467192 Change RegsTmpl to RegsImpl.
Also clang-format modified Regs.cpp slightly.

Bug: 23762183

Test: Built and ran unit tests.
Change-Id: I1c7c1b01974ee3f35059c42b8e2aef24d46c81a7
2017-06-01 17:56:46 -07:00
Christopher Ferris 4504bba7d0 Fix handling of _ZLXX.
Mangled names of the form _ZLXX, where XX is a number is now properly
demangled.

Test: Ran new unit tests.
Change-Id: I89fbb36d2294c46da428c75bd1a2f39f69ac4b43
2017-06-01 17:37:09 -07:00
Josh Gao 08a70ac6e5 Merge "adb: reunregress waiting for device on start-server."
am: 72076d1aa7

Change-Id: Ie00b2258e92e93b45e4c859cbec11a374b4f7557
2017-06-02 00:26:14 +00:00
Christopher Ferris 5659a2b6fe Merge "Add DwarfSection classes."
am: 6a80c3e1a8

Change-Id: I353f0d1fb1c3203134e8590a1ef7267407240bed
2017-06-02 00:22:25 +00:00
Treehugger Robot 72076d1aa7 Merge "adb: reunregress waiting for device on start-server." 2017-06-02 00:20:31 +00:00
Christopher Ferris 6a80c3e1a8 Merge "Add DwarfSection classes." 2017-06-02 00:15:13 +00:00
Josh Gao f1477d7f43 Merge changes Iddb0cb1e,Ic15e0b08,If1c9adb6
am: 2b17afc68d

Change-Id: I893f4c95143638598fbc4ef48e6717d1616e3688
2017-06-01 21:53:29 +00:00
Treehugger Robot 2b17afc68d Merge changes Iddb0cb1e,Ic15e0b08,If1c9adb6
* changes:
  debuggerd_client: increase pipe buffer size to max.
  crash_dump: don't notify ActivityManager if it crashed.
  crash_dump: clear the signal mask.
2017-06-01 21:47:19 +00:00
Christopher Ferris 53a3c9b4ab Add DwarfSection classes.
Bug: 23762183

Test: Ran new unit tests.
Change-Id: Icca2a73c50d467718ba4ac41e1c8f541488620dd
2017-06-01 13:12:31 -07:00
Josh Gao 5675f3c321 debuggerd_client: increase pipe buffer size to max.
If a process tries to dump itself (e.g. system_server during ANRs),
crash_dump will block trying to write to its pipe if it's not
sufficiently large. Increase the pipe size to the max, and add a test
to make sure that it's always at least 1MB (the default value).

Bug: http://b/38427757
Test: debuggerd_test
Change-Id: Iddb0cb1e5ce9e687efa9e94c2748a1edfe09f119
2017-06-01 12:42:44 -07:00
Josh Gao b0e51e388b crash_dump: don't notify ActivityManager if it crashed.
Bug: http://b/38427757
Test: killall -ABRT system_server, plus added logging
Change-Id: Ic15e0b0870b1ec08a2f165ad0e5356afed02eece
2017-06-01 12:42:33 -07:00
Christopher Ferris 9bf73d3723 Merge "Fix bug found by fuzzer."
am: 1d6a3acc9e

Change-Id: I020589751d4b2835ac098dad8cc3b07c5ba8448d
2017-06-01 19:09:20 +00:00
Christopher Ferris 1d6a3acc9e Merge "Fix bug found by fuzzer." 2017-06-01 19:03:48 +00:00
Josh Gao e740250b9d crash_dump: clear the signal mask.
crash_dump inherits its signal mask from the thread that forked it,
which always has all of its signals blocked, now that sigchain respects
sa_mask.

Manually clear the signal mask, and reduce the timeout to a
still-generous 2 seconds.

Bug: http://b/38427757
Test: manually inserted sleep in crash_dump
Change-Id: If1c9adb68777b71fb19d9b0f47d6998733ed8f52
2017-06-01 11:55:25 -07:00
Jinguang Dong 6a75b73c36 Merge "fs_mgr: Fix ZRAM error when ZRAM disk size beyond (2^31-1) bytes"
am: 28c11dcff4

Change-Id: I8b67777e1136a50b4233dce1450c7df867ccd744
2017-06-01 17:32:39 +00:00
Treehugger Robot 28c11dcff4 Merge "fs_mgr: Fix ZRAM error when ZRAM disk size beyond (2^31-1) bytes" 2017-06-01 17:21:30 +00:00
Jinguang Dong f7d1014795 fs_mgr: Fix ZRAM error when ZRAM disk size beyond (2^31-1) bytes
Because the zram_size type is unsigned int.so if ZRAM size great
than 2^31 -1, zram_fp will receive a negtive integer, while the
ZRAM driver only accept natural number.We need to use printf
formatting %u instand of %d.

Test: 1. Config the zramdisk size 2348810240 and build a ramdisk
      2. Reflash device and check below command:
         $adb shell dumpsys meminfo
         $ adb shell cat /sys/block/zram0/disksize
         ZRAM info display will be abnormal
      3. Config the zramdisk size 2348810240 and apply with this
         patch.
      4. Retest to step 2 and the ZRAM info will be ok.

Change-Id: I473de33fbd0b66cf13eac3172684e9fef11b6ef0
2017-06-01 19:42:22 +08:00
Robert Benea cc6da8ec5b Merge "cgroups used by init must be mounted before any services start"
am: 63c15c1b11

Change-Id: I2d9298d6de7fbe3b1ad827f498822545e696d4cc
2017-06-01 08:07:31 +00:00
Treehugger Robot 63c15c1b11 Merge "cgroups used by init must be mounted before any services start" 2017-06-01 07:59:19 +00:00
Jin Qian 104470da0f Merge "fastboot: use filename instead of fd to generate filesystem image"
am: 010f7714b7

Change-Id: I5b68c8228bd5fc018f858a200f0413e7c00a8791
2017-06-01 06:11:53 +00:00
Treehugger Robot 010f7714b7 Merge "fastboot: use filename instead of fd to generate filesystem image" 2017-06-01 06:05:41 +00:00
Christopher Ferris 15d2e42ceb Fix bug found by fuzzer.
Also, add the demangle fuzzer code.

Test: Ran fuzzer, ran new unit tests.
Change-Id: If3e15e10af88b81602a8a0f0bfe071a015f6000b
2017-05-31 17:54:19 -07:00
Robert Benea c638569c2e cgroups used by init must be mounted before any services start
init uses /acct and optionally /dev/memcg for tracking services and
therefore these must be started before any services start.

Test: check that cgroups are mounted appropriately.

Change-Id: Ice095287963181fe687dbe6b7d291076e674d1cc
2017-05-31 16:12:23 -07:00
Mark Salyzyn 69f28a69e3 Merge "logcat: logcatd: make logcatd killable"
am: f2c1ef53ff

Change-Id: Ibca636745a95a5f55bddfdd1a0c8067b9078655a
2017-05-31 22:28:22 +00:00
Treehugger Robot f2c1ef53ff Merge "logcat: logcatd: make logcatd killable" 2017-05-31 22:24:06 +00:00
Jin Qian 4a335829da fastboot: use filename instead of fd to generate filesystem image
mke2fs tool takes a filename and has its own open function to handle
output file. Change fastboot in preparation to switch from make_ext4
to mke2fs.

Test: fastboot format:ext4 userdata
Bug: 35219933
Change-Id: I7a31cb215f443a4a7cb0bfc23ec28c121a6101e6
2017-05-31 21:23:12 +00:00
Josh Gao 0b13c89f7a adb: reunregress waiting for device on start-server.
Move the invocation of adb_notify_device_scan_complete to
the end of device_connected, where we decrement connecting_devices.
Also, create a dedicated thread for handling hotplug events, instead of
reusing the main thread for this, since the main thread blocks until
device scan is complete.

Test: `adb kill-server; adb devices`
Change-Id: Ia73b1a57538174282a48ef73ab0a3e58152d6f83
2017-05-31 12:13:59 -07:00
Mark Salyzyn 30ea96e14e logcat: logcatd: make logcatd killable
Near last resort kill logcatd, set /proc/self/oom_score_adj to -600.

Can kill to keep system_server, telephony and bluetooth.

Test: manual, start logpersist, runs
Bug: 62147352
Change-Id: I3723761bf1d2b79ce6a9557d2e78f91cc5497e96
2017-05-31 11:27:22 -07:00
George Burgess IV 2e9af0942c Merge "logging: make LOG(FATAL) always run with the static analyzer."
am: b46fd68653

Change-Id: I761248df16cd0c7185bbd0934501151a18bdbdf5
2017-05-31 16:55:55 +00:00