platform_system_core/adb
Josh Gao c51726cbec adbd: implement a nonblocking USB Connection.
Implement a Connection that implements a nonblocking interface to
functionfs, to replace the existing implementation that uses two
threads that loop and call read and write respectively. The existing
implementation is vulnerable to a race condition that can occur when a
connection is terminated, where one thread can notice failure and
complete reinitialization of the USB endpoints before the other thread
noticed anything went wrong, resulting in either the first packet
coming from the other end disappearing in to the void, or the other end
getting a packet of garbage.

As a side benefit, this improves performance on walleye from:

    push 100MiB: 10 runs: median 49.48 MiB/s, mean 50.00 MiB/s, stddev: 2.77 MiB/s
    pull 100MiB: 10 runs: median 75.82 MiB/s, mean 76.18 MiB/s, stddev: 6.60 MiB/s

to:

    push 100MiB: 10 runs: median 73.90 MiB/s, mean 73.51 MiB/s, stddev: 5.26 MiB/s
    pull 100MiB: 10 runs: median 105.90 MiB/s, mean 107.19 MiB/s, stddev: 6.10 MiB/s

Test: python test_device.py
Change-Id: I9b77c1057965edfef739ed9736e5d76613adf60a
2018-10-19 17:53:18 -07:00
..
client Merge "adb: add reboot-fastboot command" 2018-10-12 03:38:05 +00:00
daemon adbd: implement a nonblocking USB Connection. 2018-10-19 17:53:18 -07:00
fastdeploy Modified fastdeploy dependencies to ensure that fast deploy is build as part of 'sdk' target 2018-09-06 10:05:54 +00:00
sysdeps Adapt to switch to libc++ for Windows 2018-09-21 10:46:25 -07:00
.clang-format Remove extraneous .clang-format files 2017-03-14 14:06:31 -07:00
adb.bash Adb and fastboot completion supports zsh users. 2018-07-17 14:19:35 +08:00
adb.cpp adb: win32: fix ReportServerStartupFailure 2018-09-02 19:26:25 -07:00
adb.h adb: clean up handle_host_request. 2018-08-07 14:24:36 -07:00
adb_auth.h adb: switch apacket over to a std::string payload. 2018-02-21 14:30:17 -08:00
adb_integration_test_adb.xml Add adb integration test to general-tests 2018-08-08 12:08:50 -07:00
adb_integration_test_device.xml Add adb_integration_test_device to general-tests 2018-10-12 13:48:14 -07:00
adb_io.cpp [adb] Modernize codebase by replacing NULL with nullptr 2018-07-13 18:21:00 -07:00
adb_io.h
adb_io_test.cpp
adb_listeners.cpp Adapt to switch to libc++ for Windows 2018-09-21 10:46:25 -07:00
adb_listeners.h adb: move all cleanup to a function with defined ordering. 2017-05-09 14:32:47 -07:00
adb_listeners_test.cpp
adb_mdns.h Add mDNS device discovery for adb client 2017-03-07 14:45:51 -08:00
adb_trace.cpp adb: don't spew to logcat when tracing is enabled. 2018-02-06 15:55:06 -08:00
adb_trace.h adb: don't spew to logcat when tracing is enabled. 2018-02-06 15:55:06 -08:00
adb_unique_fd.cpp adb: actually enable fdsan. 2018-08-06 18:50:10 -07:00
adb_unique_fd.h adb: actually enable fdsan. 2018-08-06 18:50:10 -07:00
adb_utils.cpp adb: extract helper for dumping a packet header. 2018-10-12 16:38:52 -07:00
adb_utils.h adb: extract helper for dumping a packet header. 2018-10-12 16:38:52 -07:00
adb_utils_test.cpp adb: fix escape_arg for multiple quotes 2018-07-10 23:32:09 -07:00
Android.bp adbd: implement a nonblocking USB Connection. 2018-10-19 17:53:18 -07:00
Android.mk adb: restore adb/adb.exe in the list of artifacts. 2018-03-28 12:57:48 -07:00
benchmark_device.py adb: improve benchmark script a bit. 2018-10-12 18:03:50 -07:00
bugreport_test.cpp Merge "Don't preserve file attributes when pulling bugreport file..." 2017-08-22 22:41:26 +00:00
fdevent.cpp Revert "Revert "adb: detect some spin loops and abort."" 2018-10-05 17:23:44 -07:00
fdevent.h adb: add fdevent_release. 2018-09-26 12:44:30 -07:00
fdevent_test.cpp Adapt to switch to libc++ for Windows 2018-09-21 10:46:25 -07:00
fdevent_test.h adb: move ownership of the fdevent thread into FdeventTest. 2018-03-30 14:57:09 -07:00
file_sync_protocol.h adb: split file_sync_service.h into client and daemon parts. 2018-07-25 18:08:32 -07:00
MODULE_LICENSE_APACHE2
NOTICE adb: append the libwinpthread COPYING to adb's NOTICE. 2017-03-08 21:27:59 -08:00
OVERVIEW.TXT adb: fix obsolete documentation. 2018-06-22 13:12:19 -07:00
OWNERS Add OWNERS. 2017-12-07 13:30:03 -08:00
protocol.txt adb: convert Connection to a nonblocking interface. 2018-03-05 13:00:28 -08:00
security_log_tags.h
services.cpp adb: split daemon services out of service_to_fd. 2018-07-25 18:49:37 -07:00
services.h adb: split daemon services out of service_to_fd. 2018-07-25 18:49:37 -07:00
SERVICES.TXT adb: fix obsolete documentation. 2018-06-22 13:12:19 -07:00
shell_protocol.h adb: split shell_service.h into client/daemon/protocol parts. 2018-07-25 18:08:44 -07:00
shell_service_protocol.cpp adb: split shell_service.h into client/daemon/protocol parts. 2018-07-25 18:08:44 -07:00
shell_service_protocol_test.cpp adb: split shell_service.h into client/daemon/protocol parts. 2018-07-25 18:08:44 -07:00
socket.h adb: add IOVector. 2018-05-23 11:26:04 -07:00
socket_spec.cpp Add std::string StartsWith*/EndsWith* overloads. 2017-12-20 09:42:22 -08:00
socket_spec.h adb: parse tcp socket specs with base::ParseNetAddress. 2016-09-20 13:55:43 -07:00
socket_spec_test.cpp adb: parse tcp socket specs with base::ParseNetAddress. 2016-09-20 13:55:43 -07:00
socket_test.cpp adb: switch apacket payload to a type that doesn't initialize its contents. 2018-04-11 12:54:07 -07:00
sockets.cpp Revert "adb: don't close sockets before hitting EOF." 2018-10-12 05:08:45 +00:00
sockets.dia
SYNC.TXT Fix typos in ADB documentation 2017-11-30 10:57:51 -08:00
sysdeps.h Support > 2GiB seeks in adb_lseek. 2018-09-26 14:48:05 -07:00
sysdeps_test.cpp adb: fix FdeventTest.invalid_fd on Windows. 2018-03-29 14:24:03 -07:00
sysdeps_unix.cpp
sysdeps_win32.cpp Merge changes from topic "windows-libcxx" 2018-10-11 17:00:53 +00:00
sysdeps_win32_test.cpp adb: add script to trace adbd. 2016-12-13 14:31:17 -08:00
test_adb.py test_adb.py: silence ResourceWarning. 2018-10-16 11:00:39 -07:00
test_device.py Revert "adb: don't close sockets before hitting EOF." 2018-10-12 05:08:45 +00:00
trace.sh adb: add script to trace adbd. 2016-12-13 14:31:17 -08:00
transport.cpp adbd: implement a nonblocking USB Connection. 2018-10-19 17:53:18 -07:00
transport.h adbd: implement a nonblocking USB Connection. 2018-10-19 17:53:18 -07:00
transport_benchmark.cpp adb: add nonblocking fd Connection. 2018-06-12 17:04:34 -07:00
transport_fd.cpp Adapt to switch to libc++ for Windows 2018-09-21 10:46:25 -07:00
transport_local.cpp Adapt to switch to libc++ for Windows 2018-09-21 10:46:25 -07:00
transport_test.cpp adb: Remove most C-style allocations 2018-07-19 09:41:40 -07:00
transport_usb.cpp Adapt to switch to libc++ for Windows 2018-09-21 10:46:25 -07:00
types.h Merge changes from topic "windows-libcxx" 2018-10-11 17:00:53 +00:00
types_test.cpp Adapt to switch to libc++ for Windows 2018-09-21 10:46:25 -07:00
usb.h adb: get libusb compiling on Windows. 2017-12-08 13:11:15 -08:00