Commit Graph

18241 Commits

Author SHA1 Message Date
Josh Gao dcaf6932fd Merge "adb: use correct _WIN32 macro."
am: 5c75b529f6

* commit '5c75b529f684b388c91c7e7d0b2c7fece376ac1d':
  adb: use correct _WIN32 macro.
2015-11-02 18:59:01 +00:00
Josh Gao 5c75b529f6 Merge "adb: use correct _WIN32 macro." 2015-11-02 18:55:09 +00:00
Elliott Hughes 1de89478ac Merge "Fix ParseInt/ParseUint to handle explicit "0x" hex."
am: ddf5edacc2

* commit 'ddf5edacc24125730b537265f69a081b19606246':
  Fix ParseInt/ParseUint to handle explicit "0x" hex.
2015-11-02 18:30:59 +00:00
Elliott Hughes ddf5edacc2 Merge "Fix ParseInt/ParseUint to handle explicit "0x" hex." 2015-11-02 18:26:59 +00:00
Elliott Hughes 3ab05869d8 Fix ParseInt/ParseUint to handle explicit "0x" hex.
Also improve fastboot error reporting around max-download-size.

Change-Id: Ic3aec9460de01e5264a2803a0a6be3706d73026b
2015-11-02 09:01:53 -08:00
Daniel Erat 839cadfc9b Merge "libcutils: Make /data/nativetest{,64}/* executable."
am: 00617fbe57

* commit '00617fbe57a6330537a51b81c2e346b934f40d9e':
  libcutils: Make /data/nativetest{,64}/* executable.
2015-11-02 17:01:47 +00:00
Daniel Erat 00617fbe57 Merge "libcutils: Make /data/nativetest{,64}/* executable." 2015-11-02 16:57:56 +00:00
Daniel Erat 5510c13991 libcutils: Make /data/nativetest{,64}/* executable.
Make test files under /data/nativetest{,64} 0750 root:shell
to avoid needing to manually chmod them.

Bug: 25340994
Change-Id: I174cc226195907c0effa99063a8aa0082f85722b
2015-11-02 09:45:04 -07:00
Josh Gao 4a1397264b adb: use correct _WIN32 macro.
Change-Id: I5af7957162ae7f8472a5a262434eaba84e64325a
2015-10-30 18:39:20 -07:00
Elliott Hughes edb78620fb Merge "adb: fix adb client running out of sockets on Windows"
am: 1e2382a027

* commit '1e2382a0277eb36fb57a3a54202945556dfd234b':
  adb: fix adb client running out of sockets on Windows
2015-10-30 23:33:26 +00:00
Elliott Hughes 1e2382a027 Merge "adb: fix adb client running out of sockets on Windows" 2015-10-30 23:29:27 +00:00
Spencer Low 351ecd15b2 adb: fix adb client running out of sockets on Windows
Background
==========

On Windows, if you run "adb shell exit" in a loop in two windows,
eventually the adb client will be unable to connect to the adb server. I
think connect() is returning WSAEADDRINUSE: "Only one usage of each
socket address (protocol/network address/port) is normally permitted.
(10048)". The Windows System Event Log may also show Event 4227, Tcpip.
Netstat output is filled with:

  # for the adb server
  TCP    127.0.0.1:5037         127.0.0.1:65523        TIME_WAIT
  # for the adb client
  TCP    127.0.0.1:65523        127.0.0.1:5037         TIME_WAIT

The error probably means that the client is running out of free
address:port pairs.

The first netstat line is unavoidable, but the second line exists
because the adb client is not waiting for orderly/graceful shutdown of
the socket, and that is apparently required on Windows to get rid of the
second line. For more info, see
https://github.com/CompareAndSwap/SocketCloseTest .

This is exacerbated by the fact that "adb shell exit" makes 4 socket
connections to the adb server: 1) host:version, 2) host:features, 3)
host:version (again), 4) shell:exit. Also exacerbating is the fact that
the adb protocol is length-prefixed so the client typically does not
have to 'read() until zero' which effectively waits for orderly/graceful
shutdown.

The Fix
=======

Introduce a function, ReadOrderlyShutdown(), that should be called in
the adb client to wait for the server to close its socket, before
closing the client socket.

I reviewed all code where the adb client makes a connection to the adb
server and added ReadOrderlyShutdown() when it made sense. I wasn't able
to add it to the following:

* interactive_shell: this doesn't matter because this is interactive and
  thus can't be run fast enough to use up ports.
* adb sideload: I couldn't get enough test coverage and I don't think
  this is being called frequently enough to be a problem.
* send_shell_command, backup, adb_connect_command, adb shell, adb
  exec-out, install_multiple_app, adb_send_emulator_command: These
  already wait for server socket shutdown since they already call
  recv() until zero.
* restore, adb exec-in: protocol design can't have the server close
  first.
* adb start-server: no fd is actually returned
* create_local_service_socket, local_connect_arbitrary_ports,
  connect_device: probably called rarely enough not to be a problem.

Also in this change
===================

* Clarify comments in when adb_shutdown() is called before exit().
* add some missing adb_close() in adb sideload.
* Fixup error handling and comments in adb_send_emulator_command().
* Make SyncConnection::SendQuit return a success boolean.
* Add unittest for adb emu kill command. This gets code coverage over
  this very careful piece of code.

Change-Id: Iad0b1336f5b74186af2cd35f7ea827d0fa77a17c
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-10-30 16:23:10 -07:00
Elliott Hughes 878f0b9c82 Merge "Fix ps -Z so it combines with other arguments."
am: dd48ffe910

* commit 'dd48ffe91003f29e378ef30776cdc4e6091db759':
  Fix ps -Z so it combines with other arguments.
2015-10-30 23:15:29 +00:00
Elliott Hughes dd48ffe910 Merge "Fix ps -Z so it combines with other arguments." 2015-10-30 23:11:18 +00:00
Elliott Hughes 888b517826 Merge "Remove the name filtering from toolbox ps."
am: 9d1636b193

* commit '9d1636b193adf9ba6cd598e3637bbebafcf4f9bf':
  Remove the name filtering from toolbox ps.
2015-10-30 22:25:31 +00:00
Elliott Hughes d2e26c0e30 Fix ps -Z so it combines with other arguments.
This is another step towards being able to swap toolbox ps out for
a more complete ps. This should also let us fix dumpstate to not
need a separate "ps -Z" run --- we can just add -Z to the previous
run of ps instead.

Change-Id: I0b96dff51988edd2b33879f8c31faccebeeffddd
2015-10-30 15:16:45 -07:00
Elliott Hughes 9d1636b193 Merge "Remove the name filtering from toolbox ps." 2015-10-30 22:14:55 +00:00
Elliott Hughes 5dc119a67b Remove the name filtering from toolbox ps.
Regular ps doesn't have this, and at least in our tree everyone
seems to actually pipe to grep instead of using this anyway. But
since the switch to a more full-featured ps is going to be a nightmare
anyway, let's dip a toe in the water by removing something we don't plan
on supporting.

Change-Id: Id220ae0cfdad8368341730f643a2bfbaad3c9716
2015-10-30 15:03:30 -07:00
Mark Salyzyn 14105639a9 Merge "logd: statistics report chatty effective percentage"
am: d2c8cf8265

* commit 'd2c8cf826587de9ef1269ba22fd70df00f874c23':
  logd: statistics report chatty effective percentage
2015-10-30 22:02:15 +00:00
Mark Salyzyn 2c0f84da2e Merge "logd: Add support for *.logd.filter"
am: 95ec339f5e

* commit '95ec339f5ef68696630df470e172bbb306faa1b6':
  logd: Add support for *.logd.filter
2015-10-30 22:02:10 +00:00
Mark Salyzyn d2c8cf8265 Merge "logd: statistics report chatty effective percentage" 2015-10-30 22:00:38 +00:00
Mark Salyzyn 95ec339f5e Merge "logd: Add support for *.logd.filter" 2015-10-30 21:59:25 +00:00
Mark Salyzyn c723df805a logd: statistics report chatty effective percentage
Report the ESTIMATED instantaneous percentage decrease or increase
that an UID has to the logs as a result of the chatty filtration.

Bug: 22855208
Change-Id: If1e77afb81a2739a72b39bc7c57071763c1d64d8
2015-10-30 14:54:17 -07:00
Mark Salyzyn 932f7acc81 logd: Add support for *.logd.filter
- Add device (ro.logd.filter), persistent (persist.logd.filter)
  properties to control the default filters
- Allow logcat -P default to produce expected results
- Allow logcat -P disable to produce expected results

Change-Id: I651cb705373ec1e88a99e4b9086da4f9668a468a
2015-10-30 14:54:17 -07:00
Elliott Hughes 39f7a1f026 Merge "Show transfer progress in adb sync/pull/push."
am: 26352bf1fb

* commit '26352bf1fbbc8efdfdd0ef4d7c008fcbec445f29':
  Show transfer progress in adb sync/pull/push.
2015-10-30 21:48:33 +00:00
Elliott Hughes 5e58724b33 Merge "fastboot shouldn\'t erase non-existent cache partitions."
am: 9ebdf72a54

* commit '9ebdf72a5465b75ab4ce359e11c1ff6c2f3e376a':
  fastboot shouldn't erase non-existent cache partitions.
2015-10-30 21:42:04 +00:00
Elliott Hughes 26352bf1fb Merge "Show transfer progress in adb sync/pull/push." 2015-10-30 21:41:19 +00:00
Elliott Hughes 9ebdf72a54 Merge "fastboot shouldn't erase non-existent cache partitions." 2015-10-30 21:34:47 +00:00
Elliott Hughes b708d16283 Show transfer progress in adb sync/pull/push.
Change-Id: If5439877d060f9bab29cf84be996071cf680c2d4
2015-10-30 14:19:23 -07:00
Elliott Hughes 2fd45a9cea fastboot shouldn't erase non-existent cache partitions.
Check that the cache partition exists before trying to erase it.

Also clean up some of the C string handling and int booleans.

Bug: http://b/25375777
Change-Id: I1880e542b729f2026ab3a2943d4bee9d659b1eeb
2015-10-30 14:15:22 -07:00
Adam Lesinski 35b5a07958 Merge "ZipWriter: archive disk numbers are 0 index based"
am: 25322eeddd

* commit '25322eedddb833d923a3eb8339ef11a1558aecdb':
  ZipWriter: archive disk numbers are 0 index based
2015-10-30 17:00:17 +00:00
Adam Lesinski 42f8538df5 Merge "Add deflate compression to ZipWriter"
am: ac60abdd70

* commit 'ac60abdd703b3900969fc609922593b2a8343f7f':
  Add deflate compression to ZipWriter
2015-10-30 17:00:10 +00:00
Adam Lesinski 25322eeddd Merge "ZipWriter: archive disk numbers are 0 index based" 2015-10-30 16:56:11 +00:00
Adam Lesinski ac60abdd70 Merge "Add deflate compression to ZipWriter" 2015-10-30 16:55:55 +00:00
Sami Tolvanen 12062c04ef Merge "fs_mgr: set partition.*.verified property even without state"
am: b093cda7fb

* commit 'b093cda7fb83f39c6e2f25bda6a82b0c8b332ca2':
  fs_mgr: set partition.*.verified property even without state
2015-10-30 14:56:34 +00:00
Sami Tolvanen b093cda7fb Merge "fs_mgr: set partition.*.verified property even without state" 2015-10-30 14:51:34 +00:00
Sami Tolvanen 25b230c62c fs_mgr: set partition.*.verified property even without state
Set properties on verity_update_state even if verity state management
is not used.

Bug: 24865045
Change-Id: Ic68a9e1a230c959eeb2a769260ff7d8e100cb1e1
(cherry picked from 0eb0516665678aec7712d88b51c96aaf8b312060)
2015-10-30 13:14:38 +00:00
Narayan Kamath dfa10ee4dc Merge "libziparchive: fix calculation of mod_time."
am: b57cd14596

* commit 'b57cd14596ea26d8808b5f193769b0727f5e15e3':
  libziparchive: fix calculation of mod_time.
2015-10-30 10:05:48 +00:00
Narayan Kamath b57cd14596 Merge "libziparchive: fix calculation of mod_time." 2015-10-30 10:03:28 +00:00
beonit 0e99a2f79a libziparchive: fix calculation of mod_time.
Take mod_date into account as well, and fixes the issue where
all entries had creation dates in 1979.

Signed-off-by: beonit <beonit@gmail.com>
Change-Id: Id101794fa08218d15f2d1ba4e4a313c1807ea7aa
2015-10-30 10:01:38 +00:00
Mark Salyzyn 9d4203aae1 Merge changes Iefbea3b1,Ieb924b6d
am: bb51fbc4d4

* commit 'bb51fbc4d4b311ae315e4d7dd174167ebeadc2a8':
  liblog: add android_log_timestamp() private function
  liblog: logcat: add epoch and monotonic format modifiers
2015-10-29 23:05:33 +00:00
Mark Salyzyn bb51fbc4d4 Merge changes Iefbea3b1,Ieb924b6d
* changes:
  liblog: add android_log_timestamp() private function
  liblog: logcat: add epoch and monotonic format modifiers
2015-10-29 23:00:14 +00:00
Mark Salyzyn 500afc7532 liblog: add android_log_timestamp() private function
Change-Id: Iefbea3b1be2f97cfdeb35e5330e5495e0337215b
2015-10-29 14:23:42 -07:00
Mark Salyzyn 4cbed02e44 liblog: logcat: add epoch and monotonic format modifiers
- '-v epoch' prints seconds since Jan 1 1970
- '-v monotonic' print cpu seconds since start of device
- '-T sssss.mmm...' as alternate tail time format

NB: monotonic is a best estimate and may be out by a few ms
    given the synchronization source clue accuracy.

Bug: 23668800
Change-Id: Ieb924b6d3817669c7e53beb9c970fb626eaad460
2015-10-29 14:23:42 -07:00
Dan Willemsen 529fa1867c Merge "Use GetBuildTime from libchrome instead of __DATE__"
am: 4d18ae9301

* commit '4d18ae9301029271ddd86f4b311c97a130ad5044':
  Use GetBuildTime from libchrome instead of __DATE__
2015-10-29 20:58:46 +00:00
Dan Willemsen 4d18ae9301 Merge "Use GetBuildTime from libchrome instead of __DATE__" 2015-10-29 20:53:38 +00:00
Dan Willemsen faa566d29f Use GetBuildTime from libchrome instead of __DATE__
So that this daemon doesn't change on every build, use the system build
date from libchrome (which reads ro.build.date). That way we don't have
to update this daemon for every OTA.

Bug: 24204119
Change-Id: I136d53e5e4ebb9430a57dace66198d8d704d7ca3
2015-10-29 13:02:42 -07:00
Elliott Hughes ebd5badd84 Merge "Don\'t use VLAs in adb."
am: 24704399cd

* commit '24704399cdd58a396831fce2ba678642bd3a8ba5':
  Don't use VLAs in adb.
2015-10-27 22:52:26 +00:00
Alex Vakulenko 3ac10737b3 Merge "core: Rename libchromeos into libbrillo"
am: 6ac83e416f

* commit '6ac83e416febedaee228e970f723a25868a98518':
  core: Rename libchromeos into libbrillo
2015-10-27 22:52:20 +00:00
Elliott Hughes 24704399cd Merge "Don't use VLAs in adb." 2015-10-27 22:47:05 +00:00