diff options
author | Bill Peckham <bpeckham@google.com> | 2018-08-31 14:51:14 -0700 |
---|---|---|
committer | Bill Peckham <bpeckham@google.com> | 2018-08-31 14:51:14 -0700 |
commit | 444b55f41abdc074774a181cf3a0312bc5648a5b (patch) | |
tree | 427b6effbbdd9fe54776bd8e929e8f60c75d983d /libutils/CallStack.cpp | |
parent | f4c8b47b8efee20583b379cf1d7e53506d891e55 (diff) |
Merge QP1A.180823.001
Change-Id: I43a054f155f100b3d7f414e17d3af9b900a05ab5
Diffstat (limited to 'libutils/CallStack.cpp')
-rw-r--r-- | libutils/CallStack.cpp | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/libutils/CallStack.cpp b/libutils/CallStack.cpp index bd6015e79..fe6f33d74 100644 --- a/libutils/CallStack.cpp +++ b/libutils/CallStack.cpp @@ -16,16 +16,15 @@ #define LOG_TAG "CallStack" -#include <utils/CallStack.h> - -#include <memory> - #include <utils/Printer.h> #include <utils/Errors.h> #include <utils/Log.h> #include <backtrace/Backtrace.h> +#define CALLSTACK_WEAK // Don't generate weak definitions. +#include <utils/CallStack.h> + namespace android { CallStack::CallStack() { @@ -76,4 +75,30 @@ void CallStack::print(Printer& printer) const { } } +// The following four functions may be used via weak symbol references from libutils. +// Clients assume that if any of these symbols are available, then deleteStack() is. + +#ifdef WEAKS_AVAILABLE + +CallStack::CallStackUPtr CallStack::getCurrentInternal(int ignoreDepth) { + CallStack::CallStackUPtr stack(new CallStack()); + stack->update(ignoreDepth + 1); + return stack; +} + +void CallStack::logStackInternal(const char* logtag, const CallStack* stack, + android_LogPriority priority) { + stack->log(logtag, priority); +} + +String8 CallStack::stackToStringInternal(const char* prefix, const CallStack* stack) { + return stack->toString(prefix); +} + +void CallStack::deleteStack(CallStack* stack) { + delete stack; +} + +#endif // WEAKS_AVAILABLE + }; // namespace android |