When init queues a trigger, it actually enqueues all of the Actions
that match with that given trigger. This works currently because
all init scripts are loaded and therefore all Actions are available
before init starts queueing any triggers.
To support loading init scripts after init has started queueing
triggers, this change enqueues Trigger objects instead of their
matching Actions. Each Trigger object then matches its associated
Actions during its execution.
Additionally, this makes a few cosmetic clean ups related to triggers.
Bug: 23186545
Change-Id: I5d177458e6df1c4b32b1072cf77e87ef952c87e4
This init script creates the metrics data directory (/data/misc/metrics)
and starts the daemon.
BUG: 22953527
Change-Id: I21cd36f38a7a3550bc755cef5699e9a6ac3dfb94
Fix various path/directory locations to their Android equivalents
to enable collection of core dumps and generation of mini dumps
to work correctly. Also add the init script to initialize
crash_reporter.
Bug: 22874832
Change-Id: Iffb1529e5259c5da5ba7f6977b2787e738f68a78
The current behavior, which is to use tags[-1] for end_tag, is good
enough in most cases, but sometime it makes more sense to use a
different one as end_tag.
For example, when optimizing APK scanning code in package manager,
using 'boot_progress_pms_scan_end' as end_tag would give us quicker
benchmark iterations as well as more relevant numbers possibly with
a smaller standard deviation.
Change-Id: Ic6371c936b36d1d87e9742502fd8958682a3b7d5
adb on Windows uses \r\n line-endings, so take that into account when
parsing output for the exit code.
Change-Id: I6a3d7c5ca455b0f0f7dae174866857e0aeee9926
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
This allows us to test for features explicitly rather than relying on
the protocol version number, allowing us to fall back gracefully if a
feature is not supported.
This will be needed for the upcoming shell upgrades for stdout/stderr
separation and exit code reporting.
Change-Id: Ibb1d8ad2611f7209901ee76d51346b453e9c5873
This CL clears both the host and device endpoints right at the
beginning when the bulk endpoints are identified. This is in general
a "good idea", but more specifically for us, it fixes the issue
that sometimes when adb quits, it clears the endpoint on the host,
but not on the device which resulted in a subsequent invocation of
adb was seeing a stall.
Bug: https://code.google.com/p/android/issues/detail?id=182151
Change-Id: I331fa6805c40d1f50c153c010ceecd2f6a4045eb
Win32:
- getprogname(): call basename() which is available in mingw's crt.
Don't potentially go recursive with DCHECK_GT().
- Use Win32 critical section instead of mutex.
Other:
- Change log_characters check to compile-time.
- Fix code that gets the basename of __FILE__. The previous code was not
setting _file, so it didn't work.
- Save and restore errno for LOG calls. Inspired by similar Chromium code.
Change-Id: Ie7bb700918be726fa81d60177d1894d2daeff296
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
- handle_host_request
- When the host:kill command comes in, shutdown the socket before
calling exit(). If we don't do this, the client will output error info
even though everything is working ok.
- adb_connect()
- If we can't parse the version string, explain this in error output
and don't goto error which would try to close an fd we already closed.
- If host:kill doesn't work, output error info. Don't try to close
already closed fd.
- adb_main()
- If writing the ACK somehow has an error, output error info (I doubt
this will ever get hit).
- adb_commandline()
- Fix typo about max port number.
- Make 'adb kill-server' and 'adb start-server' output any detailed
error info.
Change-Id: Id1a309cc1bf516f7f49bd332b34d30f148b406da
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
adb can hang at shutdown due to a deadlock relating to WSACleanup().
This works around the issue by not calling WSACleanup() which shouldn't
be done anyway since threads aren't done using Winsock at shutdown.
A quick way to reproduce the original problem is to run many instances
of adb, many of which will call exit() soon:
for /l %i in (1,1,20) do @start adb nodaemon server
You may have to boost the 20 to 200, or set ADB_TRACE=1 or use Windows
10 instead of Windows 7, to affect the timing, but eventually there
should be hung adb processes with that repro.
A more complete fix to prevent problems like this from occuring in the
future, would be to additionally do the following:
- Investigate all static destructors that are called when exit() is
called.
- If they don't do anything important, switch all calls to exit() to
instead call _exit() and then ban exit() from being called.
Change-Id: Id1be3bf0053809a45f2eca4461e4c35b5ef9388d
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>