Commit graph

18873 commits

Author SHA1 Message Date
Mark Salyzyn
31ca3c3770 liblog: build break
Some compilers erroneously see uninitialized use, even despite all
accesses being behind !not_locked. Confirmed initialization does not
affect expected performance.

Bug: 26178938
Bug: 26029733
Bug: 17760225
Change-Id: Ib36ed8dd2c4b196ca84ef79a9531625dcee77e15
2015-12-22 10:49:35 -08:00
Mark Salyzyn
6cc75a68bd Merge "logd: Allow flags "eng" and "svelte" in boolean" 2015-12-22 18:12:57 +00:00
Mark Salyzyn
2427d34152 Merge "liblog: is loggable is flaky" 2015-12-22 18:12:15 +00:00
Mark Salyzyn
a67d8a53c7 liblog: is loggable is flaky
- Deal with __android_log_is_loggable inside signal handler by
  treating a lock contention system call as more costly than reading
  the associated property directly. Rather waiting around in a
  contended stat to hit cache.
- Check both the individual known __system_property_serial() and
  global __system_property_area_serial() to detect updates or
  additions to the properties to respond in the most aggressive and
  timely manner. __android_log_is_loggable() return at max CPU
  clockrate on a N9 in 61ns.
- Craft a common do_cache2 inline that adds the above to the other
  functions that utilize cache handling and preserves (within 3ns)
  performance in android_log_clockid() and __android_log_security().
  These functions return at max CPU clockrate on a N9 in 23ns.

Bug: 19544788
Bug: 25693940
Bug: 25792367
Bug: 26178938
Change-Id: I9cd94598f5c558e946b93977ad3714a4b03d0422
2015-12-22 10:06:22 -08:00
Mark Salyzyn
9c66a58f21 logd: Allow flags "eng" and "svelte" in boolean
- enhance property_get_bool, drop property_get_bool_svelte
- enhance base properties with ro and persist variants
- update and fortify README.property
- primarily move auditd and kernel logger into a realm where
  they can be controlled by build properties.
- Move logd.klogd to logd.kernel, and add ro.logd.kernel
  and persist.logd.kernel.
- Add ro.logd.auditd and persist.logd.auditd.
- Document persist.logd.security
- Document log.tag and persist.logd.tag properties.
- Document ro.logd.size, persist.logd.size and logd.size
  properties.

Bug: 26178938
Bug: 26029733
Bug: 17760225
Change-Id: Ibc1a497e45d69db5cf52133937f7ba6fb1d6cd21
2015-12-22 07:44:31 -08:00
Dimitry Ivanov
8a1b764db9 Merge "Add parameter for shared namespaces" 2015-12-21 23:10:49 +00:00
Dimitry Ivanov
d2a6220001 Add parameter for shared namespaces
Shared namespaces are used for bundled app classloaders.

Bug: http://b/22548808
Bug: http://b/26165097
Change-Id: I163033f70c50ef9ddb4164676c033ab30748964e
(cherry picked from commit ef4639c1a5)
2015-12-19 23:38:28 -08:00
Elliott Hughes
0e6a23c7d5 Merge "Give adb a proper progress bar." 2015-12-19 17:15:42 +00:00
Nick Kralevich
920d637d25 Merge "more O_CLOEXEC" 2015-12-19 06:59:11 +00:00
Nick Kralevich
c68c8862f9 more O_CLOEXEC
Change-Id: I330aef8d6f1fc35d6649995ef312954b84dff555
2015-12-18 20:57:25 -08:00
Mark Salyzyn
af9daf4524 Merge "liblog: test: instrument is_loggable failures" 2015-12-18 23:21:33 +00:00
Mark Salyzyn
77c166b5dd liblog: test: instrument is_loggable failures
Bug: 25792367
Change-Id: Ia34f8e7ea0bd7f15bf705afd3a1c631a56d1c479
2015-12-18 15:17:51 -08:00
Elliott Hughes
a00e6ef1ff Give adb a proper progress bar.
This factors out the duplication in the single-file progress, and adds a
whole-sync progress percentage to the front of the line. A number that's
both more interesting and easier to read.

This also fixes the >100 percentage reporting for files of unknown size.

Bug: http://b/26189482
Change-Id: I51501ccef6ae1f52425db0eb0862d87e90947a6c
2015-12-18 14:43:31 -08:00
Tao Bao
a2f1e65d13 Merge "healthd: Track the API change of res_create_multi_display_surface()." 2015-12-18 22:20:32 +00:00
Jorge Lucangeli Obes
c57c622e76 Merge "Add audioserver UID." 2015-12-18 22:00:59 +00:00
Jorge Lucangeli Obes
a3548a21ca Merge "New uid for extractor process" 2015-12-18 22:00:17 +00:00
Mark Salyzyn
f2e88777fb Merge "logd: statistics per-pid filter" 2015-12-18 21:26:16 +00:00
Mark Salyzyn
ee3b838e13 logd: statistics per-pid filter
Primarily gives access to the Chattiest TIDs and TAGs
associated with a pid.

Has a secondary effect of allowing us to pull out the
command line, comm and in some cases the associated
PACKAGE for a specific pid while the logs are still
present even if the executable is gone.

Bug: 26029733
Bug: 21615139
Change-Id: I1ea63165a680a9318360579b70b1512078ed5682
2015-12-18 13:17:37 -08:00
Jorge Lucangeli Obes
37211e1f3d Add audioserver UID.
(Originally in
https://googleplex-android-review.git.corp.google.com/#/c/804752).

Change-Id: I31951cad1bbcec58b21559be0d86581ba9187a92
2015-12-18 13:06:34 -08:00
Mark Salyzyn
5d8742feb6 Merge "liblog: test: pmsg overhead measurement" 2015-12-18 20:34:55 +00:00
Marco Nelissen
51544cc778 New uid for extractor process
Change-Id: I462d4736e772da0a08b4793fc1b971ff261667ea
2015-12-18 11:11:17 -08:00
Mark Salyzyn
1d51753461 Merge "liblog: Remove paranoia regarding logd" 2015-12-18 18:51:24 +00:00
Colin Cross
9df73b007a Merge "Turn off CRC checking for append2simg" 2015-12-18 18:47:30 +00:00
Mark Salyzyn
55c636a29f Merge "logcat: test: rotated logs can exceed size during crash" 2015-12-18 18:37:33 +00:00
Mark Salyzyn
fb9ff0e8ad Merge "logd: test drop __unused" 2015-12-18 18:36:47 +00:00
Mark Salyzyn
8beb0d3ad7 logcat: test: rotated logs can exceed size during crash
Some crash messages can be as large as 4K, so allow
the rotated logs to have a larger size.

Change-Id: I20ef8d526ad2d5eca128d1f99f4ea2d2da426403
2015-12-18 10:35:20 -08:00
Mark Salyzyn
7b4a2049b0 logd: test drop __unused
Change-Id: I1ccf49809b8a0a125601bdb52834c463e2d94165
2015-12-18 10:35:00 -08:00
Colin Cross
b5619d9630 Turn off CRC checking for append2simg
make_ext4fs doesn't write out a CRC chunk, and append2simg doesn't
either, but append2simg was still performing a CRC on every input
block.  Cuts append2simg time in half.

Change-Id: I678f807abbb741042461ed68a0f61b406d3665fb
2015-12-17 17:28:44 -08:00
Mark Salyzyn
236fecd923 Merge "logd: ro.config.low_ram set buffer size to 64K" 2015-12-17 23:47:14 +00:00
Elliott Hughes
82509e7925 Merge "adb host: add device state in "adb wait-for-*"" 2015-12-17 22:44:15 +00:00
Josh Gao
1ff73936a7 Merge "adb: extract USB FFS read/write limit constants." 2015-12-17 22:29:12 +00:00
Josh Gao
ae72b5aa4b adb: extract USB FFS read/write limit constants.
Change-Id: I5e9fb7959a1c4744cb8d53ece4634138239d4e49
2015-12-17 14:28:24 -08:00
Elliott Hughes
d361582dc0 Merge "Improve "adb install"'s error message slightly." 2015-12-17 22:17:38 +00:00
Elliott Hughes
fe01885c9b Improve "adb install"'s error message slightly.
We still don't really have a clue what went wrong, but "Failed to write"
made it sound like we did.

Change-Id: Ic58b13202e2d8ea6b095f7046db9d0771d77ce65
2015-12-17 14:04:38 -08:00
Jorge Lucangeli Obes
297a8381b5 Merge "adb: Use Minijail for privilege dropping." 2015-12-17 19:39:47 +00:00
Jorge Lucangeli Obes
683dc4817f adb: Use Minijail for privilege dropping.
By using Minijail we avoid writing the same priv-dropping code over
and over again. This also enables future hardening opportunities.
We're already using Minijail for priv-dropping on Brillo.

Minijail is unit- and integration-tested on the
Chrome OS CI infrastructure (pulling from the same repo, see
https://wmatrix.googleplex.com/security?tests=security_Minijail0).
Once CI comes to Android, it will be continuously tested there as well.

Both 'adb root' and 'adb unroot' still work.

Bug: 26099611
Change-Id: I52c456ea272d27bd6fbc71200f4fdd928a592158
2015-12-17 10:49:53 -08:00
Tom Cherry
64cc0825a6 Merge "Use selinux_android_setcon() instead of setcon()" 2015-12-17 17:54:05 +00:00
Leo Sartre
1fbc9dbd0f adb host: add device state in "adb wait-for-*"
The current implementation of the host commands "adb wait-for-*" allows
to specify only the transport layer (local, usb or any).
This patch allows the specification of the expected device state
(bootloader, recovery, device or sideload), this is usefull for
scripting purposes.

Use case:
$ adb reboot sideload-auto-reboot
$ adb wait-for-usb-sideload && adb sideload package.zip

Change-Id: I276a6be4d82f8b7901f74e1e5395b86d16548e8f
Signed-off-by: Leo Sartre <leox.sartre@intel.com>
2015-12-16 18:11:18 -08:00
Tom Cherry
38cd57a145 Use selinux_android_setcon() instead of setcon()
Bug 26114086

Change-Id: I02d20ee7a5f487fc73d7a33d50b0b8f1cd9ad3a4
2015-12-16 17:42:08 -08:00
David Pursell
b6dfab03b6 Merge "fastboot: implement UDP networking interface." 2015-12-17 00:27:06 +00:00
David Pursell
815c7beae7 fastboot: implement UDP networking interface.
This CL creates a UdpSocket class that provides a simple unified
interface to send and receive UDP packets for all platforms. Nothing
uses this interface yet except for tests.

The eventual goal is to implement a UDP protocol for fastboot, but it
makes the code much simpler and more modular if we handle the low-level
networking here independently of our custom fastboot protocol.

Some of the Windows code is similar to adb. I'd like to create a
library to hold the common functionality, but it is going to be a
little delicate to separate out the features unique to adb (e.g. the
custom file descriptor system), and I don't want to risk breaking
something in adb before the holiday break, so I'm hoping to get this in
for now and merge them early next year.

Tests are included in this CL to exercise this functionality using a
loopback connection.

Bug: http://b/26154763.
Tests: `fastboot_test` loopback tests on Linux, Mac, and Windows 7.
Change-Id: I81d1b7ace8d864246b99f6c80b8e29f64b8aa375
2015-12-16 16:16:08 -08:00
Nick Kralevich
a8d3fdf4c6 Merge "trace-dev.c: more O_CLOEXEC" 2015-12-16 21:40:32 +00:00
Mark Salyzyn
163ebdc7cd liblog: test: pmsg overhead measurement
This test tells us that scatter-gather (writev instead of write)
carries a small ~2% penalty. Unaligned buffer carry a similar
additional penalty. On N9 it takes 3us to 22us _just_ to write
the pmsg logs, depending on size. Some assumptions about the
socket read and write performance for the main logging can be made
from tracking these results and should improve design decisions.

Bug: 18771697
Bug: 23685592
Change-Id: Id4d64c449140e4f39078c62b0097e403df91fe0c
2015-12-16 13:12:56 -08:00
Josh Gao
56d7d4e85f Merge "adb: split up reads longer than 16k." 2015-12-16 20:47:32 +00:00
Alex Vakulenko
2fcf449886 Merge "Fix metricsd to conform to the lastest server schema" 2015-12-16 20:43:54 +00:00
Nick Kralevich
dee1ef48a9 trace-dev.c: more O_CLOEXEC
Stop the file descriptors from leaking.

Change-Id: Ib5ca1c2e5031fbec8751bde9e86b32e51e10fcbc
2015-12-16 12:32:26 -08:00
Jeff Sharkey
db72fe1772 Merge "Re-derive permissions after package changes." 2015-12-16 20:28:01 +00:00
Alex Vakulenko
33c5935852 Fix metricsd to conform to the lastest server schema
The new server push enabled component/trait validation rules. This
allows us to use the new schema that does not require vendor commands,
parameters and state to start with underscore ("_").

Also fixed a few minor errors in schema definition.

Change-Id: I184dd8e4c69c05e0dd1b0dddb1f9a7b0aef78841
2015-12-16 12:23:14 -08:00
Jeff Sharkey
22b912628e Re-derive permissions after package changes.
When packages change, existing package-specific directories may have
gained/lost a UID mapping, so we need to update the permissions for
any in-memory nodes.

This allows an app to deliver data for another package before that
package is installed, which is the typical pattern of how OBB files
are delivered.

Also fix bug by re-deriving permissions when files are moved.

Bug: 25399427
Change-Id: I06f38a24ad7dee5f5099ba81429aef03208e5683
2015-12-16 13:08:29 -07:00
Josh Gao
0b19540dee adb: split up reads longer than 16k.
Reads from functionfs allocate contiguous buffers in the kernel, causing
long ones to sometimes fail because of memory fragmentation.

Bug: http://b/26206622
Change-Id: Id40753d6f29b37b5ca97c3e2fa3921f52b4242de
2015-12-16 11:40:38 -08:00