Loading include/backtracedeleted 120000 → 0 +0 −1 Original line number Diff line number Diff line ../libbacktrace/include/backtrace No newline at end of file libutils/Android.bp +6 −0 Original line number Diff line number Diff line Loading @@ -43,7 +43,13 @@ cc_library_headers { header_libs: ["libbacktrace_headers"], export_header_lib_headers: ["libbacktrace_headers"], }, linux_glibc: { header_libs: ["libbacktrace_headers"], export_header_lib_headers: ["libbacktrace_headers"], }, linux_bionic: { header_libs: ["libbacktrace_headers"], export_header_lib_headers: ["libbacktrace_headers"], enabled: true, }, windows: { Loading libutils/RefBase.cpp +33 −16 Original line number Diff line number Diff line Loading @@ -21,9 +21,9 @@ #include <android-base/macros.h> #include <utils/RefBase.h> #include <log/log.h> #include <utils/CallStack.h> #include <utils/RefBase.h> #include <utils/Mutex.h> Loading Loading @@ -55,6 +55,17 @@ // case. #define DEBUG_REFBASE_DESTRUCTION 1 #if !defined(_WIN32) // CallStack is only supported on linux type platforms. #define CALLSTACK_ENABLED 1 #else #define CALLSTACK_ENABLED 0 #endif #if CALLSTACK_ENABLED #include <utils/CallStack.h> #endif // --------------------------------------------------------------------------- namespace android { Loading Loading @@ -196,7 +207,7 @@ public: while (refs) { char inc = refs->ref >= 0 ? '+' : '-'; ALOGD("\t%c ID %p (ref %d):", inc, refs->id, refs->ref); #if DEBUG_REFS_CALLSTACK_ENABLED #if DEBUG_REFS_CALLSTACK_ENABLED && CALLSTACK_ENABLED CallStack::logStack(LOG_TAG, refs->stack.get()); #endif refs = refs->next; Loading @@ -210,7 +221,7 @@ public: while (refs) { char inc = refs->ref >= 0 ? '+' : '-'; ALOGD("\t%c ID %p (ref %d):", inc, refs->id, refs->ref); #if DEBUG_REFS_CALLSTACK_ENABLED #if DEBUG_REFS_CALLSTACK_ENABLED && CALLSTACK_ENABLED CallStack::logStack(LOG_TAG, refs->stack.get()); #endif refs = refs->next; Loading @@ -218,7 +229,9 @@ public: } if (dumpStack) { ALOGE("above errors at:"); #if CALLSTACK_ENABLED CallStack::logStack(LOG_TAG); #endif } } Loading Loading @@ -261,8 +274,7 @@ public: renameRefsId(mWeakRefs, old_id, new_id); } void trackMe(bool track, bool retain) { void trackMe(bool track, bool retain) { mTrackEnabled = track; mRetain = retain; } Loading Loading @@ -306,7 +318,7 @@ private: { ref_entry* next; const void* id; #if DEBUG_REFS_CALLSTACK_ENABLED #if DEBUG_REFS_CALLSTACK_ENABLED && CALLSTACK_ENABLED CallStack::CallStackUPtr stack; #endif int32_t ref; Loading @@ -323,7 +335,7 @@ private: // decrement the reference count. ref->ref = mRef; ref->id = id; #if DEBUG_REFS_CALLSTACK_ENABLED #if DEBUG_REFS_CALLSTACK_ENABLED && CALLSTACK_ENABLED ref->stack = CallStack::getCurrent(2); #endif ref->next = *refs; Loading Loading @@ -359,7 +371,9 @@ private: ref = ref->next; } #if CALLSTACK_ENABLED CallStack::logStack(LOG_TAG); #endif } } Loading @@ -385,7 +399,7 @@ private: snprintf(buf, sizeof(buf), "\t%c ID %p (ref %d):\n", inc, refs->id, refs->ref); out->append(buf); #if DEBUG_REFS_CALLSTACK_ENABLED #if DEBUG_REFS_CALLSTACK_ENABLED && CALLSTACK_ENABLED out->append(CallStack::stackToString("\t\t", refs->stack.get())); #else out->append("\t\t(call stacks disabled)"); Loading Loading @@ -719,7 +733,10 @@ RefBase::~RefBase() // Treating this as fatal is prone to causing boot loops. For debugging, it's // better to treat as non-fatal. ALOGD("RefBase: Explicit destruction, weak count = %d (in %p)", mRefs->mWeak.load(), this); #if CALLSTACK_ENABLED CallStack::logStack(LOG_TAG); #endif #else LOG_ALWAYS_FATAL("RefBase: Explicit destruction, weak count = %d", mRefs->mWeak.load()); #endif Loading Loading
include/backtracedeleted 120000 → 0 +0 −1 Original line number Diff line number Diff line ../libbacktrace/include/backtrace No newline at end of file
libutils/Android.bp +6 −0 Original line number Diff line number Diff line Loading @@ -43,7 +43,13 @@ cc_library_headers { header_libs: ["libbacktrace_headers"], export_header_lib_headers: ["libbacktrace_headers"], }, linux_glibc: { header_libs: ["libbacktrace_headers"], export_header_lib_headers: ["libbacktrace_headers"], }, linux_bionic: { header_libs: ["libbacktrace_headers"], export_header_lib_headers: ["libbacktrace_headers"], enabled: true, }, windows: { Loading
libutils/RefBase.cpp +33 −16 Original line number Diff line number Diff line Loading @@ -21,9 +21,9 @@ #include <android-base/macros.h> #include <utils/RefBase.h> #include <log/log.h> #include <utils/CallStack.h> #include <utils/RefBase.h> #include <utils/Mutex.h> Loading Loading @@ -55,6 +55,17 @@ // case. #define DEBUG_REFBASE_DESTRUCTION 1 #if !defined(_WIN32) // CallStack is only supported on linux type platforms. #define CALLSTACK_ENABLED 1 #else #define CALLSTACK_ENABLED 0 #endif #if CALLSTACK_ENABLED #include <utils/CallStack.h> #endif // --------------------------------------------------------------------------- namespace android { Loading Loading @@ -196,7 +207,7 @@ public: while (refs) { char inc = refs->ref >= 0 ? '+' : '-'; ALOGD("\t%c ID %p (ref %d):", inc, refs->id, refs->ref); #if DEBUG_REFS_CALLSTACK_ENABLED #if DEBUG_REFS_CALLSTACK_ENABLED && CALLSTACK_ENABLED CallStack::logStack(LOG_TAG, refs->stack.get()); #endif refs = refs->next; Loading @@ -210,7 +221,7 @@ public: while (refs) { char inc = refs->ref >= 0 ? '+' : '-'; ALOGD("\t%c ID %p (ref %d):", inc, refs->id, refs->ref); #if DEBUG_REFS_CALLSTACK_ENABLED #if DEBUG_REFS_CALLSTACK_ENABLED && CALLSTACK_ENABLED CallStack::logStack(LOG_TAG, refs->stack.get()); #endif refs = refs->next; Loading @@ -218,7 +229,9 @@ public: } if (dumpStack) { ALOGE("above errors at:"); #if CALLSTACK_ENABLED CallStack::logStack(LOG_TAG); #endif } } Loading Loading @@ -261,8 +274,7 @@ public: renameRefsId(mWeakRefs, old_id, new_id); } void trackMe(bool track, bool retain) { void trackMe(bool track, bool retain) { mTrackEnabled = track; mRetain = retain; } Loading Loading @@ -306,7 +318,7 @@ private: { ref_entry* next; const void* id; #if DEBUG_REFS_CALLSTACK_ENABLED #if DEBUG_REFS_CALLSTACK_ENABLED && CALLSTACK_ENABLED CallStack::CallStackUPtr stack; #endif int32_t ref; Loading @@ -323,7 +335,7 @@ private: // decrement the reference count. ref->ref = mRef; ref->id = id; #if DEBUG_REFS_CALLSTACK_ENABLED #if DEBUG_REFS_CALLSTACK_ENABLED && CALLSTACK_ENABLED ref->stack = CallStack::getCurrent(2); #endif ref->next = *refs; Loading Loading @@ -359,7 +371,9 @@ private: ref = ref->next; } #if CALLSTACK_ENABLED CallStack::logStack(LOG_TAG); #endif } } Loading @@ -385,7 +399,7 @@ private: snprintf(buf, sizeof(buf), "\t%c ID %p (ref %d):\n", inc, refs->id, refs->ref); out->append(buf); #if DEBUG_REFS_CALLSTACK_ENABLED #if DEBUG_REFS_CALLSTACK_ENABLED && CALLSTACK_ENABLED out->append(CallStack::stackToString("\t\t", refs->stack.get())); #else out->append("\t\t(call stacks disabled)"); Loading Loading @@ -719,7 +733,10 @@ RefBase::~RefBase() // Treating this as fatal is prone to causing boot loops. For debugging, it's // better to treat as non-fatal. ALOGD("RefBase: Explicit destruction, weak count = %d (in %p)", mRefs->mWeak.load(), this); #if CALLSTACK_ENABLED CallStack::logStack(LOG_TAG); #endif #else LOG_ALWAYS_FATAL("RefBase: Explicit destruction, weak count = %d", mRefs->mWeak.load()); #endif Loading