Commit graph

27590 commits

Author SHA1 Message Date
Josh Gao
3d1ca37b0d Revert "Give crash_dump CAP_SYS_PTRACE." am: ac91b0c452
am: c49f8f3e3d

Change-Id: Iadfc4c83a1ae67faff583b511c82c790970505bb
2017-02-06 18:52:31 +00:00
Josh Gao
c49f8f3e3d Revert "Give crash_dump CAP_SYS_PTRACE."
am: ac91b0c452

Change-Id: I86cab7adaf34cddaffc7631c0dd946f3424f4006
2017-02-06 18:42:59 +00:00
Wei Wang
acc81455a1 Merge "init: clean up exec command" am: 564aeca94e
am: b1a519a2bd

Change-Id: I5c82e39b6fb4cb6a1ef3bb5233f31cf0392f7cb8
2017-02-03 20:52:53 +00:00
Wei Wang
b1a519a2bd Merge "init: clean up exec command"
am: 564aeca94e

Change-Id: Id6424ec342a66d3f2b75a45a9988e399d35a0859
2017-02-03 20:48:45 +00:00
Treehugger Robot
564aeca94e Merge "init: clean up exec command" 2017-02-03 20:45:59 +00:00
James Hawkins
1c8c915cfb Merge "bootstat: Log bootloader timing metrics to Tron." am: 01b25ab149
am: c740363341

Change-Id: I6d602a034996b8accd8e2573ed0a52ae1273a676
2017-02-03 19:22:39 +00:00
James Hawkins
c740363341 Merge "bootstat: Log bootloader timing metrics to Tron."
am: 01b25ab149

Change-Id: Ie5b4555f212a4f02211ad991b4d0ccf0af789db7
2017-02-03 19:20:42 +00:00
James Hawkins
01b25ab149 Merge "bootstat: Log bootloader timing metrics to Tron." 2017-02-03 19:18:36 +00:00
Elliott Hughes
ce8eb8a7ec Merge "Revert "Get fastboot working on OS X"" am: c8cad2cbfc
am: eaaca58053

Change-Id: I3719f866d364c3030536dd1590a1d0e6c777eff5
2017-02-03 18:48:07 +00:00
Elliott Hughes
eaaca58053 Merge "Revert "Get fastboot working on OS X""
am: c8cad2cbfc

Change-Id: I75a48102a1f06b215d5522f2a5c4f7b09322ef64
2017-02-03 18:46:12 +00:00
Elliott Hughes
c8cad2cbfc Merge "Revert "Get fastboot working on OS X"" 2017-02-03 18:40:46 +00:00
Wei Wang
2d0fdaaafc init: clean up exec command
Add wait time log for exec service execution time
Fix memory leak when exec service failed to start

Test: on marlin
Bug: 34518530
Change-Id: I01736bd9b1429414f3dc91dd5d02d88a681f0985
2017-02-03 10:40:39 -08:00
Mark Salyzyn
b74b5571f1 Merge changes I69e6489d,Ic17d52a7 am: 98a6db5c9b
am: 5769061fe1

Change-Id: I69385d69e0f717808bb58cf081dac33cc6362b44
2017-02-03 15:31:34 +00:00
Mark Salyzyn
4215584125 liblog: add android_lookupEventTagNum am: c9e5f37166
am: cb0565b5fa

Change-Id: Ib478eca2279945ea8f7cc117bfc6963b069d8cc0
2017-02-03 15:31:28 +00:00
Mark Salyzyn
2299001505 liblog: add /dev/event-log-tags for Tag Map am: 7da7fab790
am: 42689fc472

Change-Id: Ib48de9bdb26c3cea1c7bea5ad39eb9ba34e2aeae
2017-02-03 15:31:23 +00:00
Mark Salyzyn
5769061fe1 Merge changes I69e6489d,Ic17d52a7
am: 98a6db5c9b

Change-Id: I231dffdd4d260cae270979fc3f4e6fa7ad68dfde
2017-02-03 15:29:31 +00:00
Mark Salyzyn
cb0565b5fa liblog: add android_lookupEventTagNum
am: c9e5f37166

Change-Id: I4faeb6404a121492b5e796a09cab2ee989a8a5b2
2017-02-03 15:29:30 +00:00
Mark Salyzyn
42689fc472 liblog: add /dev/event-log-tags for Tag Map
am: 7da7fab790

Change-Id: Ifa17b4f5cdb5aa3c6db6222877e6e00f11b3db61
2017-02-03 15:29:24 +00:00
Mark Salyzyn
91ca25272d Merge "logd: add getEventTag command and service" am: 1cd4102a0b
am: a942c7c2ce

Change-Id: I1d017ed519e19b643edcd8973ba3b5d0399eb9f3
2017-02-03 15:29:23 +00:00
Mark Salyzyn
a942c7c2ce Merge "logd: add getEventTag command and service"
am: 1cd4102a0b

Change-Id: I89d4b5cae070afe5ef080d425007b5b106256c11
2017-02-03 15:27:25 +00:00
Mark Salyzyn
98a6db5c9b Merge changes I69e6489d,Ic17d52a7
* changes:
  liblog: add android_lookupEventTagNum
  liblog: add /dev/event-log-tags for Tag Map
2017-02-03 15:26:14 +00:00
Mark Salyzyn
1cd4102a0b Merge "logd: add getEventTag command and service" 2017-02-03 15:24:26 +00:00
Elliott Hughes
35c1a6203e Revert "Get fastboot working on OS X"
This reverts commit 81c24f6f86.

Change-Id: If2f7220ff00582c3e1b38917352ab961ded48642
2017-02-03 01:28:42 +00:00
James Hawkins
be46fd1b94 bootstat: Log bootloader timing metrics to Tron.
Bug: 34944249
Test: None
Change-Id: Ica6d87c8631a6cc8d70a01186686381f9dc352f9
2017-02-02 16:28:25 -08:00
Mark Salyzyn
c9e5f37166 liblog: add android_lookupEventTagNum
android_lookupEventTagNum added.  Adds support for creating a new
log tag at runtime, registered to the logd service.

Tested on Hikey, all services stopped, shell only access, CPUs not
locked (there is enough repeatability on this platform).

$ /data/nativetest64/liblog-benchmarks/liblog-benchmarks BM_lookupEventTagNum

                          iterations      ns/op
Precharge: start
Precharge: stop 231
NB: only Tag matching, linear lookup (as reference, before unordered_map)
BM_lookupEventTagNum         1000000       1017
NB: unordered_map with full Tag & Format lookup, but with Tag hashing
BM_lookupEventTagNum         2000000        683
NB: with full Tag & Format hash and lookup for matching
BM_lookupEventTagNum         2000000        814
NB: only Tag matching (Hail Mary path)
BM_lookupEventTagNum         5000000        471

Because the database can now be dynamic, we added reader/writer locks
which adds a 65ns (uncontended) premium on lookups, and switch to
check for an allocation adds 25ns (either open code, or using
string_view, no difference) which means our overall speed takes 90%
as long as the requests did before we switched to unordered_map.
Faster than before where we originally utilized binary lookup on
static content, but not by much.  Dynamic updates that are not cached
locally take the following times to acquire long path to logd to
generate.

BM_lookupEventTag           20000000         139
BM_lookupEventTag_NOT       20000000         87
BM_lookupEventFormat        20000000         139
BM_lookupEventTagNum_logd_new   5000         335936
BM_lookupEventTagNum_logd_existing 10000     249226

The long path pickups are mitigated by the built-in caching, and
the public mapping in /dev/event-log-tags.

SideEffects: Event tags and signal handlers do not mix
Test: liblog benchmarks
Bug: 31456426
Change-Id: I69e6489d899cf35cdccffcee0d8d7cad469ada0a
2017-02-02 15:21:15 -08:00
Mark Salyzyn
7da7fab790 liblog: add /dev/event-log-tags for Tag Map
android_openEventTagMap(NULL) will open and mix content from
/system/etc/event-log-tags and /dev/event-log-tags.  Only
reports identicals if global.

Test: gTest logd-unit-tests and liblog-unit-tests, liblog-benchmarks.
Bug: 31456426
Change-Id: Ic17d52a7829a4daaf013828d08fc1c09446ae8ef
2017-02-02 14:24:26 -08:00
Mark Salyzyn
61e9ce6709 logd: add getEventTag command and service
Will register a new event tag by name and format, and return an
event-log-tags format response with the newly allocated tag.
If format is not specified, then nothing will be recorded, but
a pre-existing named entry will be listed. If name and format are
not specified, list all dynamic entries. If name=* list all
event log tag entries.

Stickiness through logd crash will be managed with the tmpfs file
/dev/event-log-tags and through a reboot with add_tag entries in
the pmsg last logcat event log. On debug builds we retain a
/data/misc/logd/event-log-tags file that aids stickiness and that
can be picked up by the bugreport.

If we detect truncation damage to /dev/event-log-tags, or to
/data/misc/logd/event-log-tags, rebuild file with a new first line
signature incorporating the time so mmap'd readers of the file can
detect the possible change in shape and order.

Manual testing:

Make sure nc (netcat) is built for the target platform on the host:
$ m nc

Then the following can be used to issue a request on the platform:
$ echo -n 'getEventTag name=<name> format="<format>"\0EXIT\0' |
> nc -U /dev/socket/logd

Test: gTest logd-unit-test --gtest_filter=getEventTag*
Bug: 31456426
Change-Id: I5dacc5f84a24d52dae09cca5ee1a3a9f9207f06d
2017-02-02 14:24:18 -08:00
Jesse Hall
39f586ec8f Merge changes I321e2193,I1da92e2b am: 3dfe401296
am: cc9df648aa

Change-Id: Ia66817f9c4d6d21bb1db51574151e004e5baa25f
2017-02-02 21:44:45 +00:00
Jesse Hall
599cff624b dlext_namespace.h: Declare android_get_LD_LIBRARY_PATH am: e7005979c2
am: 6dadb99234

Change-Id: If120541faec8c7690ec7c2ad077c279748969ca9
2017-02-02 21:44:40 +00:00
Jesse Hall
f523342ecc Make dlext_namespaces.h available to users of libnativeloader am: b75d82b42a
am: d7aba9fdf5

Change-Id: I64a1c914ef05bd7ec5554b791d382f5a888c2225
2017-02-02 21:44:36 +00:00
Jesse Hall
cc9df648aa Merge changes I321e2193,I1da92e2b
am: 3dfe401296

Change-Id: I99216f1afac8b365e271dc67f0b3c7f4d7a2de8e
2017-02-02 21:41:57 +00:00
Jesse Hall
6dadb99234 dlext_namespace.h: Declare android_get_LD_LIBRARY_PATH
am: e7005979c2

Change-Id: I1af072ad1184b9eb7108855de45b114881379c5e
2017-02-02 21:41:56 +00:00
Jesse Hall
d7aba9fdf5 Make dlext_namespaces.h available to users of libnativeloader
am: b75d82b42a

Change-Id: I6d662f190349fb12043e726672673eb6a3b0c7b1
2017-02-02 21:41:51 +00:00
Treehugger Robot
3dfe401296 Merge changes I321e2193,I1da92e2b
* changes:
  dlext_namespace.h: Declare android_get_LD_LIBRARY_PATH
  Make dlext_namespaces.h available to users of libnativeloader
2017-02-02 21:19:25 +00:00
Jesse Hall
e7005979c2 dlext_namespace.h: Declare android_get_LD_LIBRARY_PATH
This allows clients creating their own namespace do so by modifying
the default library path, rather than hardcoding it multiple places in
the system.

Bug: 33531483
Test: build
Change-Id: I321e219392b38c235b220986e1520b49a4669863
(cherry picked from commit 823c266a8a)
2017-02-02 11:36:14 -08:00
Jesse Hall
b75d82b42a Make dlext_namespaces.h available to users of libnativeloader
Bug: 33531483
Test: build
Change-Id: I1da92e2b1437b6775a9d81fc6c1a2d4bacecbc04
(cherry picked from commit 0936d25371)
2017-02-02 11:36:04 -08:00
Paul Lawrence
0fc04d8ced Merge "Revert "Enable seccomp in init with generated policy"" am: d85cf0fb7d
am: fa5524fa6e

Change-Id: I4d1f5894a6868fd690b7a559aea63ba877fa7e0e
2017-02-02 18:31:51 +00:00
Paul Lawrence
fa5524fa6e Merge "Revert "Enable seccomp in init with generated policy""
am: d85cf0fb7d

Change-Id: Ie95109be0e76e64178edde4214358e2145e59684
2017-02-02 18:18:13 +00:00
Paul Lawrence
d85cf0fb7d Merge "Revert "Enable seccomp in init with generated policy"" 2017-02-02 18:09:18 +00:00
Elliott Hughes
cb64a82937 Merge "Better seccomp/kuser_helper diagnostics from debuggerd." am: f4ae6203a9
am: 502e3d9759

Change-Id: I2ac88266905e8e7697116ddd9c732f1ea854456b
2017-02-02 17:44:51 +00:00
Elliott Hughes
502e3d9759 Merge "Better seccomp/kuser_helper diagnostics from debuggerd."
am: f4ae6203a9

Change-Id: I8085662232edccefe454cc9763774f2a7de414d6
2017-02-02 17:42:23 +00:00
Elliott Hughes
f4ae6203a9 Merge "Better seccomp/kuser_helper diagnostics from debuggerd." 2017-02-02 17:37:25 +00:00
Paul Lawrence
c4af05f8a3 Revert "Enable seccomp in init with generated policy"
This reverts commit db929bf9b7.

Seccomp is now inserted at the zygote level, not in init

Bug: 34710876
Test: Boots, seccomp policy in zygote & zygote64 but not init
Change-Id: I9075a79793171a4eaccf6228e9ff3398c791f8bd
2017-02-02 09:27:49 -08:00
Wei Wang
6426815ecc Merge "init: add wait_for_prop builtin command" am: d25e4c5819
am: 7f1dbd8f68

Change-Id: I549fb22fdd6df9f3ca363eb47bd9f87a8d93ce6e
2017-02-02 04:51:19 +00:00
Wei Wang
7f1dbd8f68 Merge "init: add wait_for_prop builtin command"
am: d25e4c5819

Change-Id: I8265906f497e89193f0c428c78bd1c4b178b3034
2017-02-02 04:48:46 +00:00
Treehugger Robot
d25e4c5819 Merge "init: add wait_for_prop builtin command" 2017-02-02 04:45:36 +00:00
Alex Shlyapnikov
18853fdc22 Merge "Expand seccomp whitelist" am: 0f0caf95c9
am: c84d14088e

Change-Id: I1812c3703c7bb547cca16042540f4728fbc9dfc1
2017-02-02 04:27:16 +00:00
Alex Shlyapnikov
c84d14088e Merge "Expand seccomp whitelist"
am: 0f0caf95c9

Change-Id: I97aac1b65cb41b5466411cef5e25d8a71d1c62e3
2017-02-02 04:24:15 +00:00
Treehugger Robot
0f0caf95c9 Merge "Expand seccomp whitelist" 2017-02-02 04:21:23 +00:00
Elliott Hughes
0ba535976f Better seccomp/kuser_helper diagnostics from debuggerd.
Also switch to Android.bp for crasher.

Bug: http://b/34629282 (seccomp)
Bug: http://b/34705831 (seccomp)
Bug: http://b/34884086 (kuser_helpers)
Test: manual
Change-Id: I8ee79c635518faeba751742919af69a505b5e3e1
2017-02-01 18:43:03 -08:00