summaryrefslogtreecommitdiffstats
path: root/libutils/ProcessCallStack.cpp
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2013-10-31 16:25:04 -0700
committerChristopher Ferris <cferris@google.com>2013-11-06 12:37:14 -0800
commit9b0e074c6d38143e01616404a08b0c7aa992f3c3 (patch)
treec8cc73a2d73f7a600d70eee4fee2028895a61066 /libutils/ProcessCallStack.cpp
parent62a70df0643e7d5d40613904bf6c9747494366ef (diff)
downloadsystem_core-9b0e074c6d38143e01616404a08b0c7aa992f3c3.zip
system_core-9b0e074c6d38143e01616404a08b0c7aa992f3c3.tar.gz
system_core-9b0e074c6d38143e01616404a08b0c7aa992f3c3.tar.bz2
Move CallStack to libbacktrace.
Fix a small bug in the Printer for strings that didn't properly prepend the prefix. Change-Id: I33c63841ef6e07728ab3195886539d82b38ee19a
Diffstat (limited to 'libutils/ProcessCallStack.cpp')
-rw-r--r--libutils/ProcessCallStack.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/libutils/ProcessCallStack.cpp b/libutils/ProcessCallStack.cpp
index f9340c5..f837bcb 100644
--- a/libutils/ProcessCallStack.cpp
+++ b/libutils/ProcessCallStack.cpp
@@ -123,7 +123,7 @@ void ProcessCallStack::clear() {
mTimeUpdated = tm();
}
-void ProcessCallStack::update(int32_t maxDepth) {
+void ProcessCallStack::update() {
DIR *dp;
struct dirent *ep;
struct dirent entry;
@@ -181,14 +181,13 @@ void ProcessCallStack::update(int32_t maxDepth) {
int ignoreDepth = (selfPid == tid) ? IGNORE_DEPTH_CURRENT_THREAD : 0;
// Update thread's call stacks
- CallStack& cs = threadInfo.callStack;
- cs.update(ignoreDepth, maxDepth, tid);
+ threadInfo.callStack.update(ignoreDepth, tid);
// Read/save thread name
threadInfo.threadName = getThreadName(tid);
ALOGV("%s: Got call stack for tid %d (size %zu)",
- __FUNCTION__, tid, cs.size());
+ __FUNCTION__, tid, threadInfo.callStack.size());
}
if (code != 0) { // returns positive error value on error
ALOGE("%s: Failed to readdir from %s (errno = %d, '%s')",
@@ -221,13 +220,12 @@ void ProcessCallStack::printInternal(Printer& printer, Printer& csPrinter) const
for (size_t i = 0; i < mThreadMap.size(); ++i) {
pid_t tid = mThreadMap.keyAt(i);
const ThreadInfo& threadInfo = mThreadMap.valueAt(i);
- const CallStack& cs = threadInfo.callStack;
const String8& threadName = threadInfo.threadName;
printer.printLine("");
printer.printFormatLine("\"%s\" sysTid=%d", threadName.string(), tid);
- cs.print(csPrinter);
+ threadInfo.callStack.print(csPrinter);
}
dumpProcessFooter(printer, getpid());