Commit Graph

26768 Commits

Author SHA1 Message Date
Mohan Srinivasan 03a7950fda Merge "liblog: logd: Add android_lookupEventTag_len()" am: 093951a230 am: aed39f1f3d am: 2acb41b46c
am: 96eba22338

Change-Id: I5321bf766ac59f0ecc34bb3623440621a6a7ab1d
2016-10-03 22:50:09 +00: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
Mohan Srinivasan aed39f1f3d Merge "liblog: logd: Add android_lookupEventTag_len()"
am: 093951a230

Change-Id: I2e9a3c1132dc7cd6e22d55cc2983720f7b8510b9
2016-10-03 22:40:19 +00:00
Dimitry Ivanov 2b91e262f8 Merge "Revert "Remove liblog from libcutils as a whole static lib"" am: d4446ccce8 am: 3e5bb6dc6e am: 1814d808f3
am: 897fa44319

Change-Id: Ib57efea490b8df2aed2e3c7dd8c3344e2101a942
2016-10-03 22:36:08 +00:00
Mohan Srinivasan 093951a230 Merge "liblog: logd: Add android_lookupEventTag_len()" 2016-10-03 22:34:15 +00:00
Dimitry Ivanov 897fa44319 Merge "Revert "Remove liblog from libcutils as a whole static lib"" am: d4446ccce8 am: 3e5bb6dc6e
am: 1814d808f3

Change-Id: If6507fc771cce958f0cbfe7ecc18407826494326
2016-10-03 22:33:41 +00:00
Dimitry Ivanov 1814d808f3 Merge "Revert "Remove liblog from libcutils as a whole static lib"" am: d4446ccce8
am: 3e5bb6dc6e

Change-Id: I6ec33c2aefa86f088701340b73205efab82a422d
2016-10-03 22:28:37 +00:00
Dimitry Ivanov 3e5bb6dc6e Merge "Revert "Remove liblog from libcutils as a whole static lib""
am: d4446ccce8

Change-Id: I6bd8c8756d0318ac5b78395bc3c6fdcee11d2ec0
2016-10-03 22:26:06 +00:00
Dimitry Ivanov d4446ccce8 Merge "Revert "Remove liblog from libcutils as a whole static lib"" 2016-10-03 22:21:19 +00:00
Dimitry Ivanov f93d732a45 Revert "Remove liblog from libcutils as a whole static lib"
This reverts commit 6dd58c00ca.

Bug: http://b/31289077
Bug: http://b/27171986
Change-Id: I519d77de118f02346a4f89b197ca4df7e9f883ac
2016-10-03 22:18:49 +00:00
Dimitry Ivanov b5fcb1154c Merge "Remove liblog from libcutils as a whole static lib" am: dd01f980e5 am: 7e06b19328 am: e9f4c175f3
am: 17c88c7743

Change-Id: Ia9a48d5018946f16d233e7c068def79b7c7bbeb4
2016-10-03 18:55:14 +00:00
Dimitry Ivanov 17c88c7743 Merge "Remove liblog from libcutils as a whole static lib" am: dd01f980e5 am: 7e06b19328
am: e9f4c175f3

Change-Id: I3b71d2aeb0591937a3ee974fb5fdaa868c03bd29
2016-10-03 18:47:14 +00:00
Dimitry Ivanov e9f4c175f3 Merge "Remove liblog from libcutils as a whole static lib" am: dd01f980e5
am: 7e06b19328

Change-Id: I4c8f090dc4c92075c6cc370ea701197633df2bcd
2016-10-03 18:41:56 +00:00
Dimitry Ivanov 7e06b19328 Merge "Remove liblog from libcutils as a whole static lib"
am: dd01f980e5

Change-Id: I9fdba3d75802889ca3f9d9aa4ed7d708023f1e27
2016-10-03 18:37:56 +00:00
Dimitry Ivanov dd01f980e5 Merge "Remove liblog from libcutils as a whole static lib" 2016-10-03 18:26:45 +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
Dimitry Ivanov 6dd58c00ca Remove liblog from libcutils as a whole static lib
libcutils no longer needs to export liblog symbols.

Bug: http://b/31289077
Bug: http://b/27171986
Test: make
Change-Id: I546a5bce56c0c88ac2493c320298d4dc13954566
2016-10-03 03:07:13 -07:00
Elliott Hughes 082b4efc41 Merge "Log failed load_properties_from_file calls." am: 57513bd5a3 am: 9abb85ebe0 am: 6d60731271
am: 5c54bb548a

Change-Id: Ie392c70cd6117fcdb7f36dd0bd77f59f56e846bc
2016-10-01 01:25:48 +00:00
Elliott Hughes 5c54bb548a Merge "Log failed load_properties_from_file calls." am: 57513bd5a3 am: 9abb85ebe0
am: 6d60731271

Change-Id: I603025e42824e11817042d98ad7a7387b83fe99c
2016-10-01 01:23:18 +00:00
Elliott Hughes 6d60731271 Merge "Log failed load_properties_from_file calls." am: 57513bd5a3
am: 9abb85ebe0

Change-Id: Icebec299d2f3f5b02654bba12fdd28ea0199a61f
2016-10-01 01:18:15 +00:00
Elliott Hughes 9abb85ebe0 Merge "Log failed load_properties_from_file calls."
am: 57513bd5a3

Change-Id: I7cdf54c423c6aa35fb061af31a0bab42614b2768
2016-10-01 01:14:43 +00:00
Treehugger Robot 57513bd5a3 Merge "Log failed load_properties_from_file calls." 2016-10-01 01:06:25 +00:00
Mark Salyzyn 44a305a13d Merge changes I0c25e038,I33a8fb4e,I2c9cbbbd,If4c9711e,I4b00c0df, ... am: 07607c04ff am: e2af341f50 am: a73f9fab1b
am: 8a0531fe92

Change-Id: I256aacbfc4f168297bb6d24b505943cc6140e1d6
2016-10-01 00:43:38 +00:00
Mark Salyzyn 8e9c455b74 liblog: Move liblog tag from 1005 to 1006 am: 9633b919d7 am: 4fd110d878 am: f1d6ffabac
am: 3adbc9e7f3

Change-Id: I42c09c6fb1ba59defaa20767c8ff63b87107d040
2016-10-01 00:43:32 +00:00
Mark Salyzyn 7a7b066e5e system/core Replace log/log.h with android/log.h am: ff2dcd9af9 am: cac331afd9 am: 0308b0eabd
am: 9f6b98dec0

Change-Id: I1a1384253e4fce0489b7d1aa77b0f67ee12185c3
2016-10-01 00:43:22 +00:00
Mark Salyzyn 4bf372ae30 system/core Replace cutils/log.h with android/log.h am: 66ce3e08c5 am: eb189f147b am: 16f7786032
am: 0abff8fc61

Change-Id: I8c9d221094f0c27838e120aeb41fff276fbab4b2
2016-10-01 00:43:07 +00:00
Mark Salyzyn c1378523ad logd: logcat: Replace log/log.h with android/log.h am: 0dd4431072 am: 0f76f04072 am: a8d0a46956
am: c0a92b4a94

Change-Id: Ib413644ea8b74353030007a7068045849cf8b534
2016-10-01 00:42:52 +00:00
Mark Salyzyn 5c1281350f libcutils: Replace cutils/log.h with android/log.h am: 23ed4c242a am: f56fce0240 am: 9fd2eaf827
am: 9bb1f2f915

Change-Id: I3d1b88a3717cbb04573ccc8f4696aecf72bb2a93
2016-10-01 00:42:36 +00:00
Mark Salyzyn 49db2170be liblog: Replace log/log.h with android/log.h am: 6584d0a35a am: 499a33d6dc am: c528ac0fe8
am: 2156aae1d5

Change-Id: Ib795c30add8a1076a63f852fa4dedecf5c2a5231
2016-10-01 00:42:21 +00:00
Mark Salyzyn e083d36696 liblog: logcat: Replace log/logd.h with log/log.h am: a166708d15 am: 772ed1c63c am: 2b42b87d8c
am: ea3c6d1029

Change-Id: Ic7f57bc44007de93ceba3cd55884373055b74e6d
2016-10-01 00:42:05 +00:00
Mark Salyzyn 92820f1466 liblog: logd: logcat: deprecate log/log_read.h am: 004cd3c55d am: 78a459a8c8 am: 13c68b09d9
am: a06a6509d9

Change-Id: Ia0980d6bccd2c7af64c659d56047bd445be634e7
2016-10-01 00:41:48 +00:00
Mark Salyzyn a30f5f5720 liblog: Add C++ wrapper for C event log handler am: 8eaaac0103 am: 8b4cab3f69 am: 848da90978
am: 519bdbf0b4

Change-Id: Ia0b6074dc10d7d51df0c9410d1a812514b01e0e0
2016-10-01 00:41:33 +00:00
Elliott Hughes 5a7ad84ede Log failed load_properties_from_file calls.
These events are _somewhat_ normal, in that not all devices have all
partitions, but not logging anything makes it unnecessarily hard for
folks to debug simple failures.

Bug: http://b/31186390
Test: booted, checked dmesg
Change-Id: I403377c585ea35cfe73b0bed9443b75e3a84dc8d
2016-09-30 16:30:00 -07:00
Mark Salyzyn 8a0531fe92 Merge changes I0c25e038,I33a8fb4e,I2c9cbbbd,If4c9711e,I4b00c0df, ... am: 07607c04ff am: e2af341f50
am: a73f9fab1b

Change-Id: I6bfef6c616c5cd3a2b3cacf9cf9aea64eba46c0d
2016-09-30 22:18:47 +00:00
Mark Salyzyn 3adbc9e7f3 liblog: Move liblog tag from 1005 to 1006 am: 9633b919d7 am: 4fd110d878
am: f1d6ffabac

Change-Id: Ib7d8bb725394f7ac6970b4869bb5043a306bbbe7
2016-09-30 22:18:32 +00: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 c0a92b4a94 logd: logcat: Replace log/log.h with android/log.h am: 0dd4431072 am: 0f76f04072
am: a8d0a46956

Change-Id: I7c43316eef4ae12e666ea6a0126a38ac571dd41e
2016-09-30 22:17:47 +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 a73f9fab1b Merge changes I0c25e038,I33a8fb4e,I2c9cbbbd,If4c9711e,I4b00c0df, ... am: 07607c04ff
am: e2af341f50

Change-Id: Idc6826ee5b5d51375a84f8c2297b25dcb2098c64
2016-09-30 22:13:12 +00:00
Mark Salyzyn f1d6ffabac liblog: Move liblog tag from 1005 to 1006 am: 9633b919d7
am: 4fd110d878

Change-Id: Iee4cb5c19442090a9dde6550c3994b9f1e97f1a2
2016-09-30 22:13:06 +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 a8d0a46956 logd: logcat: Replace log/log.h with android/log.h am: 0dd4431072
am: 0f76f04072

Change-Id: I3eef766f72fa363097556d90962c6f42fc49e3ea
2016-09-30 22:12:50 +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