Commit graph

288 commits

Author SHA1 Message Date
Yabin Cui
4a6e5a3b64 Kill HAVE_PTHREADS.
Bug: 19083585
Change-Id: Ic09eb3dd250bc5c5b63cac7998f99f5fa007f407
2015-01-27 14:23:22 -08:00
Christopher Ferris
9774df6134 Move 32 bit/64 bit check into debuggerd.
On 64 bit systems, calls to dump_backtrace_to_file or dump_tombstone
try and directly contact the correct debuggerd (32 bit vs 64 bit)
by reading the elf information for the executable.
Unfortunately, system_server makes a call to dump_backtrace_to_file
and it doesn't have permissions to read the executable data, so it
defaults to always contacting the 64 bit debuggerd.
This CL changes the code so that all dump requests go to the 64 bit
debuggerd, which reads the elf information and redirects requests for
32 bit processes to the 32 bit debuggerd.

Testing:

- Forced the watchdog code in system_server to dump stacks and
  verified that all native stacks are dumped correctly.
- Verified that dumpstate and bugreport still properly dump the native
  processes on a 64 bit and 32 bit system.
- Intentionally forced the 64 bit to 32 bit redirect to write only a
  byte at a time and verified there are no errors, and no dropped data.
- Used debuggerd and debuggerd64 to dump 32 bit and 64 bit processes
  seemlessly.
- Used debuggerd on a 32 bit system to dump native stacks.

Bug: https://code.google.com/p/android/issues/detail?id=97024
Change-Id: Ie01945153bdc1c4ded696c7334b61d58575314d1
2015-01-20 17:22:07 -08:00
Elliott Hughes
f21717cd87 Remove unused cruft from libcutils.
Change-Id: I316d39e8e0a9aa385d8e1f37678b8bf2c03441eb
2015-01-15 21:16:03 -08:00
Jeff Sharkey
9f72ef8944 Merge "Extend to receive NFLOG packets." 2015-01-16 01:11:02 +00:00
Christopher Ferris
fa41e0f5c8 Add timed versions of stack dumping functions.
Under some unknown circumstances, debuggerd could become unresponsive.
If you try and take a bugreport during this time, it will hang forever.
Adding functions that have a timeout will allow dumpstate to stop if
dumping is taking too long.

Bug: 18766581

(cherry picked from commit 5f2ff6a910)

Change-Id: I39e8e9c60209e3ef9efac795fedb8e1edce2bd3e
2015-01-15 15:34:21 -08:00
Jeff Sharkey
9a20e67fa6 Extend to receive NFLOG packets.
Packets captured and logged by the NFLOG target are unicast, so
extend to catch and decode them.  To avoid escaping issues, the raw
contents are passed around as hex strings.

Bug: 18335678
Change-Id: Ib7299500baa00080a1f000f9da843eb527363353
2015-01-15 12:50:59 -08:00
Elliott Hughes
ae52165490 Remove HAVE_LIBC_SYSTEM_PROPERTIES and HAVE_SYSTEM_PROPERTY_SERVER.
Change-Id: I3d92dbecebd2bb449a8c4332de684919a58847ad
2015-01-12 13:56:34 -08:00
Elliott Hughes
3906c8511e You either have winsock or <sys/sockets.h>.
There is no third choice.

Change-Id: I8f1206f22798f747896dd53f3081cdfa4b1707c4
2015-01-09 12:21:51 -08:00
Elliott Hughes
c3914d2be2 Remove atomic-inline.h.
Change-Id: I3ac0229b9c516744e6a9c9d9e795b43bc9c5636b
2014-11-17 14:38:56 -08:00
Elliott Hughes
e9ca709a73 Remove the error-prone TARGET_CPU_SMP from system/core.
This means that code that uses libcutils no longer has to ensure that
it's set ANDROID_SMP in the calling code's Android.mk for this to
function correctly.

Change-Id: I80c7ff170cd621106f34d6b74689d6b4f03e4eb7
2014-11-17 11:16:59 -08:00
Hans Boehm
c56648948c Second attempt to "Rewrite atomic.h to use stdatomic.h."
This should not be committed until win_sdk and aarch64 builds are
fixed in the presence of this CL.

This reverts commit 2789faabfa.

We additionally remove uniprocessor support from the earlier CL,
thus avoiding a potential compiler code reordering issue.

Change-Id: I7207a5ca2efa907a6f757f172d7090a62b2311fe
2014-11-13 15:59:10 -08:00
Chih-Hung Hsieh
c37387a4cd am 07f1300c: am 7979f1ce: Merge "Do not inline rarely used trace function bodies."
* commit '07f1300c4c4f7d3c0df540bf8df3443c3f4539cd':
  Do not inline rarely used trace function bodies.
2014-10-15 17:57:07 +00:00
Chih-Hung Hsieh
2d3150e736 Do not inline rarely used trace function bodies.
When atrace_* functions are inlined,
the rarely used 1024-byte buffers are allocated on stack.

BUG: 17444504
Change-Id: I773512aeb70e8b79f3803c6d59cba064d2aa65b6
2014-10-14 15:37:20 -07:00
Hans Boehm
f381920b58 am 072877af: am 41198eea: Merge "Revert "Rewrite atomic.h to use stdatomic.h.""
* commit '072877af485d49f11e227c0d22a7bb4a341533d6':
  Revert "Rewrite atomic.h to use stdatomic.h."
2014-10-04 02:17:43 +00:00
Hans Boehm
2789faabfa Revert "Rewrite atomic.h to use stdatomic.h."
This reverts commit cb344d4640.

Change-Id: Ib17cd8d00695062177ce863cedc4ec7148012317
2014-10-04 00:49:06 +00:00
Hans Boehm
954fc61b6b am f5204549: am 028928fe: Merge "Rewrite atomic.h to use stdatomic.h."
* commit 'f5204549faf7310cc808bcb3676fb36268178e26':
  Rewrite atomic.h to use stdatomic.h.
2014-10-04 00:06:45 +00:00
Hans Boehm
cb344d4640 Rewrite atomic.h to use stdatomic.h.
Replace atomic-inl.h with a file that just includes atomic.h.
Remove platform specific implementations.

Change-Id: If16d74fbe0af7836ed8c1296c17e13a2d0d20f64
2014-10-01 17:37:20 -07:00
Christopher Ferris
6bcc4acc6f Use the correct debuggerd given the tid.
On 64 bit systems, calling dump_backtrace_to_file will automatically
call debuggerd64. If the process to dump is actually 32 bit, this
creates an unrecognizable dump backtrace. Modify the code to check the
type of the process and connect to the appropriate debuggerd process.

This change refactors both the tombstone and backtrace functionality to
allow both to work properly on 64 bit systems when dealing with mixed
processes.

Bug: 17487122

(cherry picked from commit a9fa7b87f1)

Change-Id: I3c9e0212c8720877a6af092071a3695df2a36df8
2014-09-13 16:22:17 -07:00
Christopher Ferris
07bb3f1e0b am 07dda6b5: Merge "Use the correct debuggerd given the tid." into lmp-dev
* commit '07dda6b57c6a476177b68ad42966f24cbbdb04c1':
  Use the correct debuggerd given the tid.
2014-09-13 22:54:00 +00:00
Christopher Ferris
a9fa7b87f1 Use the correct debuggerd given the tid.
On 64 bit systems, calling dump_backtrace_to_file will automatically
call debuggerd64. If the process to dump is actually 32 bit, this
creates an unrecognizable dump backtrace. Modify the code to check the
type of the process and connect to the appropriate debuggerd process.

This change refactors both the tombstone and backtrace functionality to
allow both to work properly on 64 bit systems when dealing with mixed
processes.

Bug: 17487122
Change-Id: Icf123a6f4508b1aeec073663aa1a0ceae5380aa1
2014-09-12 20:12:11 -07:00
Hans Boehm
cad56b6ad3 Remove android_... store_barriers and 64-bit atomics.
These are no longer used, and we want to strongly discourage future use.
Keep the 32-bit variants while there are still uses.  All users should move
to C11 or C++11 atomics.

(Resolved conflicts in atomic-...64.h with uniprocessor support
removal as in AOSP.)

Bug:16880454

Change-Id: I122b541cfd29ef4a6c932647f85d0d6a9d802061
(cherry picked from commit 9959ed9530)
2014-09-02 17:08:38 -07:00
Hans Boehm
d034eb1171 am 424eaece: am 69001e08: Merge "Remove android_... store_barriers and 64-bit atomics."
* commit '424eaece64e3649082a3972a8eebf76a6b403494':
  Remove android_... store_barriers and 64-bit atomics.
2014-08-27 22:09:03 +00:00
Hans Boehm
9959ed9530 Remove android_... store_barriers and 64-bit atomics.
These are no longer used, and we want to strongly discourage future use.
Keep the 32-bit variants while there are still uses.  All users should move
to C11 or C++11 atomics.

Change-Id: I122b541cfd29ef4a6c932647f85d0d6a9d802061
2014-08-27 14:15:09 -07:00
Elliott Hughes
176fe9005d am 4592d73e: am a59b6ac6: Merge "Only the Mac doesn\'t have open_memstream."
* commit '4592d73e18684b8ba2addb97433eed4cf389e386':
  Only the Mac doesn't have open_memstream.
2014-08-21 03:16:26 +00:00
Elliott Hughes
a59b6ac697 Merge "Only the Mac doesn't have open_memstream." 2014-08-21 00:11:41 +00:00
Elliott Hughes
3ff8888f66 Only the Mac doesn't have open_memstream.
We should probably move this into art, since they're the only people using it.

Bug: 17164505
Change-Id: I67b8f0cbad4c6368d4424e6979d6b044dd36aa37
2014-08-20 16:16:24 -07:00
Elliott Hughes
3601abb810 am f7e88e51: am 373c7758: Merge "There\'s no non-SMP LP64."
* commit 'f7e88e51b31e64e085b3a564f4b1baa8334d63f1':
  There's no non-SMP LP64.
2014-08-20 20:49:36 +00:00
Elliott Hughes
901c900ce6 There's no non-SMP LP64.
Bug: 17108682
Change-Id: I7e44ab48b5cacf989333882ffe67f39e9b0ce843
2014-08-20 13:05:55 -07:00
Jeff Brown
de4d921192 Add trace tag for power management.
Bug: 17004602
Change-Id: Iecd79e6e0417c02b902cde468b0e842f9348b386
2014-08-14 19:24:30 -07:00
Elliott Hughes
2befa73f68 Remove <cutils/tztime.h>.
(cherry picked from commit f2e4b411e6)

Bug: 15765976
Change-Id: I758acdb18d75ea601a06d02b53f1df9f1ad17a26
2014-07-24 16:16:59 -07:00
Elliott Hughes
f2e4b411e6 Remove <cutils/tztime.h>.
Change-Id: I043c6686361bda9e85b82408511bf241a42b9229
2014-07-24 16:13:39 -07:00
Hans Boehm
b14f65cb50 Do not typedef char16_t if it is a keyword.
Don't define char16_t on platforms where char16_t is a keyword, as
C11 and C++11 define it to be.

(cherry picked from commit dfdbe61d28)
Change-Id: I6717bc2133c1363ecd85861f3869e1eabd2ce96a
2014-07-18 17:53:02 -07:00
Hans Boehm
dfdbe61d28 Do not typedef char16_t if it is a keyword.
Don't define char16_t on platforms where char16_t is a keyword, as
C11 and C++11 define it to be.

Change-Id: I6717bc2133c1363ecd85861f3869e1eabd2ce96a
2014-07-16 16:09:37 -07:00
Hans Boehm
5af7877950 Add comment to discourage use of cutils/atomic.h.
Change-Id: Ib05c745158fdf5a11fd4697c3665a6370ffc04f5
2014-07-11 18:30:13 -07:00
Hans Boehm
4b9f899bf1 am e6b0c566: am 981dcd79: Merge "Add comment to discourage use of cutils/atomic.h."
* commit 'e6b0c566762dbea1c45198d15ecc5e8a59378d73':
  Add comment to discourage use of cutils/atomic.h.
2014-07-12 19:36:58 +00:00
Elliott Hughes
e6d567bd10 am 8e1f3f58: am 2c2fdae7: am 633be1f3: Merge "Remove android_atomic_swap from mips & mips64."
* commit '8e1f3f58e41e97cb6cf131d8bcd75e3ad2e733ad':
  Remove android_atomic_swap from mips & mips64.
2014-06-23 20:25:20 +00:00
Elliott Hughes
7688ef0063 am bad62c53: am ba467827: am 29705171: Merge "[MIPS64] add atomic-mips64"
* commit 'bad62c532c8fabbada924c617d983fbfc94623e3':
  [MIPS64] add atomic-mips64
2014-06-23 19:54:10 +00:00
Elliott Hughes
a74680fcc8 Remove android_atomic_swap from mips & mips64.
Looks like this got left behind in mips by mistake, and
84c3e99231 carried this over to mips64.
Clean up before it wastes any more time...

Change-Id: I6aeaa6e68be81f94065589337e2f7d3483e6e43c
2014-06-23 11:57:30 -07:00
Elliott Hughes
2970517132 Merge "[MIPS64] add atomic-mips64" 2014-06-23 14:50:49 +00:00
Igor Murashkin
d8f2a8d34a cutils: Add property_get_bool, _get_int32, _get_int64
* Read out system properties with same syntax as SystemProperties.java
* Also adds unit test suite to validate correctness of properties
* Also fixes buffer overrun in property_get

(cherry picked from commit d4507e9246)

Change-Id: Ifd42911f93e17da09e6ff1298e8875e02f3b6608
2014-06-20 20:01:49 +00:00
Duane Sand
84c3e99231 [MIPS64] add atomic-mips64
Supplied by Broadcom.

Change-Id: Ica8f4f6e713623e372a68e1dc11086ceb52516da
2014-06-03 16:15:01 -07:00
Elliott Hughes
540a1849cb am b3697ec2: am c752d6dd: am bf082ffb: Merge "Updated trace.h to recognize ATRACE_TAG_BIONIC."
* commit 'b3697ec2cb75d4f13c22a54b0ef90f4e8fb46e02':
  Updated trace.h to recognize ATRACE_TAG_BIONIC.
2014-05-28 22:17:56 +00:00
Elliott Hughes
bf082ffb71 Merge "Updated trace.h to recognize ATRACE_TAG_BIONIC." 2014-05-28 21:35:57 +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
Mark Salyzyn
881c89c54a am 7aa8cdfb: am 21157abc: am 8814bd1d: Merge "include: cleanup for -Wsystem-header"
* commit '7aa8cdfb317dcb7efb7127b070526df09da05377':
  include: cleanup for -Wsystem-header
2014-05-23 22:33:41 +00: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
2594f0f6d1 am 2113474a: am 17c3a227: am 617c28b8: Merge "Fix list_for_each_safe macro"
* commit '2113474ae090ee4c6a06864011ce8a4e4cae9673':
  Fix list_for_each_safe macro
2014-05-23 19:34:02 +00:00
Colin Cross
795e59b32a am fcc81e3c: am 184eecf0: am 4ecbda41: Merge "Add list_add_head to libcutils"
* commit 'fcc81e3c6f0724b3b360b19071005e559334bc58':
  Add list_add_head to libcutils
2014-05-23 19:34:02 +00: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