Commit graph

1090 commits

Author SHA1 Message Date
Elliott Hughes
bf082ffb71 Merge "Updated trace.h to recognize ATRACE_TAG_BIONIC." 2014-05-28 21:35:57 +00:00
Mark Salyzyn
811f2c0b98 Merge "system/window.h: add deprecation warnings" 2014-05-28 19:25:15 +00:00
Brigid Smith
8c82b35239 Updated trace.h to recognize ATRACE_TAG_BIONIC.
Bug: 15116468
Change-Id: If8d4971505ffe5cbc193c6ad71618a5adb8192b6
2014-05-27 12:37:48 -07:00
Torne (Richard Coles)
234f696ea7 Add UID and directory for RELRO sharing support.
Define a UID to be used by the process responsible for creating shared
RELRO files for the WebView native library, and create a directory owned
by that UID to use to store the files.

Bug: 13005501
Change-Id: I5bbb1e1035405e5534b2681f554fe16f74e3da1a
2014-05-27 14:00:29 +01:00
Mark Salyzyn
289e111a00 system/window.h: add deprecation warnings
Change-Id: I38de3d281f28e0750b4abb86f28509f98dfc7a72
2014-05-23 15:10:06 -07:00
Mark Salyzyn
4887842c92 include: cleanup for -Wsystem-header
- warnings as errors, or errors introduced when -Wsystem-header
  was experimentally introduced.

Change-Id: Ia8f5b3c1c1096e191741223d52526aa48c7f1cc4
2014-05-23 15:09:57 -07:00
Colin Cross
617c28b8f2 Merge "Fix list_for_each_safe macro" 2014-05-22 22:27:14 +00:00
Colin Cross
4ecbda41c9 Merge "Add list_add_head to libcutils" 2014-05-22 22:26:43 +00:00
Dan Albert
ac2fe7eb81 Add missing headers
These headers are needed for pid_t and free when using libc++ headers (POSIX
does not require that the symbols be exposed with the previous includes).

Change-Id: Ia51a4fdfdbae7377130a43c401c2d8d241671d1e
2014-05-21 20:08:35 -07:00
Sreeram Ramachandran
91dc3369d3 Move netd_client into netd.
(cherry picked from commit f1b21c5c73)

Change-Id: Ie4b6b303225c93f2448a503d6ea9cebb552cbad5
2014-05-21 09:26:57 -07:00
Ken Lierman
aecc6a6657 Bound the ADB connect time with a non-blocking connect
After a disconnect, the initial blocking connect takes
a long time to return, while subsequent calls return
quicks.  Switch to a non-blocking connect to make the
re-connect time more consistent and faster overall.

Change-Id: I21d02b22a8eb9a457c2f1fa95eb17894d5612ccd
Signed-off-by: Ken Lierman <ken.lierman@windriver.com>
Reviewed-by: Gumbel, Matthew K <matthew.k.gumbel@intel.com>
Reviewed-by: Jovanovic, Radivoje <radivoje.jovanovic@intel.com>
Reviewed-by: Boie, Andrew P <andrew.p.boie@intel.com>
2014-05-19 16:16:42 -07:00
Sreeram Ramachandran
154ebe80a0 Introduce netd_client, a dynamic library that talks to netd.
This library is dynamically loaded and used by bionic, to replace selected
standard socket syscalls with versions that talk to netd.

Implement connect() by requesting that the socket be marked with the netId of
the default network and then calling through to the actual syscall.

There are two escape hatches:

+ If the fwmark server is unavailable, it isn't an error; we proceed with the
  syscall. This might help at boot time (when the server isn't ready yet) and if
  we get rid of the fwmarkd socket entirely in future platform versions.

+ If the ANDROID_NO_USE_FWMARK_CLIENT environment variable is set, we don't
  attempt to use the fwmark server (even if it's available). This allows apps to
  sidestep unforseen issues in production at runtime.

(cherry picked from commit 0581cb455ef924f128a5c6d46bc70868b5099eec)

Change-Id: Ib6198e19dbc306521a26fcecfdf6e8424d163fc9
2014-05-14 11:13:53 -07:00
Samuel Ortiz
f8a1089ab5 Add list_add_head to libcutils
Adds a node to the head of the linked list.

Change-Id: I03fc81f348c5c4fdab8680928b6e353413e4bc3c
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Yong Yao <yong.yao@intel.com>
2014-05-13 21:37:35 +00:00
Thierry Escande
8cc7427040 Fix list_for_each_safe macro
The second macro parameter is named 'next' like listnode structure
'next' field. Since the precompiler will expand all 'next' occurrences
in the macro definition with what is passed by the caller, it is not
possible to call this macro with something else than 'next' as second
parameter.

This patch replaces the 'next' parameter with 'n' allowing use of a
next node not named 'next'.

Change-Id: I78c859caf8193f21fe0bedaeaa8342d6e89ad14b
Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2014-05-10 09:31:52 -07:00
Christopher Ferris
afa9c9cd72 Fix ucontext_t forward declare for mac.
Change-Id: I30470f5cc25553dee25d4858f64ec5af13aa20c9
2014-05-09 13:19:34 -07:00
Christopher Ferris
b138037b26 Fix mac build.
Forward declare ucontext_t so that it's not necessary for ucontext.h
to be included in the global header.

Change-Id: Ic13677dd572ab1acd927f0a17b284f9b417a642f
2014-05-09 11:04:09 -07:00
Christopher Ferris
3a088524cb Merge "Rewrite unwind thread handling." 2014-05-09 16:33:12 +00:00
Christopher Ferris
a2efd3ac7a Rewrite unwind thread handling.
This new version doesn't require any specialized thread
implementation, it uses the Current implementation to do its job.
In addition, it runs much faster when multiple threads are trying
to unwind at the same time since the global signal lock is held for
only a small amount of time. Even running through the threads one at
a time should be faster since it no longer requires two passes through
the unwound stacks.

The new code now allows multiple simultaneous unwinds of the
same thread.

Finally, add the ability to unwind from a ucontext_t passed in. This
functionality doesn't work for remote unwinds yet.

Change-Id: I4d181d7ca5ffd2acfd1686e668e6d21e36b425cb
2014-05-08 14:42:16 -07:00
Elliott Hughes
ddbdae8c3f Remove the dead corkscrew header files too.
Change-Id: I0dd5cf3966994db19d98f60805211ed39099465a
2014-05-07 09:38:04 -07:00
Mark Salyzyn
3cb5498785 logd: 64-bit compile issue
- ULONG_MAX is used against an uint32
- Add tv_sec_max and tv_nsec_max constants to log_time

Change-Id: Ic86cd7b0680868ad0536198b71a34cb19134fc22
2014-05-02 14:16:00 -07:00
Elliott Hughes
855fcc3114 Use the si_code value bionic passes us.
Bionic needs to re-raise various signals, which means the si_code
debuggerd sees has been clobbered. If bionic sends us the original
si_code value, we can use that instead of the one we see when the
ptrace the crashed process' siginfo.

Change-Id: If116a6bc667d55a6fb39b74f96673292af4e4c8c
2014-04-25 20:20:39 -07:00
Eric Laurent
b526630ab8 audio: fix audio_is_bluetooth_sco_device()
Bug: 14268964
Change-Id: Ia2a185c5e0939930c5114209651a1e0db6c36ef3
2014-04-24 22:03:00 +00:00
Elliott Hughes
da6b2e2fd7 Improve liblog's fatal logging.
This makes LOG_ALWAYS_FATAL and LOG_ALWAYS_FATAL_IF as good as regular
assert(3).

Change-Id: I0666684d30cae7baf23c64b33d35c1e43f81acf0
2014-04-24 13:28:24 -07:00
Mark Salyzyn
3ad0af6d04 Merge "logd: liblog: logcat: debuggerd: Add LOG_ID_CRASH" 2014-04-17 23:12:10 +00:00
Mark Salyzyn
dfc47e8685 logd: libsysutils: logd startup outside init environment
Change-Id: I3426b6c3eebdd0c8258e966dcaaaa2825d7a23d1
2014-04-17 16:14:24 +00:00
Mark Salyzyn
99f47a9e7c logd: liblog: logcat: debuggerd: Add LOG_ID_CRASH
Change-Id: Iea453764a1a4fc1661f461f10c641c30150e4d20
2014-04-16 15:38:50 -07:00
Narayan Kamath
6b7ab90ca9 Include 64bit valgrind in the android_filesystem_config.
Required so that we set the exectuable bit correctly.

Change-Id: If59bd0ff47d2b4b2b8f92a1c007b4ba414ea1876
2014-04-12 09:11:16 +01:00
Mark Salyzyn
472e04f2b4 Merge "logd: liblog: logcat: enable prune features for user" 2014-04-09 23:33:28 +00:00
Tim Murray
ae83f84548 Add guards to prevent typedefs when C++11 is available.
char32_t and char16_t are both defined in C++11.

Change-Id: I44fe8f4f05f230c18a1b77fa21b6a40c8f8ecc2d
2014-04-07 14:11:21 -07:00
Christopher Ferris
e296091060 Create an UnwindMapLocal object.
The way libunwind handles local unwinds is different from remote unwinds,
so create a new map object to handle the differences.

Add new test to verify the map data is being generated correctly.

Add new tests to check for leaks.

Refactor the BACK_LOGW code into a single header file.

Change-Id: I01f3cbfc4b927646174ea1b614fa25d23b9b3427
2014-04-03 14:19:24 -07:00
Mark Salyzyn
1c95047939 logd: liblog: logcat: enable prune features for user
- Enable whitelist, blacklist and logsize tuneables for user

Change-Id: Id0c283844c71c5263a8cfbebf2e550f7ac415858
2014-04-02 13:12:04 -07:00
Mark Salyzyn
a459d0b0e2 cutils: trace 64-bit compile issues
- switch format to PRId64 for int64_t
- switch format to PRId32 for int32_t

Change-Id: I1e66db06810000936d584ed49234550abd96cdff
2014-03-20 13:02:57 -07:00
Mark Salyzyn
fa3716b250 logd: liblog: logcat: Arbitrary time to tail
Change-Id: I10e8d92c933e31ee11e78d2d1114261a30c4be0e
2014-03-14 10:23:51 -07:00
Mark Salyzyn
dfa7a07f5b logd: liblog: logcat: Add LogWhiteBlackList
- liblog android_logger_get_log_size and android_logger_get_readable_size
  adjusted to return long instead of int because of -G flag extending range

NB: ifdef'd only for userdebug and eng builds

- liblog Add android_logger_[sg]et_prune_list and android_logger_set_log_size
- logcat Add -P, -p and -G flags
- logd Add LogWhiteBlackList and configurable log size

(cherry picked from commit 18a5432158)

Change-Id: I1572338c1b34bd968ad7867857ef708156ec3b6a
2014-03-13 14:48:07 -07:00
Mark Salyzyn
34facab86b logd: liblog: logcat: Add Statistics
- logd add statistical collection and formatting
- liblog add android_logger_get_statistics call
- logcat add -S flag
- logcat add -b all

(cherry picked from commit 51a29c8dc4)

Change-Id: I521753b1969ecd4590c956aeeb1557d101059d67
2014-03-13 14:47:58 -07:00
Alex Ray
157e1b645a libcutils: add method to get klog level
Change-Id: I55e8311bae97703be26e57b415a8ab0a6d9b4361
2014-03-07 13:58:02 -08:00
Mark Salyzyn
7e2f83c0bc logd: liblog: 64-bit issues
- structure packing
- move towards log_time from struct timespec
- extend log_time to cover differences between
  log_time and struct timespec

Change-Id: I106ed0b609917306d170044054b5b32645f2a295
2014-03-05 16:12:28 -08:00
Mark Salyzyn
581edc1b6c set /proc/sys/net/unix/max_dgram_qlen to large value
- init: set /proc/sys/net/unix/max_dgram_qlen to 300
- libsysutils: Add listen backlog argument to startListener
- logd: set listen backlog to 300

Change-Id: Id6d37d6c937ba2d221e76258d89c9516619caeec
2014-03-03 12:48:00 -08:00
Mark Salyzyn
154f4608aa liblog: enable logging to logd.
* Modify liblog to send all messages to the new syslog user
  space daemon.

Original-Change-Id: I0ce439738cd921efb2db4c1d6a289a96bdbc8bc2
Original-Change-Id: If4eb0d09409f7e9be3eb4bb7017073dc7e931ab4
Signed-off-by: Nick Kralevich <nnk@google.com>

* Add a TARGET_USES_LOGD make flag for BoardConfig.mk to manage
  whether logd is enabled for use or not.
* rename syslog to logd to avert confusion with bionic syslog
* Add fake log support back in
* prefilter for logging messages from logd
* Fill in timestamps at logging source
* update abstract log reader
* switch from using suffix for id to v3 format
* log a message when creating devices that a deprecated interface
  is being utilized.

Signed-off-by: Mark Salyzyn <salyzyn@google.com>

(cherry pick from commit 099e2c1f6f706a8600c1cef74cce9066fc315480)

Change-Id: I47929a5432977a1d7235267a435cec0a7d6bd440
2014-02-28 13:49:11 -08:00
Narayan Kamath
26fa5cd39d Merge "AArch64: Use negative values in error enumeration" 2014-02-27 13:18:18 +00:00
Mark Salyzyn
0175b0747a logd: initial checkin.
* Create a new userspace log daemon for handling logging messages.

Original-Change-Id: I75267df16359684490121e6c31cca48614d79856
Signed-off-by: Nick Kralevich <nnk@google.com>

* Merge conflicts
* rename new syslog daemon to logd to prevent confusion with bionic syslog
* replace racy getGroups call with KISS call to client->getGid()
* Timestamps are filed at logging source
* insert entries into list in timestamp order
* Added LogTimeEntry tail filtration handling
* Added region locking around LogWriter list
* separate threads for each writer
* /dev/socket/logd* permissions

Signed-off-by: Mark Salyzyn <salyzyn@google.com>

(cherry picked from commit 3e76e0a497)

Author: Nick Kralevich <nnk@google.com>
Change-Id: Ice88b1412d8f9daa7f9119b2b5aaf684a5e28098
2014-02-26 09:52:35 -08:00
Ashok Bhat
1ee7570052 AArch64: Use negative values in error enumeration
With AArch64 the enumerations with values in the range
0x80000000 to 0x80000007 are being assigned to ssize_t
typed variables which are 64-bit rather than 32-bit, and
are being used in conditions where they are being checked
for being negative. This is not the case when ssize_t is
64-bit, so redefine this to INT32_MIN value.

Change-Id: I7a031a940a28658b3bf34bebac93dfb3ba397b05
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
2014-02-20 14:11:35 +00:00
Stephen Smalley
eb3f421e02 Enable building init with -Wall -Werror.
Eliminates various warnings from SELinux-related code.

Bug: 12587913
Change-Id: I28921f0ebd934324436609540d95ccef58552b64
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2014-02-19 09:15:09 -05:00
Qiming Shi
4bc2f8db0a x86_64: Add atomic funtions
This patch adds atomic functions for x86_64.

Change-Id: I298c760a1e6efa2ce2c61a143f833b6785805442
Signed-off-by: Qiming Shi <qiming.shi@intel.com>
2014-02-11 16:17:39 -08:00
Colin Cross
810d19f99a log: add compile-time checking when ALOGV is disabled
Wrap the call in a if (0) when verbose logging is disabled
to provide compile time checking.

Also add a printf format attribute to the function to warn
if parameters are incorrect.

Change-Id: Ic77edeadcc4d886ca0f8b434f8550e18e22d5901
2014-02-09 21:59:24 -08:00
Elliott Hughes
5c4020005b Revert "Move to the canonical UniquePtr.h."
This reverts commit 2a72c575d2.

Change-Id: Idb485f1be2906e8c1c8f0da3df186a7aade027f6
2014-02-04 23:41:22 +00:00
Elliott Hughes
2a72c575d2 Move to the canonical UniquePtr.h.
Change-Id: I5330c36d2b571acb6d3debd30b8020e33aa8a4a7
2014-02-04 11:58:51 -08:00
Elliott Hughes
e9edf7a0ef LP64 should have debuggerd and debuggerd64.
Change-Id: I4e39c200e6867bb9a5bbcfec1c449b8864028feb
2014-01-31 17:15:10 -08:00
Elliott Hughes
6694d3e3d5 Remove dead code that looked like part of debuggerd.
Note that these were two different functions. The definition was unused,
and the declaration was undefined.

Change-Id: I2edd10a0ab9422cd5252bdb9ccdd726dc5fad531
2014-01-31 10:37:18 -08:00
Pavel Chupin
c6c194ced0 LP64: Enable debuggerd/libbacktrace/libunwind.
Change-Id: I2e432839f86c33c2adbaac8cc12ca8961956044b
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
2014-01-30 17:15:24 -08:00