summaryrefslogtreecommitdiffstats
path: root/heaptracker.c
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
commit6497c6b0f63ffa8db3dc1eda27964117fce3b653 (patch)
tree0dcb266c59217db155ceaaf307173360315cf500 /heaptracker.c
parentf062e54bdf77f83e3e36d408fb2f39fab1a6e896 (diff)
downloadhardware_ti_omap4-6497c6b0f63ffa8db3dc1eda27964117fce3b653.tar.gz
hardware_ti_omap4-6497c6b0f63ffa8db3dc1eda27964117fce3b653.tar.bz2
hardware_ti_omap4-6497c6b0f63ffa8db3dc1eda27964117fce3b653.zip
omap4xxx: now heaptracker can dump stack traces in-place
Change-Id: I98114b4b25049a7702448bb3dfffa74976cc7aa8 Signed-off-by: Iliyan Malchev <malchev@google.com>
Diffstat (limited to 'heaptracker.c')
-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);