a05b64d432
vsock is a socket address family for communicating into and out of virtual machines. Addresses have a port and CID. The CID is unique to each virtual machine on the computer. The VM host always has CID 2. http://man7.org/linux/man-pages/man7/vsock.7.html Inside the android guest, the adb daemon hosts a vsock server with VMADDR_CID_ANY, automatically using the guest CID. The adb server can now connect to addresses of the form vsock:cid:port, where the CID must be specified and the port defaults to 5555. This is a significant speed improvement for ADB connections in Cuttlefish, with 150-200 MB/s for `adb push` and 100-150 MB/s for `adb pull`. It also allows removing some proxying steps from Cuttlefish, simplifying the full connection path, and removes a dependency on the unstable ivshmem protocol. Commands tested against a Cuttlefish VM with CID 3: adb connect vsock:3:5555 adb -s vsock:3:5555 shell adb disconnect vsock:3:5555 Supporting "adb disconnect" and "adb -s" required modifying some of the parts that parse addresses / serials. push/pull trials with native adb vsock support in cuttlefish: 100m: 1 file pushed. 297.6 MB/s (104857600 bytes in 0.336s) 100m: 1 file pushed. 270.3 MB/s (104857600 bytes in 0.370s) 100m: 1 file pushed. 271.7 MB/s (104857600 bytes in 0.368s) 100m: 1 file pushed. 250.5 MB/s (104857600 bytes in 0.399s) 100m: 1 file pushed. 277.1 MB/s (104857600 bytes in 0.361s) 100m: 1 file pushed. 263.5 MB/s (104857600 bytes in 0.379s) 100m: 1 file pushed. 242.6 MB/s (104857600 bytes in 0.412s) 100m: 1 file pushed. 271.8 MB/s (104857600 bytes in 0.368s) 100m: 1 file pushed. 267.1 MB/s (104857600 bytes in 0.374s) /data/local/tmp/100m: 1 file pulled. 212.8 MB/s (104857600 bytes in 0.470s) /data/local/tmp/100m: 1 file pulled. 236.7 MB/s (104857600 bytes in 0.423s) /data/local/tmp/100m: 1 file pulled. 201.2 MB/s (104857600 bytes in 0.497s) /data/local/tmp/100m: 1 file pulled. 255.6 MB/s (104857600 bytes in 0.391s) /data/local/tmp/100m: 1 file pulled. 199.6 MB/s (104857600 bytes in 0.501s) /data/local/tmp/100m: 1 file pulled. 214.6 MB/s (104857600 bytes in 0.466s) /data/local/tmp/100m: 1 file pulled. 254.2 MB/s (104857600 bytes in 0.393s) /data/local/tmp/100m: 1 file pulled. 212.5 MB/s (104857600 bytes in 0.471s) /data/local/tmp/100m: 1 file pulled. 218.9 MB/s (104857600 bytes in 0.457s) /data/local/tmp/100m: 1 file pulled. 223.6 MB/s (104857600 bytes in 0.447s) Bug: 121166534 Change-Id: I50f21fb5c9acafb8daa789df4e28c9e1bbbbf2ef Test: adb connect/shell/disconnect |
||
---|---|---|
.. | ||
client | ||
daemon | ||
fastdeploy | ||
sysdeps | ||
.clang-format | ||
adb.bash | ||
adb.cpp | ||
adb.h | ||
adb_auth.h | ||
adb_integration_test_adb.xml | ||
adb_integration_test_device.xml | ||
adb_io.cpp | ||
adb_io.h | ||
adb_io_test.cpp | ||
adb_listeners.cpp | ||
adb_listeners.h | ||
adb_listeners_test.cpp | ||
adb_mdns.h | ||
adb_trace.cpp | ||
adb_trace.h | ||
adb_unique_fd.cpp | ||
adb_unique_fd.h | ||
adb_utils.cpp | ||
adb_utils.h | ||
adb_utils_test.cpp | ||
Android.bp | ||
benchmark_device.py | ||
bugreport_test.cpp | ||
fdevent.cpp | ||
fdevent.h | ||
fdevent_test.cpp | ||
fdevent_test.h | ||
file_sync_protocol.h | ||
MODULE_LICENSE_APACHE2 | ||
NOTICE | ||
OVERVIEW.TXT | ||
OWNERS | ||
protocol.txt | ||
security_log_tags.h | ||
services.cpp | ||
services.h | ||
SERVICES.TXT | ||
shell_protocol.h | ||
shell_service_protocol.cpp | ||
shell_service_protocol_test.cpp | ||
socket.h | ||
socket_spec.cpp | ||
socket_spec.h | ||
socket_spec_test.cpp | ||
socket_test.cpp | ||
sockets.cpp | ||
sockets.dia | ||
SYNC.TXT | ||
sysdeps.h | ||
sysdeps_test.cpp | ||
sysdeps_unix.cpp | ||
sysdeps_win32.cpp | ||
sysdeps_win32_test.cpp | ||
test_adb.py | ||
test_device.py | ||
trace.sh | ||
transport.cpp | ||
transport.h | ||
transport_benchmark.cpp | ||
transport_fd.cpp | ||
transport_local.cpp | ||
transport_test.cpp | ||
transport_usb.cpp | ||
types.h | ||
types_test.cpp | ||
usb.h |