summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIliyan Malchev <malchev@google.com>2011-08-22 11:59:04 -0700
committerIliyan Malchev <malchev@google.com>2011-08-23 08:27:36 -0700
commitc169ecd6aea1ed7b8a786f130aee7d980a4b9701 (patch)
tree451a63ec475b9632c174a4fb18dddfb43b3ef31c
parentaa6e62e279cb54ae76c55ba9f8d02da230ce34e7 (diff)
downloadhardware_ti_omap4xxx-c169ecd6aea1ed7b8a786f130aee7d980a4b9701.zip
hardware_ti_omap4xxx-c169ecd6aea1ed7b8a786f130aee7d980a4b9701.tar.gz
hardware_ti_omap4xxx-c169ecd6aea1ed7b8a786f130aee7d980a4b9701.tar.bz2
omap4xxx: now heaptracker can dump stack traces in-place
Change-Id: I98114b4b25049a7702448bb3dfffa74976cc7aa8 Signed-off-by: Iliyan Malchev <malchev@google.com>
-rw-r--r--heaptracker.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/heaptracker.c b/heaptracker.c
index 6f2dcfe..84c2f49 100644
--- a/heaptracker.c
+++ b/heaptracker.c
@@ -96,10 +96,17 @@ static struct hdr *backlog_first;
static struct hdr *backlog_last;
static pthread_rwlock_t backlog_lock = PTHREAD_RWLOCK_INITIALIZER;
-static void print_backtrace(const intptr_t *bt, int depth)
+void print_backtrace(const intptr_t *bt, int depth)
{
mapinfo *mi;
int cnt, rel_pc;
+ intptr_t self_bt[MAX_BACKTRACE_DEPTH];
+
+ if (!bt) {
+ depth = heaptracker_stacktrace(self_bt, MAX_BACKTRACE_DEPTH);
+ bt = self_bt;
+ }
+
malloc_log("*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***\n");
for (cnt = 0; cnt < depth && cnt < MAX_BACKTRACE_DEPTH; cnt++) {
mi = pc_to_mapinfo(milist, bt[cnt], &rel_pc);