Commit graph

26746 commits

Author SHA1 Message Date
Treehugger Robot
a95e9aff7c Merge "Remove obsolete __BRILLO__ ifdef." 2016-12-14 19:14:08 +00:00
Daniel Friederich
b644134858 adb: fix adb trace tag
The ADB trace enum value collided with the 0 values used to mean all, hence it
was not possible to just trace the ADB tagged messages without also tracing everything else.

Change-Id: I15ff9c50c4ac01806c4841cf8213ce859faf130b
Test: Manually by setting ADB_TRACE and running adb, e.g. "ADB_TRACE=adb adb shell ls"
2016-12-14 12:41:43 -06:00
Jorge Lucangeli Obes
405da69b27 Remove obsolete __BRILLO__ ifdef.
Confirmed with Brillo TL this is not needed.

Bug: 33620501
Test: Builds, boots on HiKey.
Change-Id: I8d6b7cc2a94e668d63421c456d38fe23877c3cf0
2016-12-14 13:25:25 -05:00
Treehugger Robot
5d0f40f7c5 Merge changes Ic190bd8c,I865044c8
* changes:
  Convert missed ERROR() to LOG(ERROR).
  Fix include order.
2016-12-14 17:36:25 +00:00
Treehugger Robot
f03e6c8037 Merge "Set mmap_rnd_bits to maximum value." 2016-12-14 16:40:04 +00:00
dcashman
41d0b6d3ca Convert missed ERROR() to LOG(ERROR).
commit: f86b5a6b90 converted init to
libbase logging, but the internal resolution, commit:
4dc40842ba missed one.  Convert it.

Test: builds.
Change-Id: Ic190bd8ce232de0acadd980a349de95fa8aed8ad
2016-12-14 08:38:23 -08:00
Elliott Hughes
99dae54874 Fix include order.
(cherry-pick of commit: 79f2b33594)

Test: builds
Change-Id: I865044c8c54591582e7bb1b7a055cf7ba2f17464
2016-12-14 08:16:07 -08:00
Daniel Cashman
baccc40841 Set mmap_rnd_bits to maximum value.
This is a cherry-pick of internal commit:
f611291688 which was a revert of a
revert, specifically a  revert of commit:
c8f026fc9c.

The above revert was meant only for AOSP, since the kernel prebuilts
were not yet available there.  The revert was reverted internally so
that internal builds, which have the appropriate kernel prebuilts,
operated properly.

The very first commit was originally done in nougat-dev and cherry-picked
to AOSP, so it was not picked up again when nougat landed in master.  Add
it now.

Bug: 27681085
Test: Builds and boots.
Change-Id: If1cb6308e61aaaabca5b5bd30df78aab49e7b0d5
2016-12-14 07:48:36 -08:00
Treehugger Robot
d619026c07 Merge "Fix checks for reading and writing FuseMessage." 2016-12-14 07:48:21 +00:00
Stephen Hines
2bdb37190c Merge "Switch to memcpy for accessing misaligned data." 2016-12-14 02:51:35 +00:00
Treehugger Robot
78b5f01051 Merge "liblog: clean up SafetyNet unit tests" 2016-12-14 02:23:37 +00:00
Josh Gao
963d95d188 Merge "adb: add script to trace adbd." 2016-12-14 01:06:55 +00:00
Elliott Hughes
e801a68239 Revert "Revert "android_ids: move to bionic""
This reverts commit 7b7a8074e1.

Change-Id: Icdc7221af6745084e5a4a28d851d3ad14e2a4ece
2016-12-13 23:47:16 +00:00
Christopher Ferris
0c0f042736 Merge "Update for kernel headers v4.8.14." 2016-12-13 23:40:01 +00:00
Josh Gao
52df920fd6 adb: add script to trace adbd.
Bug: http://b/31289465
Test: sh trace.sh
Change-Id: Id6e20e83742541aec6bfd9f4112adbdadc078f74
2016-12-13 14:31:17 -08:00
Mark Salyzyn
a91b426268 liblog: clean up SafetyNet unit tests
Move active code into helpers.

Test: gTest liblog-unit-tests
Change-Id: I5ade96edd71b7d773386f4d99eddbad076d10405
2016-12-13 13:47:48 -08:00
Jeff Sharkey
dff44709cf Define range of GIDs for cached app data.
To support upcoming disk usage calculation optimizations, this change
creates a new GID for each app that will be used to mark its cached
data.  We're allocating these unique GIDs so that we can use
quotactl() to track cached data on a per-app basis.

This change also tightens up the implementation of both the cache
and shared GID calculation to ensure that they stay inside the valid
ranges, and includes tests to verify.

Test: builds, boots, tests pass
Bug: 27948817
Change-Id: Ie4377e5aae267f2da39a165888139228995987cb
2016-12-13 13:28:08 -07:00
Treehugger Robot
2361ab0d31 Merge "adb: retry install_listener for a while." 2016-12-13 04:01:54 +00:00
Christopher Ferris
1514bb4f2f Update for kernel headers v4.8.14.
Update sync.c to include the structurs from sw_sync.h. This uapi
header has been deleted.

Test: Built mips/arm/arm64/x86/x86_64. Built and booted angler.
Change-Id: I2495cb17b35f697fb8a2a00f6633ccb53f78293f
2016-12-12 18:59:42 -08:00
Josh Gao
f0f854bc76 adb: retry install_listener for a while.
install_listener can fail if we told a previous adb server to quit and
it hasn't finished doing so yet. Retry it for a few hundred
milliseconds to avoid this.

Bug: http://b/28618716
Test: nc -l 5037; adb server nodaemon
Change-Id: Ibbda8f2718b85a2b6a08985aa8d29aa2204a3ead
2016-12-12 18:20:57 -08:00
Josh Gao
aac1145a5b adb: remove extraneous stat in sync_recv.
We do a remote stat to get the file's size before pulling in sync_recv,
but all of the callers to sync_recv have already done a stat. Pass the
expected file size into sync_recv to remove its stat.

Bug: http://b/31289465
Test: python test_device.py
Change-Id: I7ca8ed11c6134e5954acac86626f880ade3ec696
2016-12-12 16:47:34 -08:00
Treehugger Robot
b0a15d8319 Merge "Revert "android_ids: move to bionic"" 2016-12-13 00:31:26 +00:00
Josh Gao
8e7c782eaa Merge changes from topic 'adb_trace'
* changes:
  adb: add tracing to transport.cpp.
  adb: clang-format transport.cpp
  adb: add tracing to file_sync_service.cpp.
  cutils: add adb trace tag.
  libutils: allow multiple ATRACE_NAMEs in a scope.
2016-12-13 00:28:09 +00:00
Elliott Hughes
7b7a8074e1 Revert "android_ids: move to bionic"
This reverts commit bc56847e84.

Change-Id: I2d00db0aaa7dfe292e36c6bdbaaa76230849e732
2016-12-12 22:11:29 +00:00
Josh Gao
cfe72e290b adb: add tracing to transport.cpp.
Bug: http://b/31289465
Test: systrace
Change-Id: I41968f447b61ef1eea2b933a5fd8623605c4dea6
2016-12-12 12:28:45 -08:00
Josh Gao
1290fbf5eb adb: clang-format transport.cpp
Bug: http://b/31289465
Test: none
Change-Id: If99a9f1d4d6fa1d34b0ac3bbfc7f2e6bfc188ff2
2016-12-12 12:28:45 -08:00
Josh Gao
fd12aaa8c1 adb: add tracing to file_sync_service.cpp.
Bug: http://b/31289465
Test: systrace
Change-Id: I186675ca0310ace0e1d35561fa0b910417dcedd7
2016-12-12 12:28:45 -08:00
Josh Gao
e2d9732682 cutils: add adb trace tag.
Bug: http://b/31289465
Test: systrace
Change-Id: I8537731febc6629f055b86f6e19b16104208c4f8
2016-12-12 12:28:45 -08:00
Josh Gao
01937ee2b9 libutils: allow multiple ATRACE_NAMEs in a scope.
Bug: http://b/31289465
Test: m
Change-Id: Iabd97439fa55ea285ce0501dbb4fd9d07149ae61
2016-12-12 12:28:04 -08:00
Daichi Hirono
cb9153bf43 Support SOCK_STREAM for bridge between system and app
Previously AppFuse use SOCK_SEQPACKET for sockets communicating system
and app. However SOCK_SEQPACKET requires the buffer of message size in
the kernel and sometimes failed to write with ENOBUF.

The CL updates libappfuse so that it can use SOCK_STREAM instead of
SOCK_SEQPACKET.

Bug: 33279206
Test: libappfuse_test
Change-Id: I622ada9ac1d71d0c57b6cfff0904c7829cea7995
2016-12-12 14:53:03 +09:00
Daichi Hirono
a6373ec1d4 Fix checks for reading and writing FuseMessage.
Previously FuseMessage were checking result of read/write operation
after checking header.len value is valid. This was wrong because
header.len does not contain correct value when read function does not
read any bytes and returns zero.

Bug: 33278098
Test: libappfuse_test
Change-Id: Icf998ca6c3eeee20cbc4aa2f65195a87e59ffc27
2016-12-12 14:34:29 +09:00
Treehugger Robot
4173d9b57c Merge "init/service.cpp: fix FD leak for services with consoles" 2016-12-10 22:07:27 +00:00
Nick Kralevich
9596d2b95d init/service.cpp: fix FD leak for services with consoles
When init starts a service with a console, it tests for the presence of
a readable/writable console device. The test results in a leaked file
descriptor.

Use access() instead of open() to avoid leaking file descriptors.

Bug introduced in 70daa67062.

Test: compiles and device boots
Change-Id: I4efcfa0bb2cdb09f0455bc04a3a91e784bda7962
2016-12-10 12:20:11 -08:00
Elliott Hughes
b0aa8b2369 Merge changes from topic 'fsconfig-2'
* changes:
  fs_config: add comment to header
  android_ids: move to bionic
2016-12-10 00:13:05 +00:00
Mark Salyzyn
0f8890d985 Merge "utils: Add FastStrcmp.h" 2016-12-09 23:37:15 +00:00
Sandeep Patil
5fee496e62 socket: uevent: use SO_RCVBUF instead of SO_RCVBUFFORCE
The SO_RCVBUFFORCE option requires the caller of uevent_create_socket()
to have net_admin capabilities.

Set platform default rcv/snd buffer sizes to 256kb that will always be
overridden by the device/target. However, it will allow
ueventd / healthd to use the uevent_create_socket() API w/o requiring
the net_admin capability.

Note: All devices override the buffer sizes according to the technology
maximum to at least ~8MB. So, the init.rc change here is to make sure
platform code can work w/o any overrides.

Test: no SELinux failures for healthd with 'net_admin' removed.

Bug: https://b/32733887

Change-Id: Ida346468cd550ad07901bf3a78ad508939849906
Signed-off-by: Sandeep Patil <sspatil@google.com>
2016-12-09 15:16:28 -08:00
Mark Salyzyn
0eeb06b932 utils: Add FastStrcmp.h
Move existing fast<str*cmp> templates for general use, pulled from
the implementation used in logd that dealt with speed through cache
locality and subroutine call mitigation.  Rename to fastcmp.

Test: logd-benchmarks and based on manual profiling from the past
Bug: 31456426
Change-Id: Ic62f4a437fc3e06ffdeaae73a6f34e197957a6b0
2016-12-09 12:40:17 -08:00
Elliott Hughes
a3641af22f Improve init bootcharting.
Most notably, there's no longer any need to guess an end time.

Bug: http://b/23478578
Bug: http://b/33450491
Test: rebooted with bootcharting on/off
Change-Id: Icb7d6859581da5526d77dfc5aa4d57c9bfbfd7e2
2016-12-08 17:35:45 -08:00
William Roberts
bc56847e84 android_ids: move to bionic
Prevent others from using android_ids and force them
to use grp.h and pwd.h family of functions.

Test: Build and boot, verify services are running properly.
Bug: 27999086

Change-Id: Idcd75cf7e91a49ef07a0ed3bdb514ad61aa82e69
Signed-off-by: William Roberts <william.c.roberts@intel.com>
2016-12-08 16:57:17 -08:00
William Roberts
acdf527c52 fs_config: add comment to header
Add a comment to android_filesystem_config.h
about AID and OEM Range "scraping" done by
build/tools/fs_config.

Test: Build and boot.

Change-Id: I2d4845d91546ae967a1ee5166b73d119938faccc
Signed-off-by: William Roberts <william.c.roberts@intel.com>
2016-12-08 16:57:17 -08:00
Yabin Cui
aece425166 Merge "libbacktrace_offline: support .ARM.exidx." 2016-12-07 20:34:32 +00:00
Yabin Cui
5d991bc351 libbacktrace_offline: support .ARM.exidx.
1. Read .ARM.exidx and .ARM.extab, provides these data to libunwind
through AccessMem.
2. In FindProcInfo, search .ARM.exidx for the idx entry of function
containing ip.
3. Add structures to store .ARM.exidx info in DebugFrameInfo, and
clean up the structure.
4. Add tests to test each unwind information (.eh_frame, .debug_frame,
.gnu_debugdata, .ARM.exidx) separately.

Bug: http://b/30974693
Test: run backtrace_test.
Test: run simpleperf runtest.py.
Change-Id: I9377a54379158bd35860efcf0e011423be7350d4
2016-12-07 10:25:33 -08:00
Stephen Hines
b0775ca517 Switch to memcpy for accessing misaligned data.
Bug: http://b/31532493

Using misaligned pointers forces us to potentially take the address of
members in a packed structure (which is now a warning/error in the
latest Clang). Using memcpy() is the proper way to handle this kind of
problem, as the compiler can insert the proper instructions (and usually
elide the memcpy() entirely).

Test: Built correctly with updated compilers.
Change-Id: Ia1f6eb62cf19404ff76b71d3c6c7ffffa1403120
2016-12-07 03:46:55 -08:00
Bill Yi
a794775592 Merge remote-tracking branch 'goog/stage-aosp-master' into HEAD 2016-12-06 15:07:48 -08:00
Josh Gao
3a7637715e Merge changes I1a122235,I6b22ead8
* changes:
  Revert "Revert "adb: extend sync protocol's stat support.""
  Revert "Revert "adb: move adb_strerror to sysdeps/win32/errno.cpp.""
2016-12-06 22:41:40 +00:00
Elliott Hughes
422a5128dd Merge "The "net.change" property is no longer needed."
am: e209ed7c44

Change-Id: I45a1ce3a1527a72e7ae974fd4dab7b77c6a899ee
2016-12-06 02:49:59 +00:00
Treehugger Robot
e209ed7c44 Merge "The "net.change" property is no longer needed." 2016-12-06 02:46:43 +00:00
Josh Gao
5a1e3fdaf8 Revert "Revert "adb: extend sync protocol's stat support.""
This reverts commit afa4b5d6eb.

Add functions to translate errno to and from the linux asm-generic
values, since mips has different values.

Bug: http://b/33058958
Test: python test_device.py with both old and new adbd
Change-Id: I1a122235f3e793ed10b3bf3ad293388015134150
2016-12-05 17:38:30 -08:00
Josh Gao
a3577e1ac5 Revert "Revert "adb: move adb_strerror to sysdeps/win32/errno.cpp.""
This reverts commit 43c02b27cd.

Test: mma
Change-Id: I6b22ead8a4b964973ee2fdb8deba42bea74880cf
2016-12-05 17:38:30 -08:00
Mark Salyzyn
1f22788f9e Merge "init: service file command only opens existing files"
am: bd3f42016d

Change-Id: Id4c0e6b26e8b3295ebfd5387bfad2e8795531175
2016-12-05 21:37:38 +00:00