Commit Graph

126 Commits

Author SHA1 Message Date
Christopher Ferris aa63d9f980 Use real time signal for threads instead of SIGURG.
This guarantees that any application is not also using this signal
for some other purpose.

Change-Id: I7c9bbb0ec8bb4e13322ecda951bcd43c6bf6ee1a
2014-04-30 16:32:47 -07:00
Christopher Ferris 873dc35b74 am c79e511d: am 481b551a: am 0b0e0eae: Merge "Small cleanup of duplicated test values."
* commit 'c79e511d828cd3dfdd79af40ce5be556a4c2ff9b':
  Small cleanup of duplicated test values.
2014-04-29 16:09:06 +00:00
Christopher Ferris 11b5fcb9f1 Small cleanup of duplicated test values.
A few flags were duplicates of flags already passed when using the TEST
targets.

Change-Id: I8f0d09915f5b830050fe25635a0852e8536e3aca
2014-04-28 21:06:31 -07:00
Christopher Ferris 8439e3249e am 2d3bccde: am 61af820e: am 2317287d: Merge "Remove libcorkscrew."
* commit '2d3bccdedc058e2f9e10d507c43e1da51d32260f':
  Remove libcorkscrew.
2014-04-25 22:38:21 +00:00
Christopher Ferris 8f36be3cdb am e3615230: am 8c526578: am 4a5966b9: Merge "Change sprintf to snprintf calls."
* commit 'e36152308da6b1e67b05ad790081bc7e4424ae4e':
  Change sprintf to snprintf calls.
2014-04-25 22:38:10 +00:00
Christopher Ferris 688a8a7232 Remove libcorkscrew.
All unwinding is now done through libunwind.

Change-Id: I93ba6f5bd5ad41eeb5f6a93113b7894f842cc8e0
2014-04-25 11:25:56 -07:00
Christopher Ferris b8c72957f0 Change sprintf to snprintf calls.
Change-Id: I8893246fcd541d97b02a1a4cac81c53c6cd2e394
2014-04-24 16:20:50 -07:00
Christopher Ferris 04c5192ff5 am 3af88bc6: am e87dab14: am 07fa0433: Merge "Remove the arm64 special case."
* commit '3af88bc6377f50904ad3172b06f76d95ceda9cda':
  Remove the arm64 special case.
2014-04-22 13:37:44 +00:00
Christopher Ferris 04fd4389fb Remove the arm64 special case.
The stack-protector option is handled by the global makefiles.

Change-Id: I99c4a1624e72ad91ac10eef27c0e3758fe9af8ba
2014-04-21 17:57:56 -07:00
Christopher Ferris 17224d57fb Avoid logging functions from signal handler.
(cherry picked from commit 9007677fcb)

Change-Id: Ic0163f43308c6a281ab3757d90933e5127843fed
2014-04-15 12:18:44 -07:00
Christopher Ferris 9007677fcb Avoid logging functions from signal handler.
Change-Id: Ic61f7054ced223631f95efb519fa1825fb3e1010
2014-04-11 13:05:07 -07:00
Christopher Ferris 7962e4acc7 am 6a8c3164: am e35cba9a: am a97798af: Merge "Create an UnwindMapLocal object."
* commit '6a8c316438032c72ffdd2988cc1eb2717f477254':
  Create an UnwindMapLocal object.
2014-04-04 03:19:39 +00: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
Christopher Ferris dc6d9241de am a6631bb3: am 3bcefc66: am 62f12bd9: Merge "Enable libunwind for mips."
* commit 'a6631bb38fbf77415592c10734710df8afa0deab':
  Enable libunwind for mips.
2014-02-26 22:39:08 +00:00
Christopher Ferris c29a1345a0 Enable libunwind for mips.
Change-Id: Ib1d7bea0cb7ac09a9e15c7f429ecfd944649fc87
2014-02-26 13:41:32 -08:00
Colin Cross c89210e3a8 am ec04a8d4: am d90b11b6: am 13274a26: Merge "Fix logging errors inside ALOGV"
* commit 'ec04a8d45bc6b01c3c2cd4a3064d194f7beeb386':
  Fix logging errors inside ALOGV
2014-02-10 12:51:26 +00:00
Colin Cross f4b0b7971c Fix logging errors inside ALOGV
Fix errors exposed by adding checking to disabled ALOGVs.

Change-Id: I36b77bb0ad8dc7661b0f834f20d1179b86134d57
2014-02-07 13:26:04 -08:00
Christopher Ferris a3fe7a7927 am 10c2607c: am 77b23023: am 3faf86c0: Merge "Call a specialized local map set."
* commit '10c2607c3cc4903ca8dcbe2245f66d21af199865':
  Call a specialized local map set.
2014-02-03 17:00:01 +00:00
Christopher Ferris 73dc1cc3fb Call a specialized local map set.
Bug: 12852152
Change-Id: I8a0c558bc218805b0e06371af0af055e4aa6e0bb
2014-02-01 11:53:33 -08:00
Christopher Ferris 936fa72620 am 5127626b: am 3133a4a2: am 0fdf0dc7: Merge "Refactor makefile."
* commit '5127626b4a7d998a75d366bf1128be91c6047dc0':
  Refactor makefile.
2014-01-31 23:11:20 +00:00
Elliott Hughes 9361b58330 am fe0d5d42: am 5434bf66: Merge "LP64: Enable debuggerd/libbacktrace/libunwind."
* commit 'fe0d5d42e4ca8b77d6a0657be1b8b6343c21d689':
  LP64: Enable debuggerd/libbacktrace/libunwind.
2014-01-31 22:38:29 +00:00
Christopher Ferris 04b1e8c812 Refactor makefile.
With this change allow the creation of host backtrace libraries using
libunwind.

Change-Id: Ie48bb36cf0d2eccf94cb8ff516d829d8032f11f2
2014-01-31 10:16:52 -08:00
Elliott Hughes daea762e03 am e5734557: am caefe564: Merge "x86: Enable libunwind"
* commit 'e5734557d962c801375eeee600e89c98d65dd976':
  x86: Enable libunwind
2014-01-31 16:41:14 +00:00
Christopher Ferris 6334485f16 am cbe55724: am 7957529d: Merge "Clean up UnwindCurrent.cpp\'s use of ucontext.h."
* commit 'cbe55724c8211c9c06362cebff0a262197dbc351':
  Clean up UnwindCurrent.cpp's use of ucontext.h.
2014-01-31 16:41:13 +00:00
Ian Rogers f312814060 am c9869057: am 1ca10eab: Merge "Avoid redefinition of __STDC_FORMAT_MACROS."
* commit 'c98690576ab6d7d13e5c0d3387db8149de71d9de':
  Avoid redefinition of  __STDC_FORMAT_MACROS.
2014-01-31 16:41:11 +00: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
Pavel Chupin c124402f39 x86: Enable libunwind
Change-Id: I098787f57801f68d0419732d5fd475c7e916c92c
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
2014-01-30 11:00:38 -08:00
Christopher Ferris 5c40019a92 Clean up UnwindCurrent.cpp's use of ucontext.h.
Change-Id: I9eff7486b9fe89eac57b5555649b871bc6f1cc77
2014-01-30 10:37:39 -08:00
Ian Rogers ddeb7cc164 Avoid redefinition of __STDC_FORMAT_MACROS.
Change-Id: I5c65ea196bb9a197a74899ceb53543f289f6d494
2014-01-29 17:53:50 -08:00
Christopher Ferris cc98fd7eb2 am ab2de415: am 773c9ab7: am c96c2954: am a152ed73: Merge "Fix global pointing to local variable."
* commit 'ab2de41574d15bac8c3ef8f49cfba493ea501a0a':
  Fix global pointing to local variable.
2014-01-29 12:49:39 +00:00
Christopher Ferris 96a0bf1e94 am 36a4e408: am aaf89887: am 6fe31b2f: am d391c9b4: Merge "Re-enable libunwind for arm."
* commit '36a4e4085e55048ee2a78c7d5b50f7395e547fa2':
  Re-enable libunwind for arm.
2014-01-29 12:19:59 +00:00
Christopher Ferris 2b4ae52a56 Fix global pointing to local variable.
Change-Id: I933cbb680ca6310c13634f09a9827077c8dbd568
2014-01-28 22:21:14 -08:00
Christopher Ferris df2906186b Re-enable libunwind for arm.
Update to handle the new optimized way that libunwind works.

In addition, a small refactor of the BacktraceMap code.

A few new tests of for good measure.

Change-Id: I2f9b4f5ad5a0dfe907b31febee76e4b9b94fb76f
2014-01-28 12:03:36 -08:00
Christopher Ferris 56e7335902 am 8d12b4a0: am 4fe48966: am 57c9b95b: am 39baa829: Merge "Get arm64 to compile."
* commit '8d12b4a0901df4ab708243b4cd36c19ac2002a50':
  Get arm64 to compile.
2014-01-27 22:23:41 +00:00
Christopher Ferris edbe3b4b56 Get arm64 to compile.
Change-Id: Ica021aa134388fe7069a5de5df8036ecf0d570f8
2014-01-27 10:52:08 -08:00
Colin Cross 892af2303f am 9222d911: am c8518616: am 02f68c4b: am 4800e20e: Merge "system/core: rename aarch64 target to arm64"
* commit '9222d911a89d30a9b0537e8cdb95401be3a4999e':
  system/core: rename aarch64 target to arm64
2014-01-24 21:24:52 +00:00
Colin Cross d4146e6091 system/core: rename aarch64 target to arm64
Rename aarch64 build targets to arm64.  The gcc toolchain is still
aarch64.

Change-Id: Ia92d8a50824e5329cf00fd6f4f92eae112b7f3a3
2014-01-23 18:01:14 -08:00
Christopher Ferris 10c51a3875 am f95d880f: am 884116c8: am 719b0198: am 1db584b8: Merge "Attempt to fix Mac build"
* commit 'f95d880fe7e9a8860038a5c8391b89cfbeb0ce76':
  Attempt to fix Mac build
2014-01-18 23:56:34 +00:00
Brian Carlstrom db5911a08a Attempt to fix Mac build
Change-Id: I1364255bfed7788a35531962508bad804b8d5b7f
2014-01-18 13:55:54 -08:00
Christopher Ferris 6c625f6717 resolved conflicts for merge of 47fa9064 to master
Change-Id: I53fb8ff2dfbefe6246385e624c5c3525cc6f4253
2014-01-17 11:56:04 -08:00
Christopher Ferris 46756821c4 Rewrite libbacktrace to be all C++.
This includes removing the map_info.c source and replacing it with the
BacktraceMap class to handle all map related code.

Change all callers of libbacktrace map functionality.

Also modify the corkscrew thread code so that it doesn't need to build
the map twice (once in the corkscrew format and once in the libbacktrace
format).

Change-Id: I32865a39f83a3dd6f958fc03c2759ba47d12382e
2014-01-16 16:12:29 -08:00
Elliott Hughes ef53917406 am 7dee721e: am 42e82f80: am 4a8996fb: am 3352c503: Merge "Copy the bionic -fstack-protector hack into libbacktrace."
* commit '7dee721eb3387fff695e5b5a3480428bccb3cf70':
  Copy the bionic -fstack-protector hack into libbacktrace.
2014-01-15 01:00:47 +00:00
Elliott Hughes 1380ddcab2 Copy the bionic -fstack-protector hack into libbacktrace.
aarch64 doesn't support -fstack-protector yet.

Change-Id: Id1e589742ba074f59d3390d059248c9b371aff58
2014-01-14 16:44:31 -08:00
Christopher Ferris 475377b68a am 117e93a7: am 2c3b9a44: am d9cb2964: am 91e2019f: Merge "Create a bare bones host libbacktrace on mac."
* commit '117e93a7208d028ccbc444aad8bd5ad250459c67':
  Create a bare bones host libbacktrace on mac.
2014-01-14 18:13:24 +00:00
Christopher Ferris f67c6410d1 Create a bare bones host libbacktrace on mac.
This allows the libbacktrace library to compile for host on mac.

Bug: 12474939
Change-Id: I32cbcf996e6fe9057e5065ba21f89086343704a0
2014-01-13 23:57:35 -08:00
Christopher Ferris 4167d7e5c2 resolved conflicts for merge of 8791ee5c to master
Change-Id: I107bb055941809331c451c1d903f231f07a86ece
2014-01-13 18:14:11 -08:00
Christopher Ferris 20303f856f Next phase of the move, reformat use C++ features.
Use the libbacktrace C++ interface instead of the C interface in debuggerd.

Reformat the debuggerd code to be closer to Google C++ style.

Fix all debuggerd casts to be C++ casts.

Add a frame number to the frame data structure for ease of formatting and
add another FormatFrameData function.

Change the format_test to use the new FormatFrameData function.

Modify all of the backtrace_test to use the C++ interface.

Change-Id: I10e1610861acf7f4a3ad53276b74971cfbfda464
2014-01-13 14:21:52 -08:00
Christopher Ferris bc12d6329e Move BACKTRACE_NO_TID to BACKTRACE_CURRENT_THREAD.
Use a bit better name for this. The other name was a bit confusing.

Change-Id: I1261f2ee3854a9c8b82133ad0bfbbbe48b43c9ac

(cherry picked from commit 242b1a8c7a)

Conflicts:
	libbacktrace/Backtrace.cpp
2014-01-09 15:49:39 -08:00
Christopher Ferris a74ead0fd6 resolved conflicts for merge of 72f204de to master
Change-Id: I7345014d00c669aea5e27ea50b2ac658145b068b
2014-01-08 16:20:50 -08:00
Christopher Ferris 9846497f79 Refactor to share map_info amongst threads.
Allow the use of the same map info to be shared when getting information on
multiple threads from the same pid.

Change-Id: I2e460e20154a10f4894ae563331fb32179e4551f
2014-01-08 15:32:28 -08:00
Christopher Ferris ae998c7117 am 0298da56: am 492b0ca4: am 1e424d8e: am 0afaf7f4: Merge "Fix the ucontext for mips/x86."
* commit '0298da56f410ba0f6a1f1f44deb8e2224f9fc49d':
  Fix the ucontext for mips/x86.
2014-01-07 23:53:18 +00:00
Christopher Ferris ddc4f093f7 Fix the ucontext for mips/x86.
Remove the mips ucontext definition, there is no need for it any more.

Fix the mips/x86 ucontext copy code to copy the entire uc_mcontext data
across.

Fix a potential memory leak too.

Change-Id: I4272022da5281ed881e2d59a3e19e7f33c01aceb
2014-01-07 14:36:03 -08:00
Elliott Hughes d0dfd00270 am 3e30f6af: am 090928b1: am a345b253: am dfc48139: Merge "Switch ARM back to libcorkscrew temporarily."
* commit '3e30f6afa042f3bba4822dc5d1ef267ed4b9d722':
  Switch ARM back to libcorkscrew temporarily.
2014-01-02 23:39:38 +00:00
Elliott Hughes 3c67fe9039 Switch ARM back to libcorkscrew temporarily.
We're seeing major stack trace generation performance
regression and want to find out whether it's libunwind.

Bug: 12181612
Change-Id: I3866ea956859f5cbdfe4f1ee6f20a2b6d39962c4
2014-01-02 15:25:21 -08:00
Christopher Ferris 242b1a8c7a Move BACKTRACE_NO_TID to BACKTRACE_CURRENT_THREAD.
Use a bit better name for this. The other name was a bit confusing.

Change-Id: I1261f2ee3854a9c8b82133ad0bfbbbe48b43c9ac
2013-11-12 12:14:51 -08:00
Christopher Ferris e70f95f349 am 90e67bcd: am d36bfc30: am e6279294: Merge "Revert "Revert enabling libunwind.""
* commit '90e67bcdc383d552dc5325039c86b5bef5429b05':
  Revert "Revert enabling libunwind."
2013-11-07 21:30:34 -08:00
Christopher Ferris e6feaeeda1 Revert "Revert enabling libunwind."
This reverts commit db2309e3d1.

Change-Id: I1626442f029473066ce20921667a406f1a1ea865
2013-11-08 02:59:52 +00:00
Elliott Hughes d283d93489 am 8ddd08b1: am 4ae94541: am 62ea993a: Merge "Revert enabling libunwind."
* commit '8ddd08b1f24d361ace9cd78198664db4bf7e1325':
  Revert enabling libunwind.
2013-11-07 09:44:32 -08:00
Christopher Ferris 3c8b229f60 am c3920dee: am 11d04d04: am 351b0123: Merge "Enable libunwind on arm platforms."
* commit 'c3920dee104856025f9416670efd7f05d1acd3a0':
  Enable libunwind on arm platforms.
2013-11-07 09:01:24 -08:00
Christopher Ferris db2309e3d1 Revert enabling libunwind.
It appears that some branches might not have libunwind set up properly.

Change-Id: Ia72889e115bc2791c7a9e67563c5f4a62197cafd
2013-11-07 08:12:10 -08:00
Christopher Ferris 22f91cb3a1 Enable libunwind on arm platforms.
Bug: 8410085
Change-Id: I8a645ec0e04b38fc186bbc0f0cc597e31b05cc55
2013-11-06 15:40:23 -08:00
Christopher Ferris 62a70df064 am dee1842d: am adbb3352: am a2d1469c: Merge "Use new defines in test code."
* commit 'dee1842d2f6861dd4cb2d622992ec2c75f19ab3e':
  Use new defines in test code.
2013-11-05 14:22:25 -08:00
Christopher Ferris 0186edee58 am 2e47c8ac: am 1e1bae1b: am c2945850: Merge "Add some clarifying defines."
* commit '2e47c8ac74e070d62cfb46355c7c04797657c594':
  Add some clarifying defines.
2013-11-05 14:22:20 -08:00
Christopher Ferris d709ad3da0 am 4ddea7f4: am d5a7c371: am 408b3acf: Merge "Add corkscrew support for finding static symbols."
* commit '4ddea7f44c6362e7c34939302729e4508aa665c5':
  Add corkscrew support for finding static symbols.
2013-11-05 13:00:47 -08:00
Christopher Ferris 7f081ec079 Use new defines in test code.
In addition, fix up the warnings and remove the -fpermissive when
compiling.

Change-Id: Ia27b902499b34ff3d881acb9057120af390baf2c
2013-11-05 12:13:05 -08:00
Christopher Ferris cbfc7302fb Add some clarifying defines.
In order to be explicit in the Backtrace::Create() calls, adding a couple
of defines and some comments to describe what they mean.

Change-Id: I6ad08c529791821496a95fa33cea1c95b0a7eada
2013-11-05 11:05:32 -08:00
Christopher Ferris 923b536920 Add corkscrew support for finding static symbols.
Change-Id: Ie557a9b0efadece75e1accaa7e214fb559eb19e1
2013-11-04 14:50:36 -08:00
Christopher Ferris 74160cb775 am 6b7b6541: am b5c24e09: am 8c58086c: Merge "More libbacktrace fixes."
* commit '6b7b65417aead0189681c12d9162f31e8bc9b3e5':
  More libbacktrace fixes.
2013-10-30 14:33:32 -07:00
Christopher Ferris 8ed46278be More libbacktrace fixes.
Included in minor fix ups is the addition of a warning macro to replace
all of the ALOGW calls.

Fix a race where multiple threads could be attempting to unwind the threads
of the current process at the same time.

Bug: 8410085

Change-Id: I02a65dc778dde690e5f95fc8ff069a32d0832fd1
2013-10-30 14:14:54 -07:00
Christopher Ferris 6996f91809 resolved conflicts for merge of 0433d622 to master
Change-Id: I6799c3fe8900ddcb2e9fe3032793dbb0996cf177
2013-10-29 13:56:52 -07:00
Christopher Ferris 17e91d44ed Rewrite libbacktrace using C++.
The old code was essentially trying to be C++ in C and was awkward. This
change makes it all objects with a thin layer that C code can use.

There is a C++ backtrace object that is not very useful, this code will
replace it.

This change also includes moving the backtrace test to a gtest, and adding
coverage of all major functionality.

Bug: 8410085
Change-Id: Iae0f1b09b3dd60395f71ed66010c1ea5cdd37841
2013-10-28 17:55:25 -07:00
Christopher Ferris 4aef2e911e am 7bdb7b42: am 81890fd8: am 5daba1e0: Merge "Only build host library on linux-x86."
* commit '7bdb7b42224c6139c400eb47a5e9b660184aad54':
  Only build host library on linux-x86.
2013-10-02 14:34:43 -07:00
Christopher Ferris 9e1ee2b3c6 Only build host library on linux-x86.
Change-Id: I26d5bd4b34c3669897fea1488fa58972f4299757
2013-10-02 14:19:19 -07:00
Christopher Ferris 6d22960759 Move cutils/log.h to log/log.h.
The log.h file moved, so clean up these references to the old
location.

Change-Id: I25494ea069bfb20fa07a02e67868c8be82e60161
2013-10-01 23:46:23 -07:00
Christopher Ferris a16a4e10e1 Fix problems in libbacktrace.
- Add a wait for stop to backtrace_test. There is a possible race
  condition that is exposed when using libunwind.
- Fix a few calls to unwind function calls.

Bug: 8410085
Change-Id: I7487d687f6d4b7b05b8a96ad1c5f7183681e5c95
2013-10-01 18:08:03 -07:00
Christopher Ferris 7fb22878d4 Create a single backtrace library.
This library will be used to abstract away getting backtrace
data from how it is implemented. This is the first step to
replacing libcorkscrew with libunwind.

Bug: 8410085
Change-Id: Ie8f159e96a055d378e1ddc72d40239fba4cf52b7
2013-09-28 12:26:35 -07:00