Commit Graph

14194 Commits

Author SHA1 Message Date
Elliott Hughes afe151fb02 Add ParseInt (and ParseUint).
strtol and family are hard to use correctly, and most callers don't
even try.

Change-Id: I2833622a92cccd4662c0c5bdbbef5eeb4e496914
2015-09-04 16:32:00 -07:00
Dan Willemsen 66680c506a Remove HOST_OS==windows check
With the HOST_CROSS_OS build system change, LOCAL_MULTILIB := first now
behaves the same way.

Change-Id: I03294403e5a106a53d4a0d48b176434221284901
2015-09-04 14:05:19 -07:00
David Pursell 73096f2e1d adb: create shell protocol class.
Adds a new class ShellProtocol to help read and write data with
`adb shell`. This will allow splitting streams and sending out-of-band
data such as exit codes.

Nothing uses the new class yet except the unit tests.

Bug: http://b/23030641

Change-Id: Ieb02e127095c6dda25b7cb188a2e599173fd97e6
2015-09-04 11:30:11 -07:00
David Pursell a932058504 adb: refactor subprocess code.
Refactor shell_service.cpp to remove dependencies on service.cpp and
combine some common logic between PTY and raw subprocesses.

This will make it easier to add additional common code paths for
the upcoming shell protocol.

Change-Id: I497d30dd388de61b6e68d9086dce38f33dd92876
2015-09-04 11:18:51 -07:00
Tom Cherry 30c13c4954 Merge "move uncrypt from init.rc to uncrypt.rc" 2015-09-04 16:51:30 +00:00
Tom Cherry e8b0fcecf4 Merge "combine adbd.rc with init.usb.rc" 2015-09-04 16:50:46 +00:00
David Pursell 80f67029e0 adb: move shell service to a separate file.
Upcoming changes to the shell will require significant additions to
the subprocess code, and it will be cleaner if it's in a separate file.

The only functional change here is a new debug tag specifically for
the shell service. Everything else has been copied exactly as-is in
order to make it easier to determine what's changing in upcoming CLs.

Change-Id: I13bd4294059051ee10e0d0c6a06affd8eca62967
2015-09-04 08:52:35 -07:00
Mark Salyzyn 0df400ec11 Merge "logd: worst uid record watermark part four" 2015-09-04 14:14:02 +00:00
Mark Salyzyn 831aa29730 logd: worst uid record watermark part four
With part deux we caused an apparent regression by not checking for
stale recorded iterators. This checking was on-purpose bypassesed
when leading prune entries were to be deleted without touching the
statistics engine due to an in-place merge.

Part deux had us leaving iterators we were not focussed on untouched
which in turn because they were left behind, had a much higher
likelihood of being deleted without touching the statistics engine.

Perform the check every delete.

Bug: 23789348
Change-Id: Idc6cc23d1f9e3b6cd9a083139a0de59479fbfe08
2015-09-03 17:13:45 -07:00
Tom Cherry 008eb9b80a move uncrypt from init.rc to uncrypt.rc
Move uncrypt from /init.rc to /system/etc/init/uncrypt.rc using the
LOCAL_INIT_RC mechanism

Bug 23186545

Change-Id: Ibd838dd1d250c0e6536e44b69f11fb5ed42ba10b
2015-09-03 16:33:08 -07:00
Tom Cherry 2270dbbc84 combine adbd.rc with init.usb.rc
init.usb.rc and adbd.rc contain similar contents and belong in the same
file.

This file also belongs on the ramdisk as adbd is on the ramdisk, not the
system partition, therefore resolving to keep init.usb.rc in its current
location and combining the contents of adbd.rc is the best approach

Change-Id: I430f8fea58694679e7b8b7be69ce87daadd616f4
2015-09-03 16:19:04 -07:00
Tom Cherry b499834121 Merge "move init.trace.rc to frameworks/native" 2015-09-03 21:52:44 +00:00
Elliott Hughes 478da6374b Merge "Improve adb sync_send error reporting." 2015-09-03 21:25:13 +00:00
Tom Cherry b0d5184774 move init.trace.rc to frameworks/native
init.trace.rc will be renamed to atrace.rc and use the LOCAL_INIT_RC
mechanism to be included on /system appropriately.

Bug 23186545

Change-Id: I55c37d3ff98c9ac10e6c1a713fadc7eb37346195
2015-09-03 14:19:11 -07:00
Christopher Ferris 825477ff6b Merge "Add a logging handler on timeout." 2015-09-03 21:18:23 +00:00
Elliott Hughes ce98fc40fd Merge "Lose ls to toybox." 2015-09-03 20:58:58 +00:00
Elliott Hughes 081696d27c Improve adb sync_send error reporting.
Bug: http://b/23786900
Change-Id: I71f10de8d767eaf8bf0f5d9b8c304527e2b953ff
2015-09-03 13:55:55 -07:00
Christopher Ferris d7226f9a14 Add a logging handler on timeout.
If the signal handler doesn't fire in the given time when trying to unwind
a thread, put on a logging handler. This prevents crashes if the signal
does eventually fire.

Bug: 23783762
Change-Id: Ib7abb36b71d079a7043117697c41b535319586fd
2015-09-03 12:27:57 -07:00
Bill Yi cb6cd44d56 Merge "Revert "metricsd: Collect generic stats about the system."" 2015-09-03 19:27:16 +00:00
Bill Yi 6d5822ed7b Revert "metricsd: Collect generic stats about the system."
This reverts commit 90b02cd46d.

Change-Id: I9950c688433e99b0bc4745f02e2f9ae66f3b5578
2015-09-03 19:18:56 +00:00
Yabin Cui 6562c1513b Merge "adb: clean up debug tracing a little." 2015-09-03 17:32:44 +00:00
Bertrand Simonnet 9cd816b33d Merge "metricsd: Log the histogram name to hash mapping." 2015-09-03 17:29:22 +00:00
Bertrand Simonnet c18624799b Merge "metricsd: Collect generic stats about the system." 2015-09-03 17:28:52 +00:00
Jorge Lucangeli Obes 66d32c7488 Merge "Use CAP_MASK_LONG for file capabilities." 2015-09-03 15:48:01 +00:00
Elliott Hughes c5d278d48e Merge "metricsd: Remove unused constant." 2015-09-03 04:13:27 +00:00
Bertrand SIMONNET 73f4355433 metricsd: Remove unused constant.
Change-Id: Id151c4a7a091ee9cb07fa7c6188d162cf342d70e
2015-09-02 20:49:38 -07:00
Yabin Cui 7a3f8d6691 adb: clean up debug tracing a little.
Always use LOG() for debug tracing.
Remove useless D_lock. I believe it is useless to lock just before and after fprintf.

I verified the log output both on host and on device. The output looks fine to me.

Change-Id: I96ccfe408ff56864361551afe9ad464d197ae104
2015-09-02 20:21:00 -07:00
Dan Willemsen bfe322285f Merge "Remove USE_MINGW/CYGWIN; Whitelist windows modules" 2015-09-03 00:32:09 +00:00
Jorge Lucangeli Obes e920c46e7d Use CAP_MASK_LONG for file capabilities.
Extract the |1ULL << $CAP_NAME| construct to a macro, to avoid
repeating it.

Change-Id: I9312c27130d7e6c5b6ab3b4cc5c70a6b98378b98
2015-09-02 17:18:44 -07:00
Dan Willemsen 87a419c8b1 Remove USE_MINGW/CYGWIN; Whitelist windows modules
CYGWIN is not supported, USE_MINGW and HOST_OS==windows are being
replaced with LOCAL_..._windows variables.

Bug: 23566667
Change-Id: I3e4a1e4097dc994cf5abdce6939e83a91758fd75
2015-09-02 17:10:35 -07:00
Bertrand SIMONNET 8835c5b56e metricsd: Log the histogram name to hash mapping.
When running the metrics_daemon in verbose mode, log the histogram name
along with the hash name.
This is useful when debugging as the protobuf message only contains the
hash of the name.

Change-Id: Ifea7edce55d62d30994ec7b75bb8728f6a0c40e8
2015-09-02 15:07:10 -07:00
Bertrand SIMONNET 90b02cd46d metricsd: Collect generic stats about the system.
Collect memory usage and disk IO statistics periodically.

BUG: 22953719

Change-Id: I2e35d4800ddc684284969e6a58a6f50497086b69
2015-09-02 15:04:26 -07:00
Steve Fung 03bbd64aa9 Merge "crash_reporter: Call dbus-send using chromeos::ProcessImpl" 2015-09-02 21:33:29 +00:00
Bertrand Simonnet ad55064594 Merge "metricsd: Fix style issues." 2015-09-02 21:28:11 +00:00
Bertrand Simonnet 74f6f8c323 Merge "metricsd: Make the unit tests pass." 2015-09-02 21:26:40 +00:00
Bertrand SIMONNET 675a10c3d9 metricsd: Fix style issues.
This CL:
* removes dead code.
* converts constants static fields into proper constants.
* converts to C++/libchrome some of the parsing logic.

BUG: 22953719

Change-Id: Ief01178c6c268f8ae3690ad9deef42cfb43b2b75
2015-09-02 13:30:54 -07:00
Bertrand SIMONNET 1253186728 metricsd: Make the unit tests pass.
This cleans up the unit tests and update them to pass.

Cleaned up:
* removed the irrelevant bits.
* Used ScopedTempDir for all test specific files (instead of the current
  directory).
* Update some objects to make them more easily testable.
* Group all the test in a single binary and use bionic's test runner.

BUG: 23682444
Change-Id: I289e3a5ff89968fdecd4a156e93bc38bbc25f58b
2015-09-02 13:30:48 -07:00
Steve Fung 6e68dd72c7 crash_reporter: Call dbus-send using chromeos::ProcessImpl
Convert the call to dbus-send from system() to chromeos::ProcessImpl
so that the shell_exec selinux policy can be removed.

Bug: 23280203
Change-Id: I692ebecf5b7f0611de252225cedabcdefd56dff8
2015-09-02 12:29:22 -07:00
Tom Cherry 4aa9dbab6f Merge "init: Update readme.txt to reflect recent changes to init." 2015-09-02 19:28:00 +00:00
Yasuhiro Matsuda 7b0bdec4b2 Merge "Add a tag for tracing system server." 2015-09-02 12:54:23 +00:00
Tom Cherry 3be66edc59 init: Update readme.txt to reflect recent changes to init.
Updates are as follows:

A detailed explanation of event triggers and property triggers
including how they can now be used

A new section describing .rc files, their locations, and the
intentions for each of these locations

A new section describing the import keyword and how it is not a
command but rather its own section

Removal of deprecated or incorrect text

Change-Id: If0a37375ac92a857900f3303ada4ba742360daff
2015-09-01 15:32:33 -07:00
Elliott Hughes 5d80400605 Merge "adb/base win32 tests: fix comment and open() flags" 2015-09-01 22:03:41 +00:00
Spencer Low 2fbeb0cc71 adb/base win32 tests: fix comment and open() flags
Match base's use of O_BINARY.

Change-Id: I930b5c8fddde20966580069f2e681b99cb26f1a3
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-09-01 14:57:58 -07:00
Tom Cherry 54c70ca156 Merge "init: Use classes for parsing and clean up memory allocations" 2015-09-01 21:35:45 +00:00
Elliott Hughes 78ea165ea2 Merge "Use O_BINARY in base/file for Windows." 2015-09-01 21:13:33 +00:00
Elliott Hughes 470d79a09c Use O_BINARY in base/file for Windows.
This matches the behavior of the google3/Chrome APIs. It's probably what you
want in all cases except where you plan on calling Split(content, "\n"), but
we should probably have something like simpleperf's LineReader for that
anyway.

Change-Id: I1a128ed8c328bc95b0b2ef4068a65a8562721418
2015-09-01 13:35:44 -07:00
Tom Cherry b7349902a9 init: Use classes for parsing and clean up memory allocations
Create a Parser class that uses multiple SectionParser interfaces to
handle parsing the different sections of an init rc.

Create an ActionParser and ServiceParser that implement SectionParser
and parse the sections corresponding to Action and Service
classes.

Remove the legacy keyword structure and replace it with std::map's
that map keyword -> (minimum args, maximum args, function pointer) for
Commands and Service Options.

Create an ImportParser that implements SectionParser and handles the
import 'section'.

Clean up the unsafe memory handling of the Action class by using
std::unique_ptr.

Change-Id: Ic5ea5510cb956dbc3f78745a35096ca7d6da7085
2015-09-01 12:26:02 -07:00
Daniel Rosenberg 7c4ed6af79 Merge "fs_mgr: Add support for A/B partitions" 2015-09-01 19:24:09 +00:00
Yabin Cui 2ae47a0b54 Merge "adb: add unit test for fdevent." 2015-08-31 22:40:04 +00:00
Daniel Rosenberg 8bb2f36abd fs_mgr: Add support for A/B partitions
Allow partitions to be marked as A/B partitions
using the slotselect flag in fstab. The partitions
can be identified by appending the correct suffix
to the block device listed in the fstab. The suffix
is provided by the bootloader through a command line
parameter or the device tree, and can be found in
ro.boot.slot_suffix or read from the boot_control HAL.

Change-Id: I6846d80e857f95bfb8f282f4ab81167394613bbe
Signed-off-by: Daniel Rosenberg <drosen@google.com>
2015-08-31 15:18:05 -07:00