summaryrefslogtreecommitdiff
path: root/adb/daemon/file_sync_service.cpp
AgeCommit message (Collapse)Author
2020-10-22Migrate system/core/adb to packages/modules/adbBaligh Uddin
BUG: 167963357 Test: TH Change-Id: Ie1f82db2fb14e1bdd183bf8d3d93d5e9f974be5d Ignore-AOSP-First: Unable to Merge into aosp/master due to downstream conflicts, so working from bottom up.
2020-05-28adb: implement zstd compression for file sync.Josh Gao
Bug: http://b/150827486 Test: test_device.py Change-Id: I9fac4c760d9dbdce0b3b883db975cfa9b27a9e80
2020-04-02adb: add dry-run option to push/sync.Josh Gao
Make it easier to benchmark file sync performance by ignoring the file system. Bug: https://issuetracker.google.com/150827486 Test: test_device.py Change-Id: Icfa4b28eb5206f1914c0c163833d070a3748c3ea
2020-04-02adb: implement LZ4 compression.Josh Gao
Add support for LZ4 compression, which compresses and decompresses far more quickly than brotli, at the cost of worse compression ratio. `adb sync -d system` speeds (in MB/s) on aosp_blueline-eng: none brotli lz4 USB 3.0 120 110 190 USB 2.0 38 75 63 Bug: https://issuetracker.google.com/150827486 Test: python3 -m unittest test_device.FileOperationsTest{Uncompressed,Brotli,LZ4} Change-Id: Ibef6ac15a76b4e5dcd02d7fb9433cbb1c02b8382
2020-04-02adb: fix use of wrong union variant.Josh Gao
Also, prepare to add more compression flags. Bug: https://issuetracker.google.com/150827486 Test: none Change-Id: I5044e5d5944aff5c18241fd7439baa48e2e09980
2020-04-02adb: add interfaces for Encoder/Decoder.Josh Gao
More groundwork to support more compression algorithms. Bug: https://issuetracker.google.com/150827486 Test: python3 -m unittest test_device.FileOperationsTest{Uncompressed,Brotli} Change-Id: I638493083b83e3f6c6854b631471e9d6b50bd79f
2020-04-01adbd: delete unused variable.Josh Gao
Bug: https://issuetracker.google.com/150827486 Test: m adb com.android.adbd.apex Change-Id: I90e10c74d695659c702dea4173cb33ac5ca1a102
2020-04-01adb: move things around to prepare to add LZ4.Josh Gao
Bug: https://issuetracker.google.com/150827486 Test: m adb com.android.adbd.apex Change-Id: I038d1df4f179ddb23102016d781c9bd90da5a546
2020-03-26adb: implement compression for file sync.Josh Gao
This improves performance when syncing by up to 2x (remote cuttlefish goes from 11.9 MB/s to 21.3 MB/s, blueline over USB 2.0 from 36 MB/s to 70 MB/s). This results in a slight drop in push speeds over USB 3.0 (125 -> 115 MB/s on blueline), presumably because we're compressing and extracting on only a single thread, but the gains over lower bandwidth transports make this worth it to submit this now and parallelize later. Bug: https://issuetracker.google.com/150827486 Test: ADB_COMPRESSION={0, 1} test_device.py (with new/old adbd) Change-Id: Ic2a0c974f1b6efecda115f87d336e3caac810035
2020-02-19adbd: remove static dependency on libcutils.Josh Gao
We were previously statically linking libcutils into adbd for several different reasons, which were addressed as follows: socket functions: extracted to a statically linked libcutils_network fs_config: wrapped with a shared library on /system ATRACE: deleted the single use in adbd Test: treehugger Change-Id: I821fa174cfcbfa8e29a4be10de4016b817adbaf8
2019-08-12adb: add ls_v2.Josh Gao
Add a 64-bit size/time variant of `adb ls`. Bug: http://b/122955521 Test: adb shell dd if=/dev/zero bs=1m count=8192 of=/data/local/tmp/big Test: adb pull /data/local/tmp/big Test: adb ls /data/local/tmp Change-Id: I6ff857239995bc7b5c5f8dfd65a36fad41e67d85
2019-08-12adb: rename syncmsg::*::time to mtime.Josh Gao
Test: mma Change-Id: Ia7d743d523f7fb45d8be7518b2db763614edcc85
2019-05-01adbd: move posix_fadvise after open.Josh Gao
Test: treehugger Change-Id: I531e452eda46d7df3106fd59192e9936e64876b1
2019-04-25Revert "Add a way to turn off unique_fd's operator int."Ian Kasprzak
This reverts commit 93d63c010ae24ff58acb70216bfcb93e3c73019a. Reason for revert: b/131312539 - All aosp-master-with-phones phones failing boot / health check. Change-Id: Id4239f93484b7d6b8d9bcd355a59cbd40d9766e2
2019-04-24Add a way to turn off unique_fd's operator int.Josh Gao
unique_fd's implicit conversion to int has led to tons of problems (see all of the overloads for close, fdopen, fdopendir, etc.). Add a switch that can turn it off, and reduce the ridiculous amount of work to fix up callers by introducing a borrowed_fd type that can be constructed from either int or unique_fd. Test: treehugger Change-Id: If77cf5cbcaddacdaec5919a15b3520fb68f51a62
2019-03-26adb: Avoid extra std::string copiesGreg Kaiser
When a function argument takes a std::string, it's inefficient to pass std::string::c_str(), since that creates an additional copy. So we change these calling sites. Test: TreeHugger Change-Id: I1c0fde7275eb3ebd3baf05ec62581b0243655608
2019-03-14Revert "Handle adb sync with Bionic under /bionic"Jiyong Park
This reverts commit 7c7189c46948761cc668c9362d0b5aefb4004c70. Bug: 125549215 Test: system/core/fs_mgr/tests/adb-remount-test.sh Change-Id: I4ee40cda9c3b94b116dc822c7b9736cfe2c9c9f0
2019-02-20adb: update symlink timestamps.Josh Gao
Bug: http://b/120162375 Test: adb sync; adb shell touch -h -d 2008-01-0101:01:01 /system/bin/ls; adb sync; adb sync Change-Id: Iedf54528b164913739c66c71d20006e484a4f5e4
2019-01-30Handle adb sync with Bionic under /bionicJiyong Park
Background: We now have two sets of Bionic: the bootstrap Bionic which is at /system/{lib|bin}/bootstrap for early processes and the default Bionic which is from the runtime APEX for all the others. In order to give the same path for Bionic to both categories of processes, the init prepares two mount namespaces and bind-mount appropriate Bionic files onto the common mount points under /bionic. For example, /system/bin/bootstrap/linker is bind-mounted to /bionic/bin/linker for the early processes. Likewise, /apex/com.android.runtime/bin/linker is bind-mounted to the same path for rest of the processes. In addition, in order not to propagate mount events in one mount namespace to the other namespace, /bionic itself is created as a mount namespace (via self bind-mount) and its propagation type is set to private. Changes required: This however requires some adjustments to adb sync and remount mechanism. For remounting, /bionic path should also be re-mounted for RW, because it is a RO mount in the beginning. This remounting is done only for the system-as-root devices where entire / can be re-mounted as RW. For synching, the sync thread creates a temporary mount namespace where there is no bind-mount. This ensures that a path that the thread handles is pointing to the correct file that is expected from the client side. In addition, push operation to /bionic path is done without unlinking. This is required because the mount points under /bionic are gone in the current mount namespace but are still active in other mount namespaces. If unlinked, the existing mounts on the path are all silently removed. In order to prevent the unwanted situation, the moint points are not unlinked but truncated to 0. This however is not a significant problem because the files that serve as mount points do not carry any useful information (i.e. the content is meaningless). Bug: 879416 Test: adb sync adb push <random_file> /bionic/bin/linker64 adb push <random_file> /system/bin/bootstrap/bin/linker64 system/core/fs_mgr/tests/adb-remount-test.sh Change-Id: Id87dc9ee7ec5c43d06b54969b55e2cb394329317
2019-01-23adb: convert more stuff to unique_fd.Josh Gao
Test: adb_test Test: adbd_test Test: test_device.py Change-Id: Ie75f0b811d2c75d508e6ecffb40579308f5789d0
2019-01-23adbd: compile for host.Josh Gao
Preparatory step for testing adb on GCE on non-linux hosts: instead of pointing them at a device (emulated or otherwise), point them at adbd running on a linux host instead. Test: adbd & adb connect localhost:5555; adb -e wait-for-device shell Change-Id: Ib22d51a4fc9e6e68f71bf1b3b9b2e1b0bd844760
2018-10-08adb: identical symlink, do not updateMark Salyzyn
Inefficient to always update the symlinks to overlayfs, can also lead to failed to copy 'xxx' to 'yyy': remote symlink failed: File exists on older variants of overlayfs that do not effectively mark them deleted. Test: manual Bug: 109821005 Change-Id: If1286d76f45ce14087cdb515fe8d2fed198fd9d8
2018-07-25adb: use adb's unique_fd instead of android::base.Josh Gao
Replace all usages of android::base::unique_fd with the unique_fd from adb_unique_fd.h, which calls adb_close instead of close on Windows. Most of these changes are no-ops, except for the ones to create_service_thread, which was probably pretty broken on Windows. Test: python test_device.py Test: adb_test Test: wine adb_test.exe Change-Id: Ia4d03f9e2e7ddc88c97dc64172d721f93f3bf853
2018-07-25adb: split file_sync_service.h into client and daemon parts.Josh Gao
Test: treehugger Change-Id: I648c7001903a91448c69986e08a6cd2dd76ed793
2018-07-18adb: Modernize the service creationLuis Hector Chavez
This change removes the void* argument passing and instead uses C++11 features to avoid having to handle memory manually. Bug: None Test: python ./system/core/adb/test_device.py Change-Id: I6380245b2ca583591810e3e363c67c993a107621
2018-07-09adbd: fix spurious failure to create dirs when pushing.Josh Gao
When pushing to a path, we first try to ensure the directory path exists and has the permissions expected by fs_config. Due to a change that changed the fs_config check from a blacklist to a whitelist, we started doing this for /data (which doesn't begin with /data/), and the UID/GID for that path was accidentally being reused for following path segments that didn't exist, leading to a failed attempt to chown /data/local/tmp/foo to be owned by system. Bug: http://b/110953234 Test: python test_device.py Change-Id: Ie798eec48bcf54aea40f6d90cc03bb2170280ee8
2018-04-04Support /odm and /product in "adb remount" and "adb sync".Elliott Hughes
Bug: http://b/77587036 Test: `adb remount` and `adb sync` still work on hikey Change-Id: I960ae75099edf147f857a67d906b6bc133f817a7
2018-02-28adb: switch over to Android.bp.Josh Gao
Rearrange some files while we're doing this. Bug: http://b/71721338 Test: manually ran adb on windows Change-Id: Ie47bda82279e4b9521505ad0353bf9ef649fc7d7