Commit graph

214 commits

Author SHA1 Message Date
Pirama Arumuga Nainar
80fb4b09f4 Make libbacktrace build with LLVM r275480
Bug: http://b/31320715

Test: No regression in 32-bit and 64-bit backtrace_test on host and
angler.

Change-Id: Ic5c5511e89ca7707ed9c13d5ba0539e09310dfe3
2016-10-25 22:16:47 -07:00
Colin Cross
fc75f94643 Merge "Add missing host ldlibs" 2016-10-20 19:21:25 +00:00
Colin Cross
53783b1976 Add missing host ldlibs
Host builds were compiling without -Wl,--no-undefined.  Add missing
host ldlibs so that -Wl,--no-undefined can be added again.

Test: m -j host
Bug: 32305815
Change-Id: I0ceabc3f4ec74e2f737afaac58810c5d53d6ccb6
2016-10-20 10:39:51 -07:00
Mark Salyzyn
cfd5b080af system/core: preparation to pull back interfaces from android/log.h
Point to log/log.h where necessary, define LOG_TAG where necessary.
Accept that private/android_logger.h is suitable replacement for
log/logger.h and android/log.h.

Correct liblog/README

Effectively a cleanup and controlled select revert of
'system/core: drop or replace log/logger.h' and
'system/core: Replace log/log.h with android/log.h'.

Test: compile
Bug: 30465923
Change-Id: Ic2ad157bad6f5efe2c6af293a73bb753300b17a2
2016-10-20 08:11:39 -07:00
Treehugger Robot
955648a915 Merge "Rely on the platform -std default." 2016-10-14 02:28:38 +00:00
Christopher Ferris
279843e139 Use process_vm_readv to read memory.
Modify BacktracePtrace::Read to use the process_vm_readv syscall
instead of doing multiple ptrace calls.

Test: Ran the backtrace unit tests on host and on x86_64 emulator.

Change-Id: I24c2787f6713d8eb44312f3aa751d1f6d9d34719
2016-10-12 12:43:55 -07:00
Elliott Hughes
36e0d390a2 Rely on the platform -std default.
Bug: http://b/32019064
Test: builds
Change-Id: I18a1d816d63b64601485045070851f32d44e85eb
2016-10-10 14:31:12 -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
Colin Cross
99f6b86733 Replace libziparchive-host with libziparchive
libziparchive-host is no longer necessary, and mixing libziparchive-host
and libziparchive can cause ODR violations.

Change-Id: I27b2cc9974000ee7bf1d1ac15fd7b069862d9b01
2016-08-26 11:12:38 -07:00
Chih-Hung Hsieh
4c4fa90462 Merge \"Fix clang-tidy performance warnings in syste/core.\"
am: 4efbce14b5

Change-Id: I84f6b0134fae6e9f40710f243f4825e3f31fa15f
2016-08-01 20:23:10 +00:00
Treehugger Robot
4efbce14b5 Merge "Fix clang-tidy performance warnings in syste/core." 2016-08-01 20:13:54 +00:00
Chih-Hung Hsieh
8f7b9e3d39 Fix clang-tidy performance warnings in syste/core.
* Use const reference type for parameters to avoid unnecessary copy.
* Suppress warning of not using faster overloaded string find function.

Bug: 30407689
Bug: 30411878
Change-Id: I6cfdbbd50cf5e8f3db6e5263076d3a17a9a791ee
Test: build with WITH_TIDY=1
Merged-In: Ie79dbe21899867bc62031f8618bb1322b8071525
2016-08-01 11:55:42 -07:00
Chih-Hung Hsieh
89cc78b77f Merge \"Fix google-explicit-constructor warnings in system/core.\"
am: 6dc68cb5f9

Change-Id: I5a010465364b6e14423b19e8c0f9cffa58ee3152
2016-07-29 17:01:17 +00:00
Chih-Hung Hsieh
034c475931 Fix google-explicit-constructor warnings in system/core.
* Declare explicit conversion constructors.
* Add NOLINT for implicit conversion constructors.
* Fix also some misaligned indendations.

Bug: 28341362
Change-Id: Idf911f35923b408d92285cc1a053f382ba08c63e
Test: build with clang-tidy
2016-07-26 11:26:01 -07:00
Colin Cross
2fedbf79bb resolve merge conflicts of 41e82a3 to stage-aosp-master
Change-Id: I5a7faca3249f0c038914540b1dd29edf0084c0e1
2016-07-12 23:53:04 -07:00
Dan Willemsen
2e1591bef9 Convert libbacktrace, libutils to Soong
Change-Id: I8b578f671f92246aca61f98937d75a60b56bc5c6
2016-07-12 17:20:18 -07:00
Christopher Ferris
e1eb2272d6 Merge \"Fix race condition updating local map data.\"
am: 863d8e11b9

Change-Id: I00899ce500c2ae8bc58b6eb42c01d8688dd232c0
2016-06-18 00:05:26 +00:00
Christopher Ferris
3a14004c7f Fix race condition updating local map data.
If the underlying local map changes, it's possible for multiple
threads to try and modify the map data associated with the UnwindLocalMap
object. Add a lock when generating the local map to avoid this problem.

In addition, add a read lock whenever any caller gets the maps iterator.
Updated all iterator callers to make this lock.

Bug: 29387050
Change-Id: Ie34822c3d8fd3bdb3dd126aeeb399969c36508c1
2016-06-16 23:28:11 -07:00
Dan Willemsen
823d5bbc20 Merge "Remove invalid uses of -l and -I" am: 5d6193c658
am: 9ae3c079dc

* commit '9ae3c079dca647869dcbc5a5075609f0895e4f4c':
  Remove invalid uses of -l and -I

Change-Id: Id0ddd34cee10579684cdde36f3c095658a50784b
2016-06-01 21:57:27 +00:00
Dan Willemsen
ee2da03e26 Remove invalid uses of -l and -I
LOCAL_LDLIBS should only be used with -l flags for NDK and some host
libraries. Other uses should use LOCAL_SHARED_LIBRARIES.

LOCAL_LDFLAGS should not contain -l entries, they should be in
LOCAL_LDLIBS instead.

LOCAL_CFLAGS should not contain -I entries, those should use
LOCAL_C_INCLUDES instead.

Change-Id: Ic901aa14651572ac682166becd4f0cd86baecc34
2016-06-01 13:41:23 -07:00
Chih-Hung Hsieh
dccd3a3698 Merge "Fix misc-macro-parentheses warnings in adb, debuggerd, libbacktrace." am: dab7d9de03
am: fa7569c921

* commit 'fa7569c921b9ca0db894287ea826cbd3b041d880':
  Fix misc-macro-parentheses warnings in adb, debuggerd, libbacktrace.

Change-Id: I63223e36f3627d312051c86d54919b6cef33766c
2016-05-19 00:05:39 +00:00
Chih-Hung Hsieh
67867dbd79 Fix misc-macro-parentheses warnings in adb, debuggerd, libbacktrace.
Bug: 28705665
Change-Id: I469b2a882f6d1f399bfc22c75a26da245991fc33
2016-05-18 15:53:15 -07:00
Chih-hung Hsieh
fb44ca5178 Merge "Fix google-explicit-constructor warnings." am: 7bdd6a8b5a
am: 427d8d840f

* commit '427d8d840f6ec5ce5767b2ee521e4ac5b7ebd619':
  Fix google-explicit-constructor warnings.

Change-Id: I26dc45aca83f991aa7993f6d4233e0439dd44a22
2016-04-30 05:16:35 +00:00
Chih-Hung Hsieh
1c563d96f0 Fix google-explicit-constructor warnings.
Bug: 28341362
Change-Id: I4504e98a8db31e0edcbe63c23f9af43eb13e9d86
2016-04-29 15:44:04 -07:00
Chih-hung Hsieh
f648232165 Merge "Fix google-runtime-int warnings." am: 603df0e
am: 6eaa916

* commit '6eaa91685fa69bd7bb4309933899a9e33fa61dfd':
  Fix google-runtime-int warnings.

Change-Id: I2e0fd77a2c841e5279973f08e961bf2ffdd41c09
2016-04-19 16:25:05 +00:00
Chih-Hung Hsieh
ec2ff8c176 Fix google-runtime-int warnings.
Bug: 28220065
Change-Id: I6b8e121ddf98355d1c1ac034c2e3522b2b49e14b
2016-04-18 14:45:46 -07:00
Yabin Cui
3424eaa01d Merge "libbacktrace: only build libbacktrace_offline static library." am: f20e4b1
am: b150324

* commit 'b1503248f4baa28ed739948a51da370bf40037ea':
  libbacktrace: only build libbacktrace_offline static library.

Change-Id: I903f82a38022f7094b70bc8e4d59ac5098456571
2016-04-14 21:38:12 +00:00
Yabin Cui
51e607056d libbacktrace: only build libbacktrace_offline static library.
As device may not have libbacktrace_offline shared library, simpleperf
no longer rely on it. So there is no reason to keep libbacktrace_offline
shared library.

Bug: 28152982
Change-Id: If8e31b1434646dbbfed60264eb25f034bc5d6946
2016-04-14 10:31:08 -07:00
Yabin Cui
566692fa11 Merge "libbacktrace_offline: support unwinding of shared libraries in apk file." am: d8c88fc
am: f63704e

* commit 'f63704ed5a9daa40b9e471c7020ae4e4541dee79':
  libbacktrace_offline: support unwinding of shared libraries in apk file.

Change-Id: If880c04da5ab6b4faa232b80fbfceca37f63d41d
2016-03-29 18:30:19 +00:00
Yabin Cui
b791a76ed7 libbacktrace_offline: support unwinding of shared libraries in apk file.
Bug: 26962895
Change-Id: I009080f26e7323247c3ab24eea614eec4432ca6a
2016-03-26 16:06:23 -07:00
Josh Gao
c7d8777d56 Don\'t demangle symbol names. am: fbbc744 am: 0edda64 am: 9bf0b81 am: 0fb3191
am: 05e1e1f

* commit '05e1e1fb4100bb52fab2af41dc6caaf31c527819':
  Don't demangle symbol names.
2016-03-23 20:58:50 +00:00
Josh Gao
05e1e1fb41 Don\'t demangle symbol names. am: fbbc744 am: 0edda64 am: 9bf0b81
am: 0fb3191

* commit '0fb3191840680f7e084aa9ee53a1906074a16b68':
  Don't demangle symbol names.
2016-03-23 20:52:26 +00:00
Josh Gao
0edda648fb Don\'t demangle symbol names.
am: fbbc744

* commit 'fbbc744130c85538a754d245e958d7d79f24309c':
  Don't demangle symbol names.
2016-03-23 20:40:48 +00:00
Josh Gao
fbbc744130 Don't demangle symbol names.
Bug: http://b/27299236
Change-Id: I26ef47f80d4d6048a316ba51e83365ff65d70439
2016-03-23 11:43:35 -07:00
Stephen Hines
a0062cfc31 Update BacktraceOffline for LLVM rebase to r256229.
Bug: http://b/26987366

(cherry picked from commit 19c30e9516)

Change-Id: I5e4568292c0b4bbd2daefc0abd3d36c691622eb4
2016-03-20 22:58:29 -07:00
Pirama Arumuga Nainar
922e151ba2 Merge "Update BacktraceOffline for LLVM rebase to r256229." 2016-03-18 21:54:51 +00:00
Christopher Ferris
c463ba45c4 Add error reporting mechanism for failing Unwind.
Remove the logging of an error if a thread disappears before the unwind
can begin. This can happen, so allow the caller to determine if this
is really a problem worth logging.

Bug: 27449879

(cherry picked from commit 206a3b9798)

Change-Id: If9e7cfeb6eb7b122679a734c1a9eacee8354ef18
2016-03-10 14:14:43 -08:00
Christopher Ferris
206a3b9798 Add error reporting mechanism for failing Unwind.
Remove the logging of an error if a thread disappears before the unwind
can begin. This can happen, so allow the caller to determine if this
is really a problem worth logging.

Bug: 27449879
Change-Id: Ie81718d53fb0e519fa0a7db9fd5f314b72bfa431
2016-03-10 12:39:15 -08:00
Christopher Ferris
26cf352637 Merge "Don't fail if the new pss is less than stable." 2016-03-08 18:09:18 +00:00
Stephen Hines
19c30e9516 Update BacktraceOffline for LLVM rebase to r256229.
Bug: http://b/26987366
Change-Id: I3c5f3349a669c04bb40dd7175f840b57dc46f7f6
2016-03-08 01:23:43 -08:00
Christopher Ferris
5ccdfa6349 Don't fail if the new pss is less than stable.
Sometimes, the new pss is significantly less than the stable pss. Do
not fail if this case occurs.

Change-Id: Ic7da87275a821818e375d05cac10e84c62710c5e
2016-03-07 19:18:31 -08:00
Andreas Gampe
a7a7369343 Revert "Do not do local unwinds through .oat or .dex maps."
This reverts commit 4265ed7cc8.

Workaround in libunwind instead: change-id I98be5754cc4de4071616db334dc0c9862d3a2504

Bug: 27391690

(cherry picked from commit 04dcb00ab7)

Change-Id: Id77dc081b655dc0fcb513ad0ee95221d91a301f9
2016-03-02 13:20:35 -08:00
Andreas Gampe
04dcb00ab7 Revert "Do not do local unwinds through .oat or .dex maps."
This reverts commit 4265ed7cc8.

Workaround in libunwind instead: change-id I98be5754cc4de4071616db334dc0c9862d3a2504

Bug: 27391690
Change-Id: Id77dc081b655dc0fcb513ad0ee95221d91a301f9
2016-03-02 19:39:21 +00:00
Christopher Ferris
b035a19e4f Do not do local unwinds through .oat or .dex maps.
Bug: 27391690

(cherry picked from commit 4265ed7cc8)

Change-Id: I88a49537544b507a3b0bfa61eafc27400a05281b
2016-03-01 18:19:42 -08:00
Christopher Ferris
4265ed7cc8 Do not do local unwinds through .oat or .dex maps.
Bug: 27391690
Change-Id: I88a49537544b507a3b0bfa61eafc27400a05281b
2016-03-01 18:07:59 -08:00
James Hawkins
588a2cad7f system/core: Cleanup direct calls to opendir by containing in a
std::unique_ptr.

Bug: 26643633
Change-Id: Ia3491fdbff086558da694ae949cf08e4c89d0307
2016-02-18 14:52:46 -08:00
Yabin Cui
9946a8f755 libbacktrace: support building static libraries on target.
Bug: 27125711

Change-Id: I28a49e3e128fa4291815a54cf942452bd1f9f756
2016-02-10 15:20:44 -08:00
Christopher Ferris
d4c884330c Fix use of uninitialized memory.
When creating an UnwindMapLocal fails in the Build() function call,
the destructor for UnwindMap is called. Unfortunately, the map_cursor_
member variable has not been initialized, so the call to destroy it
winds up operating on garbage data.

Part of this is a result of a bad class hierarchy, so this refactors
the classes slightly, and properly initializes the map_cursor_ member
variable in the base class.

Bug: 26931578
Change-Id: I885596bf65e4ef63559cee2c56cd41576d5ecc1b
2016-02-05 15:22:34 -08:00
Than McIntosh
1e0fea291a Fix for host simpleperf 'gettid' unsat.
Bug: 26900419
Change-Id: Ifefd017f4b62ecfb2521bd1c38dbb3b09054f205
2016-02-01 15:59:40 -05:00
Christopher Ferris
8540216028 Put BacktraceOffline code into a separate library.
BacktraceOffline is the only code that uses libLLVM. Create
a new shared library, backtrace_offline.so, that references this
so that including libbacktrace.so doesn't wind up pulling in libLLVM.

Change-Id: I90c502d833f6c464c3810dffde52a0c6da241cce
2016-01-25 16:26:48 -08:00