Commit Graph

24183 Commits

Author SHA1 Message Date
Treehugger Robot 392a2c8f0f Merge "Add 0X as a valid hex prefix for parseint" 2016-10-08 10:36:02 +00:00
Dimitry Ivanov afda14e61d Merge "Revert "Revert "Revert "Revert "Remove liblog from libcutils as a whole static lib""""" 2016-10-08 07:51:33 +00:00
Chia-I Wu e8f6c7398b Merge "Add native_handle_clone" 2016-10-08 01:25:35 +00:00
Josh Gao 218f7fb68e debuggerd: report crashes even when out of file descriptors.
Use nasty clone hacks to let us close random file descriptors to be
able to connect to debuggerd when the fd table is full.

Bug: http://b/32013594
Test: crasher exhaustfd-SIGSEGV
Change-Id: I47772e9a5994da4473bd935b105d9c36827c017a
2016-10-07 18:04:05 -07:00
Yifan Hong 89fbd6349f Add 0X as a valid hex prefix for parseint
Bug: 31983995

Test: make android.hardware.tests.expression@1.0
Change-Id: I526d73f96c519f84dec93befa442b1d2fff7979b
2016-10-07 16:50:16 -07:00
Tao Bao 3b5fbd8331 mkbootfs: Fix the default st_mode for root directory.
CL in [1] fixed the wrong mode for the root directory from 0644 to 0755.
However it only handles the path by calling mkbootfs with canned
fs_config (i.e. with -f flag). When calling mkbootfs without -f flag, it
still treats the root directory as a file. This renders the generated
boot/recovery images w/ and w/o -f being different, and leads to the
incorrect checksums in /system/bin/install-recovery.sh.

[1] commit aa8f2f65a030f71506277e2a8d64d83a099e9feb.

Bug: 31988535
Test: `make dist` and verify the checksums in /system/bin/install-recovery.sh.

Change-Id: Ib50fadb23367da0b46944ae0579093da21412593
2016-10-07 16:14:27 -07:00
Glenn Kasten 2de796491a Traverse /etc/init in a well-defined order
Bug: 31996208
Test: will need a CTS, not yet done
Change-Id: I5ecc7f0519d42a83065b7b97a31cdb5b33549cda
2016-10-07 13:56:37 -07:00
Treehugger Robot 8caf4e7443 Merge "adb: rationalize types." 2016-10-07 20:35:00 +00:00
Christopher Ferris d6b0d37549 Small clean up of fuse code.
- Add TEMP_FAILURE_RETRY around all relevant system calls.
- Cleanup some of the read calls.
- Add error log messages when read/write calls do not actually read/write the
  expected number of bytes.
- Add error messages for write failures in fuse_status/fuse_replay.

Test: Attached to the sdcard process and stepped through most of the modified
Test: code. Also, create/read/write/delete files in /storage/emulated/0
Test: directory.

Change-Id: I73e4c0db861960f4c0af1bf96b06cd61fa74be69
2016-10-07 12:16:00 -07:00
Dimitry Ivanov 625484ddfa Revert "Revert "Revert "Revert "Remove liblog from libcutils as a whole static lib""""
This reverts commit 6a452917b3.

Bug: http://b/31289077
Bug: http://b/27171986
Change-Id: Id020fa10c50847bf16a2fcbc7d5e72cf8766b711
2016-10-07 18:43:37 +00:00
Colin Cross 62c9101646 Merge "libsparse: output_file.c, fix large data chunk issue" 2016-10-07 17:17:10 +00:00
John Reck b02a355d10 Merge "Revert "Revert "Revert "Remove liblog from libcutils as a whole static lib"""" 2016-10-07 16:32:38 +00:00
John Reck 6a452917b3 Revert "Revert "Revert "Remove liblog from libcutils as a whole static lib"""
This reverts commit 595c1480d0.

Revert reason: broke bullhead-eng build in master

Change-Id: Ie64fc31c3c971366ab9f2543b91b8f5d2040868b
2016-10-07 16:22:38 +00:00
Josh Gao 06d61d4d96 adb: rationalize types.
Use fixed length types for structs going over the wire, constify
arguments where possible, use char* instead of unsigned char* for
apacket data, and assorted other refactoring.

Bug: http://b/29273531
Test: python test_device.py with every combination of old/new adb and adbd
Change-Id: I0b6f818a32be5386985aa4519f542003cf427f9d
2016-10-06 14:50:02 -07:00
Treehugger Robot 4a8b178c97 Merge "adb: split up adb_auth.cpp." 2016-10-06 19:37:31 +00:00
Josh Gao 3bd2879d8e adb: split up adb_auth.cpp.
All of the functions in adb_auth.cpp were used in only one of
adb/adbd. Split up them up into adb_auth_host.cpp and adbd_auth.cpp
respectively.

Bug: http://b/29273531
Test: built and flashed bullhead, adb still works
Change-Id: Ib610c5157522634cc273511175152f1306cc52a7
2016-10-06 12:36:26 -07:00
Jeremy Compostella fca594c2de libsparse: output_file.c, fix large data chunk issue
CHUNK_HEADER structure type allows DATA chunk to be up to MAX_UINT
large.

The write() callback LEN parameter should be unsigned int.

Also:
- write() callback should continue to write data if less than expected
  data have been written.
- gzerror() returns LEN on success, 0 otherwise

Test: manual
Change-Id: Id46d664b84c1a506f419524fe28055f784c2ae7a
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
2016-10-06 09:53:42 -07:00
Treehugger Robot 8949696d33 Merge "Revert "Revert "Remove liblog from libcutils as a whole static lib""" 2016-10-06 14:20:41 +00:00
Treehugger Robot d3754ff696 Merge "logd: report logging memory overhead" 2016-10-06 14:15:48 +00:00
Dimitry Ivanov 595c1480d0 Revert "Revert "Remove liblog from libcutils as a whole static lib""
This reverts commit f93d732a45.

Bug: http://b/31289077
Bug: http://b/27171986
Change-Id: Ib6e6c0a01296f0a01d98cbf1a9d2659883280d44
2016-10-06 12:47:07 +00:00
Treehugger Robot 9f828a5383 Merge "adb: Remove the obsolete include path to ext4_utils." 2016-10-06 06:18:45 +00:00
Tao Bao fee161d189 adb: Remove the obsolete include path to ext4_utils.
Since commit 8ad80763e4 has removed
'#include "ext4_sb.h"', there's no more reference to ext4_utils headers.

Test: `mmma system/core/adb`

Change-Id: I7ca1a6e91f1e0de84238c2a7facbebe9600a3d87
2016-10-05 18:06:03 -07:00
Mark Salyzyn 9af33ee78c logd: report logging memory overhead
On 64 bit system, calculates to roughly 80 bytes of metadata and
list overhead for each entry.

In unit test example, we report 3388987 bytes of logging data and
overhead total, showmap reports 4652K of dirty data. We still want
to account for the remainder (fragmentation, other sources of
internal allocations etc).

Test: see values and check math
Bug: 31942525
Change-Id: I75f3162ce691faf1ae5a5dec18939fea535ede7e
2016-10-05 15:32:40 -07:00
Treehugger Robot 0d762648d0 Merge "Base: Hand complete log message to aborter" 2016-10-05 19:53:25 +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
Treehugger Robot 891d0ba904 Merge "Modify log level for service and ueventd" 2016-10-05 04:34:42 +00:00
Andreas Gampe b4e32f3b33 Base: Hand complete log message to aborter
Undo zero-termination-substitution for linebreaks when logging.
This results in handing the complete log message to the aborter.
Add a test.

Bug: 31893081
Test: mmma system/core/base && $ANDROID_HOST_OUT/nativetest64/libbase_test/libbase_test64
Change-Id: I2ef6c6351db2fd494a02985f634f439104136227
2016-10-04 19:19:59 -07:00
Wei Wang a285dac9c0 Modify log level for service and ueventd
Bug: 31938558
Test: flash and take a boot log
Change-Id: I5c6823614e1df760128519dfb294f3a44efa6bac
2016-10-04 14:50:48 -07:00
Mark Salyzyn 1f90485804 Merge "system/core: drop or replace log/logger.h" 2016-10-04 18:27:46 +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 093951a230 Merge "liblog: logd: Add android_lookupEventTag_len()" 2016-10-03 22:34:15 +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 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
Treehugger Robot 57513bd5a3 Merge "Log failed load_properties_from_file calls." 2016-10-01 01:06:25 +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 07607c04ff Merge changes I0c25e038,I33a8fb4e,I2c9cbbbd,If4c9711e,I4b00c0df, ...
* changes:
  liblog: Move liblog tag from 1005 to 1006
  system/core Replace log/log.h with android/log.h
  system/core Replace cutils/log.h with android/log.h
  logd: logcat: Replace log/log.h with android/log.h
  libcutils: Replace cutils/log.h with android/log.h
  liblog: Replace log/log.h with android/log.h
  liblog: logcat: Replace log/logd.h with log/log.h
  liblog: logd: logcat: deprecate log/log_read.h
  liblog: Add C++ wrapper for C event log handler
2016-09-30 22:05:17 +00:00
Mark Salyzyn 9633b919d7 liblog: Move liblog tag from 1005 to 1006
Allow logd to add another "consecutive" log tag

Test: gTest liblog-unit-tests, check for liblog in logcat afterwards
Bug: 31456426
Change-Id: I0c25e038878ec9a0cf368a33a63f8345c68749c3
2016-09-30 12:47:05 -07: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 0dd4431072 logd: logcat: 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.

Test: Compile
Bug: 26552300
Bug: 31289077
Change-Id: If4c9711eb57267d4707b03d54a932af9de241b13
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
Treehugger Robot e5976bea7a Merge "[qemu]: Fix payload size format in qemu_pipe_frame_send()" 2016-09-30 17:39:48 +00:00