Commit graph

29799 commits

Author SHA1 Message Date
Wei Wang
0fb3e90eab Merge "init: clean up exec command" am: 564aeca94e am: b1a519a2bd am: acc81455a1
am: d8d64be608

Change-Id: Ie4107c338ade6efe51cd696190e13892d81f19df
2017-02-03 21:01:33 +00:00
Wei Wang
d8d64be608 Merge "init: clean up exec command" am: 564aeca94e am: b1a519a2bd
am: acc81455a1

Change-Id: Id9548bea7f8a77cbf8b20c8007a561fa06049d95
2017-02-03 20:57:35 +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
9f5d1c1258 Merge "bootstat: Log bootloader timing metrics to Tron." am: 01b25ab149 am: c740363341 am: 1c8c915cfb
am: 550b6d3b0b

Change-Id: I078f1bde0eb299a3dfc541f20aa22e663769c9e1
2017-02-03 19:27:40 +00:00
James Hawkins
550b6d3b0b Merge "bootstat: Log bootloader timing metrics to Tron." am: 01b25ab149 am: c740363341
am: 1c8c915cfb

Change-Id: I1e1ffaaee9abc4be7cb6f9a8430a64adc6138dff
2017-02-03 19:25:09 +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
900678cfca Merge "Revert "Get fastboot working on OS X"" am: c8cad2cbfc am: eaaca58053 am: ce8eb8a7ec
am: 9889ee887e

Change-Id: I70320f6be74649ac69c7148f6440faead5e4d6e1
2017-02-03 18:52:38 +00:00
Elliott Hughes
9889ee887e Merge "Revert "Get fastboot working on OS X"" am: c8cad2cbfc am: eaaca58053
am: ce8eb8a7ec

Change-Id: I3ae1d2cea8ba841e3da18346238bafa69a2dd3cb
2017-02-03 18:50:37 +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
8d71d93bb7 Merge changes I69e6489d,Ic17d52a7 am: 98a6db5c9b am: 5769061fe1 am: b74b5571f1
am: 4a0f9d11f8

Change-Id: I916fd6ac3a9a567a76819fcbbb1daf88ed52ae25
2017-02-03 15:36:08 +00:00
Mark Salyzyn
19a69d0fc3 liblog: add android_lookupEventTagNum am: c9e5f37166 am: cb0565b5fa am: 4215584125
am: a07d536b49

Change-Id: I6e6b0aff756a4d3dae61101d75112e5cac032f1e
2017-02-03 15:36:00 +00:00
Mark Salyzyn
3799dd5334 liblog: add /dev/event-log-tags for Tag Map am: 7da7fab790 am: 42689fc472 am: 2299001505
am: 5ca902f80e

Change-Id: I8cb573083dcd381c56d48b53fd2dcce05634973c
2017-02-03 15:35:54 +00:00
Mark Salyzyn
4a0f9d11f8 Merge changes I69e6489d,Ic17d52a7 am: 98a6db5c9b am: 5769061fe1
am: b74b5571f1

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

Change-Id: Idd387a3fbac6a75f89a29aae97738e8050ab3fe0
2017-02-03 15:33:58 +00:00
Mark Salyzyn
d8479cbfbe Merge "logd: add getEventTag command and service" am: 1cd4102a0b am: a942c7c2ce am: 91ca25272d
am: da989edccf

Change-Id: I33b5b4330df4455c6c383e7bba4bd541c2d2ef54
2017-02-03 15:33:53 +00:00
Mark Salyzyn
5ca902f80e liblog: add /dev/event-log-tags for Tag Map am: 7da7fab790 am: 42689fc472
am: 2299001505

Change-Id: Ie8bd4ffd24929c35972792da34b1053fb7418caf
2017-02-03 15:33:53 +00: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
da989edccf Merge "logd: add getEventTag command and service" am: 1cd4102a0b am: a942c7c2ce
am: 91ca25272d

Change-Id: I52fb6b5fe38fc835fdf018f14cd9149fef810545
2017-02-03 15:31:23 +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
Jesse Hall
28ea76f320 Merge changes I321e2193,I1da92e2b am: 3dfe401296 am: cc9df648aa am: 39f586ec8f
am: 0670a0bd83

Change-Id: I70ec36f4b73a312ad6f5bb9611f4c0cd424a0732
2017-02-02 23:38:15 +00:00
Jesse Hall
49b346b974 dlext_namespace.h: Declare android_get_LD_LIBRARY_PATH am: e7005979c2 am: 6dadb99234 am: 599cff624b
am: 02896e68b7

Change-Id: Iadba4912470cb25b8dc5d24f0938b82be6d54d3c
2017-02-02 23:38:07 +00:00
Jesse Hall
48a4352b29 Make dlext_namespaces.h available to users of libnativeloader am: b75d82b42a am: d7aba9fdf5 am: f523342ecc
am: d11be0af14

Change-Id: I9a1370fceae8ee406c5c721a155c3212ff21d150
2017-02-02 23:38:00 +00: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
Paul Lawrence
d4f0e4e1e0 Merge "Revert "Enable seccomp in init with generated policy"" am: d85cf0fb7d am: fa5524fa6e am: 0fc04d8ced
am: 81b7fa069f

Change-Id: I66240087a249d41138c13942c872f1bacb5fb81c
2017-02-02 23:14:29 +00: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
0670a0bd83 Merge changes I321e2193,I1da92e2b am: 3dfe401296 am: cc9df648aa
am: 39f586ec8f

Change-Id: I2e91e4940c6b7bbae44f2ec36a8f16dc88c600b1
2017-02-02 21:47:17 +00:00
Jesse Hall
02896e68b7 dlext_namespace.h: Declare android_get_LD_LIBRARY_PATH am: e7005979c2 am: 6dadb99234
am: 599cff624b

Change-Id: I39b7502e8317e0627187f04c81d463186100d6f9
2017-02-02 21:47:12 +00:00
Jesse Hall
d11be0af14 Make dlext_namespaces.h available to users of libnativeloader am: b75d82b42a am: d7aba9fdf5
am: f523342ecc

Change-Id: I937f33328803436709e6b896f85525427b859674
2017-02-02 21:47:06 +00: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