Commit graph

38841 commits

Author SHA1 Message Date
Treehugger Robot
680bc0b6b5 Merge "init: add keychords_test" 2018-05-30 17:27:35 +00:00
Treehugger Robot
e6a878644c Merge "init: switch out keychord id with std::vector match of chords" 2018-05-30 16:12:36 +00:00
Mark Salyzyn
75b901d4a8 init: add keychords_test
Test: init_tests --gtest_filter=keychords.*
Bug: 64114943
Change-Id: I357d0c1bd56660ac28bc02b76d5632ef1b9328b7
2018-05-30 08:38:11 -07:00
Treehugger Robot
dfc4ad2a9c Merge "init; remove dead cruft." 2018-05-30 01:49:29 +00:00
Elliott Hughes
b0aba0fff9 init; remove dead cruft.
Bug: N/A
Test: builds
Change-Id: Ia38ef6959e8615b4f103b924ae51c19f916daa48
2018-05-29 17:05:56 -07:00
Elliott Hughes
d580c441ab Merge "libbase: add host properties support." 2018-05-29 23:59:50 +00:00
Treehugger Robot
420fe5fe90 Merge "init: turn keychords into a standalone class" 2018-05-29 23:10:25 +00:00
Treehugger Robot
16dd3582b7 Merge "init: refactor keychord for testing" 2018-05-29 23:03:43 +00:00
Mark Salyzyn
1385725e09 init: switch out keychord id with std::vector match of chords
Drop all references to keychord_id and id and instead use keycodes_
as the id.  The keycodes are a std::vector<int> with an unique
sorted-order emplacement method added in the parser.  Solves the
academic issue with duplicate keychords and trigger all services
that match rather than first match only.

Test: init_tests
Bug: 64114943
Change-Id: I5582779d81458fda393004c551c0d3c03d9471e0
2018-05-29 15:18:38 -07:00
Mark Salyzyn
06aeb41c16 init: turn keychords into a standalone class
Test: init_tests
Bug: 64114943
Change-Id: Ie760e4a3a661260ed2aabb8a92fe65fc93521cb5
2018-05-29 13:46:12 -07:00
Mark Salyzyn
eca2507634 init: refactor keychord for testing
Move things around so that keychords.cpp is independent of service
and init and can be individually tested with few dependencies.
Permits also rolling out the keychords as a class in a future commit.
Improve parser checking.

Test: init_tests
Bug: 64114943
Change-Id: I82570bc6269ed478db784ec38a8bc916da2be2be
2018-05-29 13:20:19 -07:00
Bernie Innocenti
0ad41cf3f4 SocketListener: use poll() instead of select()
FD_SET is limited to 1024 file descriptors in Linux, which causes
processes with too many open files or connections to crash:

  FORTIFY: FD_ISSET: file descriptor 1024 >= FD_SETSIZE 128

The fix we used elsewhere is replacing select() with poll(), but in the
case of SocketListener we additionally need to replace the SocketClient
list with a map indexed by fd in order to avoid quadratic behavior on
each poll() wakeup.

Bug: 79838856
Test: device boots and appears to work normally
Change-Id: I19ca4be675e9638104c0e7acf4a4bc62085e8ecd
2018-05-25 18:43:12 +09:00
Josh Gao
e82401e592 Merge "adb: really fix the mac build." 2018-05-25 05:59:58 +00:00
Josh Gao
6e1246c234 adb: really fix the mac build.
Test: changed `#if !defined(__APPLE__)` to `#if 0` and ran mma
Change-Id: I173cccbfb7bad348ac4796a2d6cebb8490f63479
2018-05-24 22:58:08 -07:00
Treehugger Robot
6c9bb058c5 Merge "Build adbd for recovery" 2018-05-25 05:58:01 +00:00
Elliott Hughes
f90137da60 Merge "Clarify 'fastboot flash' help." 2018-05-25 05:06:00 +00:00
Christopher Ferris
04b83d8ec2 Merge "Change tests to use a temporary dir for files." 2018-05-25 01:35:07 +00:00
Elliott Hughes
07fc6828a8 Clarify 'fastboot flash' help.
Bug: http://b/80206492
Test: `fastboot --help`
Change-Id: Idd4305628836eb0bcbcf3d217db0a9fc54a1d6d6
2018-05-24 18:30:58 -07:00
Elliott Hughes
dc80312628 libbase: add host properties support.
Move init and libprocessgroup away from their existing hacks.

Bug: N/A
Test: ran tests
Change-Id: Ifabdd38e0cc4ab2582f1ea59d32159d386f48eb6
2018-05-24 18:04:31 -07:00
Elliott Hughes
54be246a1f Merge "Make per-application memcg hierarchy configurable via a property" 2018-05-25 00:01:03 +00:00
Christopher Ferris
3acf577759 Change tests to use a temporary dir for files.
Avoid using hard-coded paths for generated files. This can cause problems
if the tests are run in parallel.

Also fix a potential race condition in the unwind_through_unreadable_elf_remote
test.

Test: Ran tests in parallel and normally.
Change-Id: Ib42522de49499766a29bda5bfffe737b56715e3f
2018-05-24 16:48:16 -07:00
Suren Baghdasaryan
bc131c3244 Make per-application memcg hierarchy configurable via a property
Introduce ro.config.per_app_memcg Android property to enable/disable
per-application memcg hierarchy.
On low-ram devices (ro.config.low_ram=true) ro.config.per_app_memcg
defaults to true, otherwise it defaults to false.

Bug: 80201565
Test: set ro.config.per_app_memcg=true and verify /proc/<app_pid>/cgroup
membership (memory:/apps/uid_xxx/pid_xxx)
Test: set ro.config.per_app_memcg=false and verify /proc/<app_pid>/cgroup
membership (memory:/)
Change-Id: Iabd3ef6c9c16c774b9da959a7f43b5f66df120a3
Merged-In: Iabd3ef6c9c16c774b9da959a7f43b5f66df120a3
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2018-05-24 15:13:00 -07:00
Treehugger Robot
6e92890135 Merge "Work around b/24465209, do not pack relocation table." 2018-05-24 19:07:26 +00:00
Christopher Ferris
a6a433a27d Merge "Add a specialized LocalUnwinder object." 2018-05-24 18:06:02 +00:00
Josh Gao
925b410c7f Merge "adb: fix mac build." 2018-05-24 17:34:41 +00:00
Chih-Hung Hsieh
462df10d91 Work around b/24465209, do not pack relocation table.
Global flag --pack-dyn-relocs=android is used with clang lld.
For b/24465209, we need to override that with pack_relocations:false.

Bug: 24465209
Bug: 80093890
Test: build with USE_CLANG_LLD=true and run dlext.compat_elf_hash_and_relocation_tables
Change-Id: I4edcdf49e184fa45ea2b6b6417654d81bcd09e1d
2018-05-24 09:34:54 -07:00
Tom Cherry
05063a8715 Merge "init: finer grained permissions for ctl. properties" 2018-05-24 16:28:24 +00:00
Josh Gao
99c27d3e99 adb: fix mac build.
Test: none
Change-Id: I93ff87338aa503588e36404f7566651e18f50292
2018-05-24 00:47:05 -07:00
Jiyong Park
a0e75045e6 Build adbd for recovery
adbd (and its dependencies) are marked as recovery_available:true so
that recovery version of the binary is built separately from the one for
system partition. This allows us to stop copying the system version to
the recovery partition and also opens up the way to enable shared
libraries in the recovery partition. Then we can also build adbd as a
dynamic executable.

Bug: 79146551
Test: m -j adbd.recovery
Change-Id: Ib95614c7435f9d0afc02a0c7d5ae1a94e439e32a
2018-05-24 14:11:11 +09:00
Treehugger Robot
39cab7cd25 Merge "Support product-specific libraries" 2018-05-24 03:04:48 +00:00
Christopher Ferris
ca9a54b2c0 Add a specialized LocalUnwinder object.
This object is for doing many local unwinds across different threads
at any point during a program's execution.

Also add LocalUpdatableMaps that will re-read the maps data under certain
circumstances.

This first version does not support jit or dex pc data.

Bug: 74361929

Test: Ran unit tests.
Change-Id: I790662366d3fed677f31b3288182950c494de9ad
2018-05-23 20:02:30 -07:00
Jesse Hall
798ba95bda sync: remove legacy sync info API
The legacy fence/pt info API has been deprecated for a while. This
change removes it from headers, so remaining users will have to switch
to the modern API when they're re-compiled. The functions are still
provided by libsync.so and tests remain, so existing binaries should
continue to work. Eventually these will be removed too, though, once
it's reasonable to expect those binaries to have been recompiled.

Bug: 35326015
Test: make checkbuild
Test: adb shell dumpsys SurfaceFlinger --latency
Change-Id: Id086fafe37c2bc1cfdca4a21107bc9208ed61f89
2018-05-23 16:45:48 -07:00
Jesse Hall
2576a439e6 Remove obsolete sync_test.c
Tests in this file depends on long out-of-date behavior of the sync
api. More current tests are in tests/sync_test.cpp.

Test: quis custodiet ipsos custodes?
Change-Id: Ia0a0970dde17c1ae4e1d79fac1a9fe3b54e8fcd6
2018-05-23 16:45:48 -07:00
Elliott Hughes
98c1b1ccf6 Merge "Add StdioLogger for command-line tools." 2018-05-23 23:38:55 +00:00
Treehugger Robot
e6a644bc35 Merge "Remove a redundant check in statsd socket code." 2018-05-23 23:07:24 +00:00
Josh Gao
3a38310476 Merge changes I9f36cc26,I06561ad0,I42c2a8d0
* changes:
  adb: add benchmark script.
  adb: add IOVector.
  Revert "Revert "adb: add support for O_CLOEXEC to unique_fd pipe wrapper.""
2018-05-23 22:39:48 +00:00
Treehugger Robot
2ed14f3923 Merge "Libunwindstack: Add -O0 to tools defaults on host" 2018-05-23 19:37:01 +00:00
Josh Gao
fd3fd937b1 adb: add benchmark script.
Test: ./benchmark_device.py
Change-Id: I9f36cc267b1cbef2d90a30009c87ccc2a8e21795
2018-05-23 11:26:04 -07:00
Josh Gao
7c738cdb53 adb: add IOVector.
An IOVector is a collection of immutable reference counted blocks which
can have its head detached at an arbitrary index. This is extremely
useful for implementing packet-framed protocols like adb on top of a
stream protocol like TCP: a stream reader can read blocks, append them
to the end of the IOVector, and then pull packets off of the front.
This also lends itself naturally towards scatter/gather I/O, which will
enable us to read data from disk and send it across the wire with a
theoretical minimum number of copies in USB, and one extra copy over
TCP.

Since this is basically a generalization of std::deque<Range>, delete
Range and replace its uses with IOVector.

Test: adb_test
Test: wine adb_test.exe
Change-Id: I06561ad0bb25a3a51b378b61d257b5b04b41d9c4
2018-05-23 11:26:04 -07:00
Josh Gao
9da1a9118b Revert "Revert "adb: add support for O_CLOEXEC to unique_fd pipe wrapper.""
Implement pipe2 ourselves on darwin.

This reverts commit f139ba47a1.

Test: none!
Change-Id: I42c2a8d07712fe4ac75b5824f754e79a5b9f5cb4
2018-05-23 11:14:57 -07:00
Chih-hung Hsieh
85bd9ca978 Merge "Work around b/24465209, do not use clang lld" 2018-05-23 17:17:14 +00:00
Chih-Hung Hsieh
0f975a2099 Work around b/24465209, do not use clang lld
See longer explanation in b/80093890.
Clang lld does not generate expected DT_REL and DT_RELA tags
with --hash-style=both and --pack-dyn-relocs=android.
I am not sure about the extent of b/24465209, so
I would rather not to use lld for these .so files for now.

Bug: 80093890
Bug: 24465209
Test: build with USE_CLANG_LLD=true and run dlext.compat_elf_hash_and_relocation_tables
Change-Id: I645dbe25c5b9975605e3af5e717ed36c276f14d4
2018-05-23 17:15:48 +00:00
Elliott Hughes
1be0d1481b Add StdioLogger for command-line tools.
Bug: N/A
Test: ran tests
Change-Id: If366a4ea25aea1becdd3e443eba225e9bd52ebba
2018-05-23 10:06:20 -07:00
Josh Gao
a2157a7d92 Merge "Revert "adb: add support for O_CLOEXEC to unique_fd pipe wrapper."" 2018-05-23 16:45:31 +00:00
Josh Gao
f139ba47a1 Revert "adb: add support for O_CLOEXEC to unique_fd pipe wrapper."
This reverts commit 948b3e1068.

Reason for revert: mac doesn't have pipe2

Change-Id: Id6a517bb500cbea602839f06452bc5e6d92289f1
2018-05-23 16:44:53 +00:00
Christopher Ferris
ad707b0222 Merge "Fix error messages handling." 2018-05-23 00:33:07 +00:00
Treehugger Robot
812a6b77c6 Merge "adb: add support for O_CLOEXEC to unique_fd pipe wrapper." 2018-05-23 00:17:32 +00:00
Josh Gao
7a223584c5 Merge changes I465804fd,Ib5a684bb,If5e66570,I8471cc00,I8ba0a70a
* changes:
  adb: convert fdevent over to unique_fd.
  adb: move towards using unique_fd.
  adb: delete FDEVENT_DONTCLOSE.
  adb: remove fdevent_install, fdevent_remove.
  adb: fix uninitialized variable in AsyncServiceRef.
2018-05-23 00:01:29 +00:00
Yao Chen
4d1deed139 Remove a redundant check in statsd socket code.
The original liblog code has this additional check because there may be multiple writers registered,
there is a for-loop and the retVal is set to be the FIRST error. Statsd doesn't need it because it
 only has one writer.

Test: locally tested.
Change-Id: I03f0015d0c29eba19eb2b5ea145380cb98fb2509
2018-05-22 16:06:21 -07:00
Treehugger Robot
2a1c0dd6df Merge "Simplify code" 2018-05-22 22:44:56 +00:00