Commit Graph

26948 Commits

Author SHA1 Message Date
Treehugger Robot 94dd4b7410 Merge "adb: fix adb trace tag" 2016-12-17 00:07:41 +00:00
Nick Kralevich 5f9fa90425 fs_config.c: make *.prop files 0600
Enforce that the only API for reading properties is through the property
server, not by reading the (system|vendor|rootfs) *.prop files.

Test: Device boots and no property errors.
Change-Id: Ibb6ed4e74a80cac00010c707d7574f8e92fc6448
2016-12-16 14:54:02 -08:00
Elliott Hughes c249794628 Move init bootcharting onto its own thread.
This reduces the overhead when bootcharting is on (obviously), but also
removes the "do we need to do anything for bootcharting?" check in cases
where we're not bootcharting.

Bug: http://b/23478578
Bug: http://b/33450491
Test: rebooted with bootcharting on/off
Change-Id: Id8746b5023b17d7615679eba0bcd02aee048ef1a
2016-12-16 14:45:17 -08:00
Mark Salyzyn 1465c32737 Merge "logd: record multiple duplicate messages as chatty" am: d0ee73932f
am: ad3f07d25e

Change-Id: I7c0545dafa85ac4974179098c58cd16ec0de4a06
2016-12-16 22:25:27 +00:00
Mark Salyzyn ad3f07d25e Merge "logd: record multiple duplicate messages as chatty"
am: d0ee73932f

Change-Id: I4e3d6695d33f01b066bb9706e77daf7223f3ab11
2016-12-16 22:16:56 +00:00
Treehugger Robot d0ee73932f Merge "logd: record multiple duplicate messages as chatty" 2016-12-16 22:05:12 +00:00
dcashman 2fae5d65d5 Compile sepolicy on-device at early boot.
Compile policy from disparate sources at beginning of init and use to load
rather than relying on prebuilt policy.

Bug: 31363362
Test: Policy builds on-device and boots.
Change-Id: I681ec3f7da351d0b24d1f1e81e8a6b00c9c9d20c
2016-12-16 14:02:31 -08:00
Jorge Lucangeli Obes c5e3496a41 Merge "capabilities: Check ambient caps, last valid runtime cap." am: 044b18cb7f
am: 9e9c49f2d8

Change-Id: I85279c3f4b4a84d8bbb4df65d565f821523ab01c
2016-12-16 20:09:19 +00:00
Jorge Lucangeli Obes 9e9c49f2d8 Merge "capabilities: Check ambient caps, last valid runtime cap."
am: 044b18cb7f

Change-Id: Ib45e37d200b57b9837befdf203012b88724f41e5
2016-12-16 20:01:18 +00:00
Treehugger Robot 044b18cb7f Merge "capabilities: Check ambient caps, last valid runtime cap." 2016-12-16 19:50:34 +00:00
Mark Salyzyn 014fd15779 Merge "liblog: move log_is_loggable.c to properties.c" am: 3ef8ad8548
am: ebb7a0dbc5

Change-Id: Id1580a1a48259ccd29908eaad2a64831f53f7d04
2016-12-16 19:15:23 +00:00
Mark Salyzyn ebb7a0dbc5 Merge "liblog: move log_is_loggable.c to properties.c"
am: 3ef8ad8548

Change-Id: I207fd9e243ad689f8ea3234d58c39385c452d71d
2016-12-16 19:08:23 +00:00
Mark Salyzyn 3ef8ad8548 Merge "liblog: move log_is_loggable.c to properties.c" 2016-12-16 19:01:21 +00:00
David Pursell 32d5a50167 Merge "fastboot: fix set_active for legacy A/B." am: 719263e6d2
am: 494737b05a

Change-Id: I37b238ae799208b20d301ba5c5fad7a42e2f3186
2016-12-16 18:20:41 +00:00
David Pursell 494737b05a Merge "fastboot: fix set_active for legacy A/B."
am: 719263e6d2

Change-Id: I1648745412c4aa8ec64d1ca0865b94f326e93643
2016-12-16 18:12:08 +00:00
Jorge Lucangeli Obes f3f824ee42 capabilities: Check ambient caps, last valid runtime cap.
Partners have expressed interest in using the 'capabilities' keyword
in init, so make the code more resilient:
-Check that ambient capabilities are supported by the kernel.
-Check that the last valid cap at runtime is not higher than what's in
kernel headers.
-Check that the user is not requesting a capability present in kernel
headers but not supported by the kernel at runtime.
-Don't attempt to drop bounding set capabilities not supported at
runtime.

This CL also fixes a small bug where < should have been used instead of
<=, and uses 'static' instead of anonymous namespaces.

Bug: 32438163
Test: Use a test service that uses capabilities.
Test: Apply in internal tree and test with angler and rild.

Change-Id: Ia271cc7eb389d1d526d61f897261e4bac4d19e5d
2016-12-16 13:04:52 -05:00
Treehugger Robot 719263e6d2 Merge "fastboot: fix set_active for legacy A/B." 2016-12-16 18:04:27 +00:00
Elliott Hughes 1a947725b8 Merge "Improve init bootcharting." am: 4ee7861ee1
am: a6532b4717

Change-Id: Ifaad4b0145c39af14d7622711a19dd72b062db8b
2016-12-16 17:47:10 +00:00
Elliott Hughes a6532b4717 Merge "Improve init bootcharting."
am: 4ee7861ee1

Change-Id: I1ac594b6e0325f4006fa1ca60ee75af8849a5901
2016-12-16 17:38:39 +00:00
Elliott Hughes 4ee7861ee1 Merge "Improve init bootcharting." 2016-12-16 17:32:27 +00:00
Mark Salyzyn 774e04f779 liblog: move log_is_loggable.c to properties.c
Just makes sense cleanup

Test: gTest liblog-unit-tests
Bug: 33535908
Change-Id: I85de049f3cd73a473d56db5970d42eee5f9f70a8
2016-12-16 08:43:56 -08:00
forfun c5c0306424 modify a minor error in mount_with_alternatives
Test: when called with end_idx = null

Change-Id: I7e5d298f496847acb4aefbaad66cd98e907467bc
Signed-off-by: forfun <forfun414@gmail.com>
2016-12-16 07:02:57 +00:00
Jeff Sharkey 4898fd9f4f Merge commit '04c9a4da7e261b797c726cf31bf0ea232a8f685d' into foobar3
Change-Id: Ia462030220115d6a602c2fcbcbccea162ca335bb
2016-12-15 22:27:41 -07:00
Jeff Sharkey 839f8c11ec Merge "fs_mgr: support to reserved some blocks for an ext2/3/4 partition." am: 60739458e5
am: c8e717f414

Change-Id: Ie8816d84d8f9640d4d064255d4eafa70fdeec3ab
2016-12-16 05:13:55 +00:00
Jeff Sharkey 04c9a4da7e Merge "Add fs_mgr option to enable/disable quotas."
am: 3b261ace57

Change-Id: I63957616da4017af4bd386c676876931f98926fe
2016-12-16 05:06:12 +00:00
Jeff Sharkey c8e717f414 Merge "fs_mgr: support to reserved some blocks for an ext2/3/4 partition."
am: 60739458e5

Change-Id: I919f6f4411e7d89d4b85ee66bea5eb71a4304889
2016-12-16 05:05:58 +00:00
Jeff Sharkey 3b261ace57 Merge "Add fs_mgr option to enable/disable quotas." 2016-12-16 04:56:39 +00:00
Jeff Sharkey 60739458e5 Merge "fs_mgr: support to reserved some blocks for an ext2/3/4 partition." 2016-12-16 04:56:30 +00:00
Mark Salyzyn aeb972ae64 Merge "liblog: event_tag_map use unordered_map" am: 8b99ef6c21
am: 5f1b27fdbb

Change-Id: I169ca9b634079ea7df000611639a25a0f2e3baf6
2016-12-16 02:17:46 +00:00
Mark Salyzyn 5f1b27fdbb Merge "liblog: event_tag_map use unordered_map"
am: 8b99ef6c21

Change-Id: I0644ce91d87088dd5583f10c6fdf4443820a90be
2016-12-16 02:10:15 +00:00
Treehugger Robot 8b99ef6c21 Merge "liblog: event_tag_map use unordered_map" 2016-12-16 01:57:03 +00:00
Colin Cross f42618d1cc Merge changes I6dc353a2,I7df990f0 am: bb612a356a
am: 3a3e02e835

Change-Id: I90957532ce6fcacf184946ce103476334ae0b6a2
2016-12-16 01:25:06 +00:00
Colin Cross 7786c2d50c Convert the rest of libbacktrace to Android.bp am: da9bd5902f
am: 05d1359db2

Change-Id: I02930aa02a54dd6944316d3aecf1ddaa50809c8b
2016-12-16 01:24:59 +00:00
Colin Cross bca6f13b4a Fix unused parameter warning for mips builds am: 06d314917f
am: dc432aa3c7

Change-Id: Ic4143785288df86c1a9cfdfef0e2598f371a8ebd
2016-12-16 01:24:54 +00:00
Mark Salyzyn a2c022257c logd: record multiple duplicate messages as chatty
If a series of messages arrive from a single source with identical
message content payload, then suppress them and generate a chatty
report.  The checking is done on a per log id basis.

This alters the assumption that chatty messages are always at the
oldest entries, they now show up in the middle too.  To address this
change in behavior we print the first line, a chatty reference
which internally takes little space, then the last line in the series.

This does not conserve processing time in logd, and certainly has no
impact on the long path of formatting and submitting log messages from
from the source, but it may contribute to memory space and signal to
noise savings under heavy spammy loads.

Test: gTest liblog-unit-tests, logd-unit-tests & logcat-unit-tests
Bug: 33535908
Change-Id: I3160c36d4f4e2f8216f528605a1b3993173f4dec
2016-12-15 16:31:51 -08:00
David Pursell 04396f62da fastboot: fix set_active for legacy A/B.
Legacy A/B implementations use _a and _b slot names, but currently the
set_active command is unconditionally stripping the _ prefix. This CL
adds some code to add the _ back in if connected to a legacy A/B
implementation.

This isn't a complete fix (there are other places in the code that also
unconditionally strip the prefix) but is sufficient for Android Things
use case, and we want to keep this change as small and safe as possible
to avoid breaking anything else.

Bug: http://b/32996227
Test: `fastboot set_active _a` and `fastboot set_active a` works on
      both AndroidThings Edison board and Marlin.
Test: AndroidThings Edison flashall script now completes successfully.
Change-Id: I1a07e48b9e2726f386e9ece5267a9f1d8edefe22
2016-12-15 16:27:48 -08:00
Colin Cross 3a3e02e835 Merge changes I6dc353a2,I7df990f0
am: bb612a356a

Change-Id: Ibbf0934024884e8c24d6592e9963f549ef90a032
2016-12-16 00:23:14 +00:00
Colin Cross 05d1359db2 Convert the rest of libbacktrace to Android.bp
am: da9bd5902f

Change-Id: I95398fa532bab5398298fb6b2028d7797afc5c00
2016-12-16 00:23:13 +00:00
Colin Cross dc432aa3c7 Fix unused parameter warning for mips builds
am: 06d314917f

Change-Id: I512165bd8a70057c5c3560bc8d785f5193dcee9a
2016-12-16 00:23:08 +00:00
Treehugger Robot bb612a356a Merge changes I6dc353a2,I7df990f0
* changes:
  Convert the rest of libbacktrace to Android.bp
  Fix unused parameter warning for mips builds
2016-12-16 00:11:17 +00:00
Jeff Sharkey 6d89610d1a Add fs_mgr option to enable/disable quotas.
To support upcoming disk usage calculation optimizations, this change
adds a new 'quota' mount flag.  As part of mounting an ext4 device,
we now enable/disable the quota feature using tune2fs to match the
requested value in the fstab.

When changing the quota status, we force a fsck pass on the device
before actually mounting it to prime the quota data structures which
are stored in hidden inodes.

Changing quota state and priming the data structures needs to happen
before we actually mount the device, so fs_mgr is the best place to
place this logic.

Test: builds, boots, enables and disables quota
Bug: 27948817
Change-Id: I7ccbf97cbc4a679bdd7a31a77be4b99aa9a88e66
2016-12-15 16:35:50 -07:00
liminghao 9a0fd1d5d3 fs_mgr: support to reserved some blocks for an ext2/3/4 partition.
These reserved blocks used to root or claim to CAP_SYS_RESOURCES process.

Change-Id: I4893bdb08399bf31a7640d4a63f4952cd636576f
Merged-In: I4893bdb08399bf31a7640d4a63f4952cd636576f

Signed-off-by: liminghao <liminghao@xiaomi.com>
2016-12-15 16:26:53 -07:00
Elliott Hughes ced63cee3c Merge "Improve crasher." am: dbfb20bda4
am: b7ceb2397e

Change-Id: I2c8579a6f7b8cb636923703ce9551a51a095b19f
2016-12-15 23:23:34 +00:00
Jeff Sharkey 1ad4090e4e Merge "Define range of GIDs for cached app data." am: da94f09e22
am: ac13675071

Change-Id: Id5cbfbca06f75de7e67e25277adeac576f545ea2
2016-12-15 23:15:01 +00:00
Colin Cross 95f48fd29b Merge "Revert "Convert the rest of libbacktrace to Android.bp"" am: 049376f14d
am: 6b1a1badd0

Change-Id: I9b8437a7a5d624c2ca0015f56957d1fc8eb6b750
2016-12-15 23:14:40 +00:00
Mark Salyzyn 700fb87648 liblog: event_tag_map use unordered_map
>3 times faster access for lookup functions.  Code simplification and
C++ coding style conversion.  android_lookupEventTagNum has been
expanded to utilize the Format match, and then drops down to just
Tag match.

Performance testing on Hikey, all services stopped, shell only access,
CPU not locked had good repeatability.

$ adb reboot ; adb wait-for-device ; adb shell su root stop

Before this adjustment using binary search:

$ /data/nativetest64/liblog-benchmarks/liblog-benchmarks BM_lookupEvent*
                          iterations      ns/op
Precharge: start
Precharge: stop 231
BM_lookupEventTag           10000000        153
BM_lookupEventTag_NOT       20000000        139
BM_lookupEventFormat        10000000        153

After this adjustment strictly using std::unordered_map lookup:

$ /data/nativetest64/liblog-benchmarks/liblog-benchmarks BM_lookupEvent*
                          iterations      ns/op
Precharge: start
Precharge: stop 231
BM_lookupEventTag           50000000         56
BM_lookupEventTag_NOT      100000000         21
BM_lookupEventFormat        50000000         56

Test: gTest logd-unit-tests and liblog-unit-tests, liblog-benchmarks.
Bug: 31456426
Change-Id: I1cfc3d641c3ea9ab08d455efe0c844d3a6381440
2016-12-15 22:32:37 +00:00
Elliott Hughes b7ceb2397e Merge "Improve crasher."
am: dbfb20bda4

Change-Id: I77c00bef011d4c8ea5345012b72a8e808c5ab4d8
2016-12-15 22:07:43 +00:00
Elliott Hughes dbfb20bda4 Merge "Improve crasher." 2016-12-15 21:54:24 +00:00
Jeff Sharkey ac13675071 Merge "Define range of GIDs for cached app data."
am: da94f09e22

Change-Id: I5db07df01d02b7612d89bca226536cc6461d44b0
2016-12-15 21:52:05 +00:00
Jeff Sharkey da94f09e22 Merge "Define range of GIDs for cached app data." 2016-12-15 21:46:31 +00:00