Commit graph

2255 commits

Author SHA1 Message Date
Mark Salyzyn
144abd8cb2 Merge "liblog: adb: move security interfaces to private" am: 09dac589f1 am: 586c6985cf
am: 4b5456eacc

Change-Id: Id78628d7e7abfa16f1ada16f894f9616a2dc469b
2016-10-10 23:34:54 +00:00
Mark Salyzyn
4b5456eacc Merge "liblog: adb: move security interfaces to private" am: 09dac589f1
am: 586c6985cf

Change-Id: I8c54bdc1a3582be1fc7c4a9be83b555624fcb0a3
2016-10-10 23:29:55 +00:00
Mark Salyzyn
6debf985aa liblog: adb: move security interfaces to private
Test: Compile & adb functioning
Bug: 19235719
Bug: 26552300
Bug: 31289077
Bug: 31456426
Change-Id: I7ad8963bcca3d8b5c37b547c11d163b652d35556
2016-10-10 15:15:45 +00:00
Chia-I Wu
ebebf0198d Merge "Add native_handle_clone" am: e8f6c7398b am: 462e087e40
am: cb52dc258e

Change-Id: I011555d429120a26e61fbce5f7a125ce96fadb3f
2016-10-08 01:39:01 +00:00
Chia-I Wu
cb52dc258e Merge "Add native_handle_clone" am: e8f6c7398b
am: 462e087e40

Change-Id: I745341bf4c76fc8c75f36e578cf1086808119426
2016-10-08 01:34:05 +00:00
Chia-I Wu
e8f6c7398b Merge "Add native_handle_clone" 2016-10-08 01:25:35 +00:00
Elliott Hughes
c9dc124e2f Merge "Test for _WIN32 in instead of USE_MINGW." am: ec99158580 am: 2e7e065db9
am: 04819403d6

Change-Id: I03fc482f4d0aab72991b351e855b8e240ed3abd9
2016-10-05 18:38:10 +00:00
Elliott Hughes
04819403d6 Merge "Test for _WIN32 in instead of USE_MINGW." am: ec99158580
am: 2e7e065db9

Change-Id: I9c7bee42bf1d7522d4dd95b5bb8a925841f96624
2016-10-05 18:35:40 +00:00
Treehugger Robot
ec99158580 Merge "Test for _WIN32 in instead of USE_MINGW." 2016-10-05 18:30:06 +00:00
Elliott Hughes
34a4f0b8c7 Test for _WIN32 in instead of USE_MINGW.
Bug: http://b/23392815
Test: builds
Change-Id: I7fce8de1f0e2314170cce456cd49346dcee9d134
2016-10-05 09:37:44 -07:00
Mark Salyzyn
74ba3b0ce6 Merge "system/core: drop or replace log/logger.h" am: 1f90485804 am: cb670780be
am: 6e5ffe2680

Change-Id: I4c1351fb61b3357d059a8e1da4ce14e3701e17af
2016-10-04 18:37:14 +00:00
Mark Salyzyn
6e5ffe2680 Merge "system/core: drop or replace log/logger.h" am: 1f90485804
am: cb670780be

Change-Id: I532a0f6143511f53f3303751f95de115ac034cd7
2016-10-04 18:33:44 +00:00
Mark Salyzyn
37c9451349 system/core: drop or replace log/logger.h
debuggerd does not require log/logger.h, can use android/log.h
In some cases, mark why log/logger.h was required.

Test: Compile and boot smoke test
Bug: 26552300
Bug: 31289077
Bug: 31456426
Change-Id: Ia34987e25a01d81971ec8d785415f732b8376c4f
2016-10-04 09:09:10 -07:00
Mohan Srinivasan
96eba22338 Merge "liblog: logd: Add android_lookupEventTag_len()" am: 093951a230 am: aed39f1f3d
am: 2acb41b46c

Change-Id: Ifd5da3780cf05863b71fad9583b1b83f4962b46f
2016-10-03 22:47:51 +00:00
Mohan Srinivasan
2acb41b46c Merge "liblog: logd: Add android_lookupEventTag_len()" am: 093951a230
am: aed39f1f3d

Change-Id: If1615c62df20df58eda2910455f2a1e05268fba7
2016-10-03 22:42:20 +00:00
Mark Salyzyn
807e40ecc9 liblog: logd: Add android_lookupEventTag_len()
Allows us to mitigate the impact of MAP_PRIVATE and copy on write by
calling android_lookupEventTag_len instead of android_lookupEventTag,
and delaying the copy on write impact to the later.  We return a
string length in a supplied location along with the string pointer
with android_lookupEventTag_len(const EventTagMap* map, size_t* len,
int tag).  The string is not guaranteed to be nul terminated.  Since
android_lookupEventTag() called even once can cause the memory
impact, we will mark it as deprecated, but we currently have no
timeframe for removal since this is a very old interface.

Add an API for __android_log_is_loggable_len() that accepts the non
null terminated content and fixup callers that would gain because the
length is known prior to the call either in the compiler or at
runtime.  Tackle transition to android_lookupEventTag_len() and
fixup callers.

On any application that performs logging (eg: com.android.phone)

/proc/<pid>/smaps before:

xxxxxxxxxx-xxxxxxxxxx rw-p 00000000 fd:00 463 /system/etc/event-log-tags
Size:                 20 kB
Rss:                  20 kB
Pss:                   1 kB
Shared_Clean:          0 kB
Shared_Dirty:         20 kB
Private_Clean:         0 kB
Private_Dirty:         0 kB
Referenced:            0 kB
Anonymous:            20 kB
AnonHugePages:         0 kB
Swap:                  0 kB
SwapPss:               0 kB
KernelPageSize:        4 kB
MMUPageSize:           4 kB
Locked:                0 kB
VmFlags: rd wr mr mw me ac

/proc/<pid>/smaps after:

xxxxxxxxxx-xxxxxxxxxx rw-p 00000000 fd:00 1773 /system/etc/event-log-tags
Size:                 20 kB
Rss:                  20 kB
Pss:                   1 kB
Shared_Clean:         20 kB  (was 0kB)
Shared_Dirty:          0 kB  (was 20kB)
Private_Clean:         0 kB
Private_Dirty:         0 kB
Referenced:           20 kB  (was 0kB)
Anonymous:             0 kB  (was 20kB)
AnonHugePages:         0 kB
Swap:                  0 kB
SwapPss:               0 kB
KernelPageSize:        4 kB
MMUPageSize:           4 kB
Locked:                0 kB
VmFlags: rd wr mr mw me ac

Added liblog-unit-tests --gtest_filter=liblog.event_log_tags to
check for Shared_Clean: to not be 0 and Anonymous: to be 0 for
all processes referencing event-log-tags.  Which can include multiple
references to /system/etc/event-log-tags and future possible refs to
/data/misc/logd/event-log-tags and /dev/event-log-tags.  We want
failure messages to help point to errant code using the deprecated
interface.

This change saves 1/4MB of memory or more on a typical system.

Test: gTest liblog-unit-tests
Bug: 31456426
Change-Id: I9e08e44d9092bd96fe704b5709242e7195281d33
2016-10-03 11:08:34 -07:00
Mark Salyzyn
9f6b98dec0 system/core Replace log/log.h with android/log.h am: ff2dcd9af9 am: cac331afd9
am: 0308b0eabd

Change-Id: I4d631d53b4fc27e1a02d412bae21fffad6635258
2016-09-30 22:18:18 +00:00
Mark Salyzyn
0abff8fc61 system/core Replace cutils/log.h with android/log.h am: 66ce3e08c5 am: eb189f147b
am: 16f7786032

Change-Id: I26939d55686b6182c9fae5fc74f3e7ed92132cdb
2016-09-30 22:18:03 +00:00
Mark Salyzyn
9bb1f2f915 libcutils: Replace cutils/log.h with android/log.h am: 23ed4c242a am: f56fce0240
am: 9fd2eaf827

Change-Id: If01fd686fc15aaf74b6f06b7e661eb46e127d51b
2016-09-30 22:17:30 +00:00
Mark Salyzyn
2156aae1d5 liblog: Replace log/log.h with android/log.h am: 6584d0a35a am: 499a33d6dc
am: c528ac0fe8

Change-Id: I2e6eb5782ccd27e47e8302381d790611fd58a1d7
2016-09-30 22:17:20 +00:00
Mark Salyzyn
ea3c6d1029 liblog: logcat: Replace log/logd.h with log/log.h am: a166708d15 am: 772ed1c63c
am: 2b42b87d8c

Change-Id: I4a977e248d0ea7e3b8ed31aed0643752aaab4e1c
2016-09-30 22:17:14 +00:00
Mark Salyzyn
a06a6509d9 liblog: logd: logcat: deprecate log/log_read.h am: 004cd3c55d am: 78a459a8c8
am: 13c68b09d9

Change-Id: Icaab3eedecad8f55d8d1291b3414da5c12cec287
2016-09-30 22:17:08 +00:00
Mark Salyzyn
519bdbf0b4 liblog: Add C++ wrapper for C event log handler am: 8eaaac0103 am: 8b4cab3f69
am: 848da90978

Change-Id: I215d1da28c1d4e0377097f49493d1e9c5fc9ee75
2016-09-30 22:17:02 +00:00
Mark Salyzyn
0308b0eabd system/core Replace log/log.h with android/log.h am: ff2dcd9af9
am: cac331afd9

Change-Id: I95c6a64bc35a041688303fcee4d506865d0a19a4
2016-09-30 22:13:00 +00:00
Mark Salyzyn
16f7786032 system/core Replace cutils/log.h with android/log.h am: 66ce3e08c5
am: eb189f147b

Change-Id: I3f2b13e259d9bbb7bc714f21eab7181fa72c35bf
2016-09-30 22:12:55 +00:00
Mark Salyzyn
9fd2eaf827 libcutils: Replace cutils/log.h with android/log.h am: 23ed4c242a
am: f56fce0240

Change-Id: I588c3a252594e1ecd4b34242217cf23c84e4af67
2016-09-30 22:12:45 +00:00
Mark Salyzyn
c528ac0fe8 liblog: Replace log/log.h with android/log.h am: 6584d0a35a
am: 499a33d6dc

Change-Id: If28b70b199b4bbf99f853d6c6d14b73a72fafacb
2016-09-30 22:12:41 +00:00
Mark Salyzyn
2b42b87d8c liblog: logcat: Replace log/logd.h with log/log.h am: a166708d15
am: 772ed1c63c

Change-Id: Ibd14ac6a57994019e188e6ec138682b50d1f7e69
2016-09-30 22:12:36 +00:00
Mark Salyzyn
13c68b09d9 liblog: logd: logcat: deprecate log/log_read.h am: 004cd3c55d
am: 78a459a8c8

Change-Id: If1a76043e7941191b3c6ba07ca0277b7f9b7f2e6
2016-09-30 22:12:32 +00:00
Mark Salyzyn
848da90978 liblog: Add C++ wrapper for C event log handler am: 8eaaac0103
am: 8b4cab3f69

Change-Id: I2760c8480818f30dd126e7cfbb900a0f5796c8b1
2016-09-30 22:12:28 +00:00
Mark Salyzyn
ff2dcd9af9 system/core Replace log/log.h with android/log.h
Should use android/log.h instead of log/log.h as a good example
to all others.  Adjust header order to comply with Android Coding
standards.

Test: Compile
Bug: 26552300
Bug: 31289077
Change-Id: I33a8fb4e754d2dc4754d335660c450e0a67190fc
2016-09-30 12:47:05 -07:00
Mark Salyzyn
66ce3e08c5 system/core Replace cutils/log.h with android/log.h
Should use android/log.h instead of cutils/log.h as a good example
to all others.  Adjust header order to comply with Android Coding
standards.

Test: Compile
Bug: 26552300
Bug: 31289077
Change-Id: I2c9cbbbd64d8dccf2d44356361d9742e4a9b9031
2016-09-30 12:47:05 -07:00
Mark Salyzyn
23ed4c242a libcutils: Replace cutils/log.h with android/log.h
Replace references to cutils/log.h and log/log.h with android/log.h.
Point cutils/log.h to android/log.h. Adjust header order to comply
with Android Coding standards.

Test: Compile
Bug: 26552300
Bug: 31289077
Change-Id: I4b00c0dff3a0a50cbb54301fdc5a6c29c21dab65
2016-09-30 12:47:05 -07:00
Mark Salyzyn
6584d0a35a liblog: Replace log/log.h with android/log.h
Move all liblog related content into android/log.h, and make
log/log.h points to android/log.h.

Test: Compile
Bug: 26552300
Bug: 31289077
Change-Id: I858e0ebe047b86f2a8530a99bc9c380d3d58edbb
2016-09-30 12:47:05 -07:00
Mark Salyzyn
a166708d15 liblog: logcat: Replace log/logd.h with log/log.h
Should use log/log.h and in some cases android/log.h instead. Can
not remove file because still in use by partners, so log/logd.h
points to log/log.h.

Test: Compile
Bug: 26552300
Bug: 31289077
Change-Id: I3580d46154617abb7231027a44f4ab9ee023febf
2016-09-30 12:47:05 -07:00
Mark Salyzyn
004cd3c55d liblog: logd: logcat: deprecate log/log_read.h
Always used in combination with log/logger.h except in log_time.cpp,
and not used externally.  As a result liblog has to support stl, a
small price to pay since goal is to convert liblog to C++ internally.

Test: compile
Bug: 31456426
Bug: 26552300
Bug: 31289077
Change-Id: I72828ec807d0a2c8e40bbdebd7a69f147a7ca5a9
2016-09-30 12:47:05 -07:00
Mark Salyzyn
8eaaac0103 liblog: Add C++ wrapper for C event log handler
Add android_log_event_context class.

Test: in context of 'logd: add getEventTag command and service'
Bug: 31456426
Bug: 26552300
Bug: 31289077
Bug: 19235719
Change-Id: Icf918b443f01e04040c8d3efe0cdb7a8e70be10c
2016-09-30 12:47:05 -07:00
Miodrag Dinic
53be7eb3d0 Merge "[qemu]: Fix payload size format in qemu_pipe_frame_send()" am: e5976bea7a am: 8c274361fb
am: f610eaac14

Change-Id: I890fbb885044e82d4ec66a5a400240124003ac25
2016-09-30 18:00:16 +00:00
Miodrag Dinic
f610eaac14 Merge "[qemu]: Fix payload size format in qemu_pipe_frame_send()" am: e5976bea7a
am: 8c274361fb

Change-Id: I7c80343b0002ec68ef9cde40dad2202aa9b70c00
2016-09-30 17:49:11 +00:00
Miodrag Dinic
192be1dcae [qemu]: Fix payload size format in qemu_pipe_frame_send()
The following change introduced regression for booting AOSP
on emulator for all architectures:

7c7990e Fix warnings in system/ headers

qemu_pipe expects payload size in the message header to be in hex format,
as stated in the comment for qemu_pipe_frame_send().

Change-Id: I32cfa9c9b2af56f93bbda0ea5597451c389ae45e
Signed-off-by: Miodrag Dinic <miodrag.dinic@imgtec.com>
2016-09-30 13:58:11 +02:00
Colin Cross
0763c30289 Merge "Fix more system/core/include warnings" am: 18fbd80504 am: 5fe194a9fd
am: b5ca47989c

Change-Id: I8d5a602f94bc57866aa3827cc508c94afb4ac4ba
2016-09-29 17:58:08 +00:00
Colin Cross
b5ca47989c Merge "Fix more system/core/include warnings" am: 18fbd80504
am: 5fe194a9fd

Change-Id: I8e561ab27f93ed10efa8a0e864cd7d1283bb6163
2016-09-29 17:42:19 +00:00
Colin Cross
18fbd80504 Merge "Fix more system/core/include warnings" 2016-09-29 17:20:30 +00:00
Mark Salyzyn
ae1612c54c Merge "liblog: fix errno issues with event tag map" am: dfd30c4a16 am: 930ff186ce
am: 71b38def04

Change-Id: I83de9e374a67946fde8191d63720b102690d468f
2016-09-28 18:21:01 +00:00
Mark Salyzyn
71b38def04 Merge "liblog: fix errno issues with event tag map" am: dfd30c4a16
am: 930ff186ce

Change-Id: Iac84f40e9e79063bee7f213eb21ff5f866462a32
2016-09-28 18:17:49 +00:00
Colin Cross
1811d156e9 Fix more system/core/include warnings
The warnings in these files were hidden by -isystem
framework/native/include.

Bug: 31752268
Test: m -j
Change-Id: I2a54376aea380ee24e6483fb7d35fdfe8991c490
2016-09-27 16:21:12 -07:00
Mark Salyzyn
70a83dc7b3 liblog: fix errno issues with event tag map
Cleanup.

Save the errno for the calls that fail, and reinstate them for
return. Drop fprintf stutter, one succinct line. Solve a memory
leak in close.  Change android_lookupEventTag() to use an
unsigned int so that we can use the full range of uint32_t tags.

Make sure this file compiles clean in C++.

Test: gTest liblog-unit-tests
Bug: 30963384
Bug: 31456426
Change-Id: I6a5efa6fb7e991431caba75ef0971e111968f6bf
2016-09-26 09:23:55 -07:00
Chia-I Wu
fd3ea3d118 Add native_handle_clone
libhwbinder's Parcel::readNativeHandleNoDup returns a temporary
native_handle_t.  We want a way to save the temporary handle for later
use.

Change-Id: I16f32043aa8b7d2c0aa57d67551500259b411410
2016-09-26 21:59:04 +08:00
David Pursell
7bc0052ff1 Merge "Flattenable: switch from assignment to memcpy()." am: b2356a6993 am: bb276d8555
am: 9f106bece8

Change-Id: I43e4e5c6bb0aa1fd23a1d0d9776c9e2c8028527e
2016-09-23 22:56:01 +00:00
David Pursell
9f106bece8 Merge "Flattenable: switch from assignment to memcpy()." am: b2356a6993
am: bb276d8555

Change-Id: I2d7317f601dcfc85705f2e71408c314de55a0f69
2016-09-23 22:53:48 +00:00