From c169ecd6aea1ed7b8a786f130aee7d980a4b9701 Mon Sep 17 00:00:00 2001 From: Iliyan Malchev Date: Mon, 22 Aug 2011 11:59:04 -0700 Subject: omap4xxx: now heaptracker can dump stack traces in-place Change-Id: I98114b4b25049a7702448bb3dfffa74976cc7aa8 Signed-off-by: Iliyan Malchev --- heaptracker.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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); -- cgit v1.1