Loading opengl/libs/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -108,7 +108,6 @@ cc_defaults { // In particular, DO NOT add libutils nor anything "above" libui "libgraphicsenv", "libnativewindow", "libbacktrace", "libbase", ], } Loading Loading @@ -165,6 +164,7 @@ cc_library_shared { "libnativeloader_lazy", "libutils", "libSurfaceFlingerProp", "libunwindstack", ], static_libs: [ "libEGL_getProcAddress", Loading opengl/libs/EGL/CallStack.h +9 −6 Original line number Diff line number Diff line Loading @@ -16,8 +16,8 @@ #pragma once #include <backtrace/Backtrace.h> #include <log/log.h> #include <unwindstack/AndroidUnwinder.h> #include <memory> Loading @@ -26,12 +26,15 @@ public: // Create a callstack with the current thread's stack trace. // Immediately dump it to logcat using the given logtag. static void log(const char* logtag) noexcept { std::unique_ptr<Backtrace> backtrace( Backtrace::Create(BACKTRACE_CURRENT_PROCESS, BACKTRACE_CURRENT_THREAD)); if (backtrace->Unwind(2)) { for (size_t i = 0, c = backtrace->NumFrames(); i < c; i++) { unwindstack::AndroidLocalUnwinder unwinder; unwindstack::AndroidUnwinderData data; if (unwinder.Unwind(data)) { for (size_t i = 2, c = data.frames.size(); i < c; i++) { auto& frame = data.frames[i]; // Trim the first two frames. frame.num -= 2; __android_log_print(ANDROID_LOG_DEBUG, logtag, "%s", backtrace->FormatFrameData(i).c_str()); unwinder.FormatFrame(frame).c_str()); } } } Loading Loading
opengl/libs/Android.bp +1 −1 Original line number Diff line number Diff line Loading @@ -108,7 +108,6 @@ cc_defaults { // In particular, DO NOT add libutils nor anything "above" libui "libgraphicsenv", "libnativewindow", "libbacktrace", "libbase", ], } Loading Loading @@ -165,6 +164,7 @@ cc_library_shared { "libnativeloader_lazy", "libutils", "libSurfaceFlingerProp", "libunwindstack", ], static_libs: [ "libEGL_getProcAddress", Loading
opengl/libs/EGL/CallStack.h +9 −6 Original line number Diff line number Diff line Loading @@ -16,8 +16,8 @@ #pragma once #include <backtrace/Backtrace.h> #include <log/log.h> #include <unwindstack/AndroidUnwinder.h> #include <memory> Loading @@ -26,12 +26,15 @@ public: // Create a callstack with the current thread's stack trace. // Immediately dump it to logcat using the given logtag. static void log(const char* logtag) noexcept { std::unique_ptr<Backtrace> backtrace( Backtrace::Create(BACKTRACE_CURRENT_PROCESS, BACKTRACE_CURRENT_THREAD)); if (backtrace->Unwind(2)) { for (size_t i = 0, c = backtrace->NumFrames(); i < c; i++) { unwindstack::AndroidLocalUnwinder unwinder; unwindstack::AndroidUnwinderData data; if (unwinder.Unwind(data)) { for (size_t i = 2, c = data.frames.size(); i < c; i++) { auto& frame = data.frames[i]; // Trim the first two frames. frame.num -= 2; __android_log_print(ANDROID_LOG_DEBUG, logtag, "%s", backtrace->FormatFrameData(i).c_str()); unwinder.FormatFrame(frame).c_str()); } } } Loading